Postgres dump failes when password is needed
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 180
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
I receive the following error when trying to back up a Postgres database container that requires a password for pg_dump:
pg_dump: error: connection to server at "adventurelog-db" (172.18.0.2), port 5432 failed: fe_sendauth: no password supplied
The password is provided in an .env file (POSTGRES_PASSWORD). However, it does not seem to be used by stack-back.
When executing pg_dump directly in the database container, it asks for a password, and if provided, the dump succeeds.
As other database containers, e.g., for immich, do not require a password, when using pg_dump within the container, I suspect that the database container used by AdventureLog might have a special configuration. But as far as I understand, that should be no problem, as stack-back should take the password from the env variable and pass it to pg_dump when backing up.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating stack-back's pg_dump invocation and how the POSTGRES_PASSWORD value from the .env file is loaded. Reproduce the backup with a password-protected Postgres container and compare the environment available to pg_dump; done means the dump succeeds without an interactive password prompt.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, postgresql, python
- Domain
- databases, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100