Here’s the formatted version of your question suitable for Stack Overflow:
Issue with Dockerized pgAdmin 4: fe_sendauth: no password supplied
I’m trying to set up pgAdmin 4 using the following Dockerfile:
FROM dpage/pgadmin4 AS custom-pgadmin
COPY <<-"EOT" /pgadmin4/servers.json
{
"Servers": {
"1": {
"Name": "Postgres Prefect",
"Group": "Servers",
"Host": "database",
"Port": 5432,
"Username": "postgres",
"MaintenanceDB": "prefect",
"SSLMode": "prefer",
"PassFile": "/pgadmin4/pgpass"
}
}
}
EOT
COPY <<-"EOT" /pgadmin4/pgpass
database:5432:prefect:postgres:postgres
EOT
ENTRYPOINT ["/bin/sh", "-c", "/entrypoint.sh"]
What works:
- The database appears in the web UI under
Properties > Parameters
:Password file - passfile - /pgadmin4/pgpass
- After manually entering
postgres
in the password prompt modal, the connection works perfectly.
Issue:
When I click on the server in pgAdmin, I get the following error:
connection failed: connection to server at "172.21.0.8", port 5432 failed: fe_sendauth: no password supplied
pgAdmin seems to ignore the credentials from /pgadmin4/pgpass
and prompts for a password.
What I’ve Tried:
- The file
/pgadmin4/pgpass
exists and looks correct:database:5432:prefect:postgres:postgres
- I confirmed that the path
/pgadmin4/pgpass
matches thePassFile
value in theservers.json
.
Question:
Does anyone know why pgAdmin might not be picking up the password file? Any hints or suggestions would be appreciated.