mirror of
https://github.com/plankanban/planka.git
synced 2026-02-24 19:08:59 +03:00
[Bug]: Did something break DATABASE_PASSWORD__FILE recently?
#741
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @solomon-b on GitHub (Jun 23, 2025).
Where is the problem occurring?
When booting the service.
What browsers are you seeing the problem on?
No response
Current behavior
I hadn't updated in a while and now
DATABASE_PASSWORD__FILEdoesn't seem to work correctly.I can see my password mounted in the container:
If I hard code the password in the connection string then Planka works as expected.
Desired behavior
I would expect the password to be interpolated into the connections string and used for auth. This was working previously.
Steps to reproduce
I mounted my secrets as volumes in the docker container. Then I used
DATABASE_PASSWORD__FILEto specifiy the path to the DB password secret. Lastly I set the connection string to use the secret:"postgresql://planka_admin:${DATABASE_PASSWORD}@transfigured-night/planka"Other information
No response
@fitztrev commented on GitHub (Jun 27, 2025):
I ran into this and it's because of
read(in start.sh) trying to put the contents into the environment variable.If the secret file does not contain a newline it silently fails. The quick solution for me was to update the secret values to contain a trailing newline.
ref https://github.com/plankanban/planka/pull/1132 cc @iosabi
@iosabi commented on GitHub (Jul 30, 2025):
Thanks @meltyshev for pushing a fix. I however wasn't able to reproduce that behavior:
prints:
The /tmp/secret_file doesn't have a newline because it is generated with
echo -n.It could be that the password @solomon-b was using had a backslash somewhere in the middle, which
readwill interpret unless we useread -r(which I should have done, sorry). Either way, ifhead -n 1works then fine with me.@meltyshev commented on GitHub (Jul 30, 2025):
Hey! To be honest, I'm not entirely sure why it fails without a newline at the end. But when I tried to reproduce it by creating a secret file without a trailing newline, the container kept restarting without any errors in the logs.
I just tried your test command and got the same result as you. However, if I add
set -eat the beginning (as we have instart.sh) - it silently fails. Still, it's hard for me to say exactly why it behaves like that 😄@iosabi commented on GitHub (Jul 31, 2025):
Aaaah, that explains it.
readreturn non-zero on EOF.From the bash manual:
It is interesting that
readdoes the thing it is meant to do (read the value into the variable) in addition to returning an error... oh well... bash. Sorry for introducing a bunch of bash I guess =^.^=@meltyshev commented on GitHub (Jul 31, 2025):
Ah, thanks for the info - that's really interesting to know! And no worries at all, everything's totally fine :)