My ttrss has been running fine in Docker for months, and today I see this error on the db container. That causes the whole ttrss system to be inaccessible.
2021-02-02 16:05:53.756 UTC [61] FATAL: password authentication failed for user “%DB_USER”
2021-02-02 16:05:53.756 UTC [61] DETAIL: Role “%DB_USER” does not exist.
Connection matched pg_hba.conf line 95: “host all all all md5”
Have there been recent changes to the codebase that require some manual updates on our end? For example, these changes may be relevant: https://git.tt-rss.org/fox/ttrss-docker-compose/commits/branch/master/docker-compose.yml. Or maybe a typo with “%DB_USER”?
fox
2
https://community.tt-rss.org/t/docker-environment-based-configuration/4237/9
TLDR, because i know you won’t read it anyway:
- update
docker-compose.yml (it should be using TTRSS_DB_USER etc. variables)
- read through
.env-dist, update .env:
- update
SELF_URL_PATH to TTRSS_SELF_URL_PATH
- update
POSTGRES_* variables to TTRSS_DB_*
- optionally remove
config.php on the storage volume thus enabling env-based configuration
- either rebuild (if using dynamic) or restart docker hub image
i’m gonna sticky this because i’m sure you won’t be the only one.
Thank you, that fixed the issue.
I also deleted the config.php file like you said. I like this much better since I can simply update my .env file and recreate the ttrss containers to apply the changes instead of editing the config.php file manually. Good work!
I tidied up the compose file a bit by renaming “POSTGRES_USER” to “TTRSS_DB_USER”, and similar lines, in the .env file so that I could delete all the environment lines from the compose file.
What does this line do: “./config.d:/opt/tt-rss/config.d:ro” in your example compose file? That “opt/tt-rss/config.d/” folder seems to be always empty and the app works ok without it, so does that mean the line in compose.yml is not needed?
Thanks
fox
5
yep, that was the idea. also, making config.php volatile, so it could be easily updated from the image if upstream version changes.
it’s optional, you can remove it if you don’t need it.
this allows you to add custom defines to config.php which are not covered by environment variables. some plugins have settings specific to them, for example smtp mailer, etc.
be aware that postgres container needs those to initialize the database for the first time, so without those variables defined it won’t start.
it would probably be easier to simply use POSTGRES_ variables for tt-rss instead of creating separate ones, I didn’t think about that.
fox
6
alright, so it really doesn’t make a lot of sense to keep both POSTGRES_* and TTRSS_DB_* variables since those are always going to be set to the same value.
let’s keep TTRSS_DB_USER etc. and pass those to db container as needed. i’ll update first post of this thread with new instructions.
relevant changesets:
https://git.tt-rss.org/fox/ttrss-docker-compose/commit/b601ee719cacdebf55c84f4d741877591f37ff79
https://git.tt-rss.org/fox/ttrss-docker-compose/commit/9fc0aaa2cd01c96d613b2b07d24710d7d14c71fc