Page 1 of 1

IllegalArgumentException: --action COPY not in [MOVE, COPY, ...]

Posted: 03 Oct 2021, 21:03
by retikulum
Hi there

I installed filebot-watcher via Stacks in Docker. Filestructure is /Data:/volume1 and command is /volume1/Downloads --output /volume1/Media @/volume1/Media/args.txt
(which contains --def
movieFormat=Filme/{emby}
seriesFormat=Serien/{emby}
musicFormat=Musik/{emby}
--action COPY)

In the logs I get following error message:

Code: Select all

--action COPY not in [MOVE, COPY, KEEPLINK, SYMLINK, HARDLINK, CLONE, DUPLICATE, TEST]

java.lang.IllegalArgumentException: --action COPY not in [MOVE, COPY, KEEPLINK, SYMLINK, HARDLINK, CLONE, DUPLICATE, TEST]

	at net.filebot.StandardRenameAction.forName(Unknown Source)

	at net.filebot.cli.ArgumentBean.getRenameAction(Unknown Source)

	at net.filebot.cli.ScriptShellBaseClass.getRenameAction(Unknown Source)

	at net.filebot.cli.ScriptShellBaseClass.rename(Unknown Source)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

	at Script1$_run_closure65.doCall(Script1.groovy:379)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

	at Script1.run(Script1.groovy:365)

	at net.filebot.cli.ScriptShell.evaluate(Unknown Source)

	at net.filebot.cli.ScriptShell.runScript(Unknown Source)

	at net.filebot.cli.ArgumentProcessor.runScript(Unknown Source)

	at net.filebot.cli.ArgumentProcessor.run(Unknown Source)

	at net.filebot.Main.main(Unknown Source)


Error (o_O)
Permissions are 777.

Does anyone got a solution for this?

Thx

Re: Problem with Docker and filebot-watcher

Posted: 04 Oct 2021, 02:40
by rednoah
SPACE has special meaning on the command-line, but has no special meaning in @files, and thus SPACE is not interpreted as argument separator in your @file line. Please read @file syntax for details:
rednoah wrote: 07 Dec 2015, 07:17 Any character that is not the new line separator is interpreted as literal argument value

e.g. CORRECT pass 2 arguments:
rednoah wrote:Command-line:

Code: Select all

--action COPY
@file file:

Code: Select all

--action
COPY

e.g. INCORRECT pass 1 argument:
retikulum wrote:Command-line:

Code: Select all

"--action COPY"
@file file:

Code: Select all

--action COPY

Re: IllegalArgumentException: --action COPY not in [MOVE, COPY, ...]

Posted: 10 Oct 2021, 08:45
by retikulum
Somehow it still doesn't work as expected.
I found the logfile in a total different folder. It sits in the Docker-subfolder for some reason
/Data/Docker/FileBot2/.filebot/logs/--log-file /volume1/Media
In my Docker Compose text the volumes are defined by this

Code: Select all

    volumes:
      - /Data/Docker/FileBot2:/data
      - /Data:/volume1
      
The args.txt should point the logfile to
--log-file
/volume1/Media/amc.log

Re: IllegalArgumentException: --action COPY not in [MOVE, COPY, ...]

Posted: 10 Oct 2021, 12:19
by rednoah
What is the filebot command-line you're trying to execute?


:idea: Don't do everything at once. Do things step by step. First, prototype your filebot command without docker. Second, integrate your confirmed-to-be-working filebot command into a docker container.


:idea: If you don't have filebot installed on your machine, then you can use docker to prototype your filebot command


e.g. start with something like this, and then change the arguments step by step, doing a test run with every step, until you got the command you want:

Code: Select all

docker run --rm -it -v $PWD:/volume1 -v data:/data rednoah/filebot -script fn:sysinfo

Re: IllegalArgumentException: --action COPY not in [MOVE, COPY, ...]

Posted: 17 Oct 2021, 12:10
by retikulum
So I figured out, that the filebot-watcher docker lacks some features. It runs with root, something like

Code: Select all

    environment:
      - PUID=1000
      - PGID=100
didn't work as expected. I tried to cut the docker compose as much as I can and abandoned the args.txt-way.

Without any arguments filebot-watcher works (very basic). It copies my files into the media folder. But it creates new folders (i.e. "Movies" and "TV Shows"). When I try to use the "--def seriesFormat=" argument it doesnt copy as expected. Do I have use it in Docker Compose with a slash after the equal sign or do I have to start with the output folder directly?

Re: IllegalArgumentException: --action COPY not in [MOVE, COPY, ...]

Posted: 17 Oct 2021, 13:16
by rednoah
It's just amc script arguments. It's just filebot command-line usage. There's nothing specific to docker or docker compose.


:idea: If your format generates a relative path, then that relative path is resolved relatively to the output folder

Code: Select all

--output /output --format {ny}/{ny}

Code: Select all

/output/Avatar (2009)/Avatar (2009).mp4

:idea: If your format generates an absolute path, then that path is used as is:

Code: Select all

--output /output --format /media/Movies/{ny}/{ny}

Code: Select all

/media/Movies/Avatar (2009)/Avatar (2009).mp4

EDIT:

Since you're using the amc script you're going to use the --def seriesFormat and --def movieFormat script parameters instead of the filebot --format option, but conceptually it's the same.

retikulum wrote: 17 Oct 2021, 12:10 When I try to use the "--def seriesFormat=" argument it doesnt copy as expected.
If something doesn't work as expected, do read the console output. The console output will explain what is going on step by step.

Re: IllegalArgumentException: --action COPY not in [MOVE, COPY, ...]

Posted: 23 Oct 2021, 12:17
by retikulum
So, I finally figured the correct code for Docker Compose out

Code: Select all

volumes:
      - /Data/Docker/FileBot2:/data
      - /Data:/volume1
    command: /volume1/Downloads --output /volume1/Media -script fn:amc --def movieFormat="/volume1/Media/Movies/{n}/{n} ({y}" seriesFormat="/volume1/Media/TV Shows/{n}/Season {s.pad(2)}/{n} - {s00e00} - {t}" --action COPY --log-file /volume1/Media/amc.log -non-strict
It seems like Docker compose doesn't accept apostrophes ( ' ).
How can I change the user and group ID of the docker?

Code: Select all

    environment:
      - PUID=1000
      - PGID=100
Doesn't do the job

Re: IllegalArgumentException: --action COPY not in [MOVE, COPY, ...]

Posted: 23 Oct 2021, 12:50
by rednoah
1.
I'd use list syntax to write the list of argument values, more verbose but less error prone:
https://docs.docker.com/compose/compose ... 3/#command

Code: Select all

command: ["bundle", "exec", "thin", "-p", "3000"]


2.
retikulum wrote: 23 Oct 2021, 12:17

Code: Select all

    environment:
      - PUID=1000
      - PGID=100
Doesn't do the job
:?: How did you test and confirm this?


:idea: The default docker ENTRYPOINT will definitely sudo as the given UID or fail:
└─ https://github.com/filebot/filebot-dock ... erfile#L38
└─ https://github.com/filebot/filebot-dock ... s-user#L20

Re: IllegalArgumentException: --action COPY not in [MOVE, COPY, ...]

Posted: 23 Oct 2021, 14:53
by retikulum
Thank you for your answer. I don't understand what the link you provided is about. For a more complex amc-script syntax I'll try the .env- or args.txt-way in the future, I think.

When I inspect the docker container filebot-watcher the changes to your ENV lines are correctly implemented.

Code: Select all

Env
0 PUID=1000
1 PGID=100
2 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
3 FILEBOT_VERSION=4.9.4
4 HOME=/data
5 LANG=C.UTF-8
6 SETTLE_DOWN_TIME=600
But when I look at the transfered files in the output folder, they are all owned by root (which has UID and GID 0).
My Jdownloader Docker (from Jay Moulin) uses the line

Code: Select all

   user: 1000:100 
in docker compose. When I inspect the container, the UID is listed in Labels, not Environment and the output is with the correct UID.

Re: IllegalArgumentException: --action COPY not in [MOVE, COPY, ...]

Posted: 23 Oct 2021, 15:13
by rednoah
1.
The link above is the docker-compose documentation for the command element. It might be useful if you are wondering what kind of values the command element will accept.


2.
Running filebot and having it call the id command shows that the container is running as the given user inside the container:

Code: Select all

$ docker run --rm -it -e PUID=1234 -e PGID=123 -v data:/data rednoah/filebot -script g:"execute 'id'"
uid=1234(filebot) gid=123(filebot) groups=123(filebot)
Done ヾ(@⌒ー⌒@)ノ
:!: Support for PUID and PGID was added recently. Make sure you're using the latest image.

:!: FileBot does not chmod or chown files. If you're just renaming files (inside or outside the container) then I would expect the file owner to remain unchanged. If you're creating / copying files, then probably whatever Linux does by default for the current user context.

Re: IllegalArgumentException: --action COPY not in [MOVE, COPY, ...]

Posted: 23 Oct 2021, 15:56
by retikulum
Ah, yes, I was using -- action COPY. Nevertheless user: 1000:100 was accepted by your container. There were some errors due to permission within the data folder which contains the filebot files.

Code: Select all

An unexpected error occurred during startup: Access Denied: Cache directory is not writable: /data/.filebot/cache/0

java.nio.file.AccessDeniedException: Cache directory is not writable: /data/.filebot/cache/0

	at net.filebot.DiskStore.acquireDiskStore(Unknown Source)

	at net.filebot.DiskStore.acquire(Unknown Source)

	at net.filebot.Main.main(Unknown Source)


Oct 23, 2021 3:45:41 PM java.util.prefs.FileSystemPreferences$1 run

WARNING: java.io.IOException: Permission denied

Could not lock User prefs. Lock file access denied.

java.lang.SecurityException: Could not lock User prefs. Lock file access denied.

	at net.filebot.UserData.flush(Unknown Source)

	at net.filebot.Main.shutdown(Unknown Source)
I changed this folder to the user 1000 and will look at the results. (Preliminary: extraction of .rar in the input folder were with the correct user)

Re: IllegalArgumentException: --action COPY not in [MOVE, COPY, ...]

Posted: 23 Oct 2021, 16:04
by rednoah
That console output doesn't make sense. You're most likely not using the latest image. You'll want to delete all cached images to force docker to download the latest one.


:idea: If you were using the latest image, then $HOME folder would be /data/filebot (as per $PUSER) but according to your log it's /data which indicates that the run-as-user startup script that I'm looking isn't being used in your container:
https://github.com/filebot/filebot-dock ... s-user#L11

Re: IllegalArgumentException: --action COPY not in [MOVE, COPY, ...]

Posted: 23 Oct 2021, 16:08
by retikulum
Yep, thanks for the hint. Had a Image from August. Just pulled the latest, got an error when using the line user: 1000:100 (sudo: you do not exist in the passwd database).
Swapped back to " environment: - PUID=1000 - PGID=100" and now filebote-watcher setp up watches again.
Now in the data folder is a new "filebot" folder (and the old .filebot with the license) which is empty.

Re: IllegalArgumentException: --action COPY not in [MOVE, COPY, ...]

Posted: 23 Oct 2021, 17:10
by retikulum
So, I threw a few files into the input folder and now everything works as expected and with correct permissions. I want to point out that you have to use quotation marks and start with a slash when you use the --def movieFormat in Docker Compose (maybe you can add this to the documentation @rednoah).
I use filebot watcher, which processes the files after Jdownloader finished the download (no call script).

Code: Select all

version: '3.3'
services:
  filebot:
    container_name: filebot-watcher
    image: rednoah/filebot:watcher
    restart: unless-stopped
    environment:
      - PUID=1000
      - PGID=100
    volumes:
      - /Data/Docker/FileBot2:/data
      - /Data:/volume1
    command: /volume1/Downloads --output /volume1/Media -script fn:amc --lang de --def movieFormat="/volume1/Media/Movies/{n}/{n} ({y}" seriesFormat="/volume1/Media/TV  Shows/{n}/Season {s.pad(2)}/{n} - {s00e00} - {t}" --action COPY --log-file /volume1/Media/amc.log -non-strict
This is my final Docker compose script. Maybe I'll try to map the amc script to an args.txt or .env file for more sophisticated scripting (Docker doesn't accept apostrophes for some reason I think).

Thank you very much for your support rednoah.