Transmission problem with -e FILE__PASSWORD not reading a file

Hello,
Not sure if I am ussing this incorrectly but I can’t get the password from file working I am getting following errors when running container:

[env-init] cannot find secret in FILE__PASS
[env-init] cannot find secret in FILE__PASSWORD

I tried both options: FILE__PASSWORD and FILE__PASS just in case.
File is there and it’s not file permissions:

root@omv3:/tmp# ls -la /tmp/secret1 ; cat /tmp/secret1
-rwxrwxrwx 1 root root 15 Nov 8 00:04 /tmp/secret1
secretpassword
root@omv3:/tmp#
root@omv3:/tmp# docker container inspect transmission | grep FILE
“FILE__PASSWORD=/tmp/secret1”,
“FILE__PASS=/tmp/secret1”
root@omv3:/tmp#

Please help pointing me to where I am doing it wrong.

My only suspicion is I should be using docker secrets but the description of this option says otherwise that I should be able to get the password from the file:

" You can set any environment variable from a file by using a special prepend FILE__.
As an example:

-e FILE__PASSWORD=/run/secrets/mysecretpassword

Will set the environment variable PASSWORD based on the contents of the /run/secrets/mysecretpassword file."

Thanks in advance linkinpio

You will need to mount the secretfile into the container, as it cannot read files from the host.

Thanks for a suggestion but I tried that as well, I’ve put a secret in the transmission config dir which is mounted separately and it was the same result.
Or you are saying I need to mount /run/secrets/ as a separate mount explicitly?

What was the env value when using the config folder?

Thanks , goot catch, I got your point I was still putting host path not container path, but now I fixed it

root@omv3:/srv/dev-disk-by-uuid-53db49c8-08e8-4268-aea0-7a6e3a225f2b/omv3-1/docker/transmission/config# docker inspect transmission | grep FILE
                "FILE__PASS=/config/secret1",
                "FILE__PASSWORD=/config/secret1"

and now it’s shows this as loading

[env-init] PASS set from FILE__PASS
[env-init] PASSWORD set from FILE__PASSWORD

but I believe I might have found a bug as the password is not taken as I can’t login with that password and regardless of the text places in the secret1 file the config is the same

root@omv3:/srv/dev-disk-by-uuid-53db49c8-08e8-4268-aea0-7a6e3a225f2b/omv3-1/docker/transmission/config# cat settings.json | grep password
    "rpc-password": "{767fce4c95b40c6f4873483750f743ca7e0d3cc3A3OjiEAb",

But when I populate PASS env with password it changes to different string.

Unless the secret1 file needs to be formatted in some specific way?
Currently I have a password in clear text

root@omv3:/srv/dev-disk-by-uuid-53db49c8-08e8-4268-aea0-7a6e3a225f2b/omv3-1/docker/transmission/config# cat secret1
password

ok so either it’s a bug or the file can’t contain clear text and needs to be formatted in some specific way
as I tried populate a user as it senses the user is provided

[env-init] USER set from FILE__USER

as it enables authentication but user field stays empty so suspect same thing is happening with PASS environment

root@omv3:/srv/dev-disk-by-uuid-53db49c8-08e8-4268-aea0-7a6e3a225f2b/omv3-1/docker/transmission/config# cat settings.json | grep rpc
    "rpc-authentication-required": true,
    "rpc-bind-address": "0.0.0.0",
    "rpc-enabled": true,
    "rpc-host-whitelist": "",
    "rpc-host-whitelist-enabled": false,
    "rpc-password": "{767fce4c95b40c6f4873483750f743ca7e0d3cc3A3OjiEAb",
    "rpc-port": 9091,
    "rpc-url": "/transmission/",
    "rpc-username": "",

how did you create your docker secret file?

I have not created a secret as I don’t feel the need for it, I just want to have the password in the file not as a docker env.
From what I am reading deploying a secret in the docker is just a way to populate encrypted information to docker container which then no longer encrypted but in clear text.

image
same as my password file

root@omv3:~# docker container exec transmission cat /config/secret1
password
root@omv3:~#

I could be wrong, but since we specifically say this is docker secrets…

i think this is why you are having weird issues

I thought the same thing at first but it’s said

You can set any environment variable from a file

And also

Will set the environment variable PASSWORD based on the contents of the /run/secrets/mysecretpassword file

And I already explained that the /run/secrets/… are clear text files inside the container so should not matter.

But again I asked for help here who knows that for sure how this should be implemented to be sure :wink:

Ahh well, since you tested it the way we specified (using docker secrets) and it didn’t work still, I’ll let others chime in. Best wishes

Looks like the file has a newline at the end, this is probably why it’s not working

Great spot, there were no new line but by default there is end of the line added, I’ve used

# echo -n password_in_clear_text > secret

and that gave me text without new line and it’s working now.

Thank you very much for your help.

PS: not sure if it’s worth adding a note in the readme file that env_file needs to be referenced from container and can’t have newline/endline in it, but might help some in future.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.