Problem with activating license in Docker

Support for unRAID and docker container users
Post Reply
retikulum
Posts: 13
Joined: 03 Oct 2021, 20:53

Problem with activating license in Docker

Post by retikulum »

Hi there

somehow filebot-watcher in Docker lost the license. After re-composing and entering the container and trying to add the license the following error occurs:

Code: Select all

filebot --license -e PUID=1000 -e PGID=100

WARNING: java.io.tmpdir directory does not exist

Did you read the manual?
└ https://www.filebot.net/manpage.html

Did you quote and escape your arguments correctly?
└ https://www.filebot.net/help/args.html

args[1] = --license
args[2] = -e
args[3] = PUID=1000
args[4] = -e
args[5] = PGID=100

File does not exist: /-e
Jun 16, 2024 5:06:31 PM java.util.prefs.FileSystemPreferences$1 run
WARNING: Couldn't create user preferences directory. User preferences are unusable.
Jun 16, 2024 5:06:31 PM java.util.prefs.FileSystemPreferences$1 run
WARNING: java.io.IOException: No such file or directory
Jun 16, 2024 5:06:33 PM java.util.prefs.FileSystemPreferences checkLockFile0ErrorCode
WARNING: Could not lock User prefs.  Unix error code 2.
Couldn't get file lock.
java.util.prefs.BackingStoreException: Couldn't get file lock.
        at net.filebot.UserData.flush(Unknown Source)
        at net.filebot.Main.shutdown(Unknown Source)
        at net.filebot.Main.main(Unknown Source)
retikulum
Posts: 13
Joined: 03 Oct 2021, 20:53

Re: Problem with activating license in Docker

Post by retikulum »

After some trial and error

Code: Select all

docker run --rm -it -v data:/data -e PUID=1000 -e PGID=100 rednoah/filebot --license
and entering the license gave this result:

Code: Select all

Initialize Cache folder: /data/filebot/cache
Initialize Logs folder: /data/filebot/logs
Initialize TemporaryFiles folder: /data/filebot/tmp
Initialize new disk cache: /data/filebot/cache/0
Activate License [X] on [Sun Jun 16 17:21:38 UTC 2024]
Write [FileBot License X (Valid-Until: 2071-08-15)] to [/data/filebot/license.txt]
FileBot License X (Valid-Until: 2071-08-15) has been activated successfully.
I hope it works
User avatar
rednoah
The Source
Posts: 23218
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Problem with activating license in Docker

Post by rednoah »

:idea: How do I activate my license?

Shell: Select all

docker run --rm -it -v data:/data rednoah/filebot --license

:idea: How to do I run the process inside the container as a different user?

Shell: Select all

-e PUID=1000 -e PGID=1000

:arrow: Let's say you wanted to pass in custom environment variables. The -e option is a docker option and not a filebot option and so you would add those -e options to the docker command like so:

Shell: Select all

docker run --rm -it -e PUID=1000 -e PGID=100 -v data:/data rednoah/filebot --license
:idea: Please read the FAQ and How to Request Help.
retikulum
Posts: 13
Joined: 03 Oct 2021, 20:53

Re: Problem with activating license in Docker

Post by retikulum »

Well, this led to the aforementioned "successful activation"... But, after dropping some files in the following happend:

Code: Select all

Whoopsies! --action COPY requires a valid license.
* Consider using --action TEST
License Error: UNREGISTERED
 ________________________________________________ 
/ Please purchase a FileBot License:             \
\ https://www.filebot.net/purchase.html#docker   /
 ------------------------------------------------ 
      \                             .       .
       \                           / `.   .' " 
        \                  .---.  <    > <    >  .---.
         \                 |    \  \ - ~ ~ - /  /    |
               _____          ..-~             ~-..-~
              |     |   \~~~\.'                    `./~~~/
             ---------   \__/                        \__/
            .'  O    \     /               /       \  " 
           (_____,    `._.'               |         }  \/~~~/
            `----.          /       }     |        /    \__/
                  `-.      |       /      |       /      `. ,~~|
                      ~-.__|      /_ - ~ ^|      /- _      `..-'   
                           |     /        |     /     ~-.     `-. _  _  _
                           |_____|        |_____|         ~ - . _ _ _ _ _>
FileBot requires a valid license. Please run `filebot --license *.psm` to install your FileBot license.
* FileBot is running as [filebot] using [/data/filebot/license.txt]
* Use `-e PUID=0` and `-e PGID=0` to run FileBot as a different user
Bad License (>_<)

--------------------------------------------------------------------------------

Hello! Do you need help Getting Started?

# FAQ
https://www.filebot.net/linux/docker.html

# Read License Key from Console
docker run --rm -it -v data:/data -e PUID=1000 -e PGID=100 rednoah/filebot --license

--------------------------------------------------------------------------------
User avatar
rednoah
The Source
Posts: 23218
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Problem with activating license in Docker

Post by rednoah »

:?: What exactly are you doing? What is the command you use to install your license? What is the command you use to call filebot to rename files? Please post verbatim all docker commands and corresponding complete console output.



:idea: The answer is almost certainly explained in How do I activate my license? but you may need to arrive at the answer yourself to really understand how docker volume mounts and running programs as different users change the context in which a containerized program is running.


:idea: If you see the "Hello! Do you need help Getting Started?" message on startup, then that means that no license key exists at the expected file path, i.e. filebot --license has not yet been called, or has been called but as a different user, different persistent storage, etc.
:idea: Please read the FAQ and How to Request Help.
retikulum
Posts: 13
Joined: 03 Oct 2021, 20:53

Re: Problem with activating license in Docker

Post by retikulum »

I just follow the instructions meticulously:
After the container ist set up, I run the command as root

Code: Select all

docker run --rm -it -v data:/data -e PUID=1000 -e PGID=100 rednoah/filebot --license
in the CLI.
Then I paste in the License text with PHP signature.
I receive the "activation successful" message, and after dopping a file in the extracted folder, like a few weeks before, it just "forgot" the license.

The Docker ist set up via compose:

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/EXTRACTED --output /volume1/Media -script fn:amc --lang de --def movieFormat="/volume1/Media/Movies/{emby.id}" seriesFormat="/volume1/Media/Series/{n}/Season {s.pad(2)}/{n} - {s00e00} - {t}" --action COPY --log-file /volume1/Media/amc.log -non-strict
User avatar
rednoah
The Source
Posts: 23218
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Problem with activating license in Docker

Post by rednoah »

How do I activate my license? wrote:
Your license will then be stored in -v data:/data (i.e. bind named persistent volume data as /data into the container file system) which is the persistent application data folder common to all FileBot docker containers. Please read Run your app in production ➔ Manage application data ➔ Volumes for details.
:idea: You are using (A) -v data:/data when installing your license. You then effectively "switch hard drives" when you run with (B) volumes: /Data/Docker/FileBot2:/data and so the license installed into (A) named-volume data is predictably not there in (B) /Data/Docker/FileBot2 mapped host volume because it wasn't installed there.


:!: You need to use the same volume mappings (i.e. data:/data or /Data/Docker/FileBot2:/data) in both docker command-line calls and docker compose configuration, otherwise each container is running with a different hard drive attached. You now understand docker volume mounts from experience.


:arrow: e.g. install your license into your /Data/Docker/FileBot2 host folder, so that your other container running with the same volume mounts and same environment variables can then pick it up from there:

Shell: Select all

docker run --rm -it -v /Data/Docker/FileBot2:/data -e PUID=1000 -e PGID=100 rednoah/filebot --license
:idea: Please read the FAQ and How to Request Help.
retikulum
Posts: 13
Joined: 03 Oct 2021, 20:53

Re: Problem with activating license in Docker

Post by retikulum »

This command returned:
WARNING: java.io.tmpdir directory does not exist

But nevertheless the output after inserting the license was again a successful activation. I will try it with new media.

Edit:
Error message still there:

Code: Select all

FileBot requires a valid license. Please run `filebot --license *.psm` to install your FileBot license.
* FileBot is running as [filebot] using [/data/filebot/license.txt]
* Use `-e PUID=0` and `-e PGID=0` to run FileBot as a different user
Bad License (>_<)
User avatar
rednoah
The Source
Posts: 23218
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Problem with activating license in Docker

Post by rednoah »

:idea: This warning means that the user data folder does not yet exist on startup, i.e. filebot is running for the first time for all accounts and purposes, likely due to -v / volumes not being configured correctly, because you're definitely not calling filebot for the first time at this point:

Code: Select all

WARNING: java.io.tmpdir directory does not exist


:?: Can you confirm that you are now using the correct same environment variables and volume mappings at all times in all your docker / docker compose calls?



:idea: You can also manually put the license file where it needs to be, i.e. the following file path from the container-point-of-view:

Code: Select all

/data/filebot/license.txt
:idea: Please read the FAQ and How to Request Help.
Post Reply