-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POSTGRES_PASS
no longer appears to be read with version sha256:b700342c925bc42e33fd39d5907a9f7e179906b1d13e26b7084987c18f020b85
#496
Comments
@favna If you login to the database can you not execute the shell with the given password?. Showing the password in the logs was disabled for security reasons. Maybe in future, we could have something like |
I cannot login with my own provided credentials either. I have not yet tried to login with the password from the logs, I'll try that tomorrow (this is for work and it's past work hours for me now) |
@favna i did try step 2 and inside the container I can log into the database. The replication password should in fact only show if replication is being setup. |
I have managed to reproduce the issue in a smaller repro.
services:
postgres:
cap_add:
- SYS_RESOURCE
container_name: postgres
image: kartoza/postgis:latest
deploy:
resources:
limits:
memory: 2G
ports:
- "5432:5432"
restart: unless-stopped
tty: true
environment:
- POSTGRES_USER=developmentdb
- POSTGRES_PASS=developmentdb
- POSTGRES_DBNAME=developmentdb
services:
postgres:
cap_add:
- SYS_RESOURCE
container_name: postgres
image: kartoza/postgis:latest
deploy:
resources:
limits:
memory: 2G
ports:
- "5432:5432"
restart: unless-stopped
- tty: true
environment:
- POSTGRES_USER=developmentdb
- POSTGRES_PASS=developmentdb
- POSTGRES_DBNAME=developmentdb
So it appears the issue is somehow related to docker run --detach \
--cap-add=SYS_RESOURCE \
--interactive \
--tty \
--name=postgres \
--memory=2g \
--publish 5432:5432 \
--restart unless-stopped \
--env POSTGRES_USER=developmentdb \
--env POSTGRES_PASS=developmentdb \
--env POSTGRES_DBNAME=developmentdb \
kartoza/postgis:latest Which does work. This is quite strange, because |
What is the bug or the crash?
Today I pruned all my docker images to start fresh as I was debugging an unrelated issue and I noticed that after pulling a fresh copy of
kartoza/postgis:latest
that I was no longer able to connect to the database. After getting the SHA256 of the image from one of my colleagues, starting that and then comparing the logging between the 2 I noticed that the default password that we set throughPOSTGRES_PASS
in our Docker compose file is no longer being used bykartoza/postgis
.Specifically, for
sha256:b700342c925bc42e33fd39d5907a9f7e179906b1d13e26b7084987c18f020b85
the logs begin with:Whereas for
sha256:1360f5d3dcb2de05e8f6ced767e26a5f29344876a9ef119f1a3a69c9583eceda
they begin with:Note the difference in the line
[Entrypoint] GENERATED Replication PASSWORD:
Steps to reproduce the issue
kartoza/postgis:latest
, or more specifically,kartoza/postgis:latest@sha256:b700342c925bc42e33fd39d5907a9f7e179906b1d13e26b7084987c18f020b85
docker run -d --name postgres -e POSTGRES_USER=developmentdb -e POSTGRES_PASS=developmentdb -e POSTGRES_DBNAME=developmentdb kartoza/postgis:latest
docker logs -f -t postgres
Versions
kartoza/postgis
->sha256:b700342c925bc42e33fd39d5907a9f7e179906b1d13e26b7084987c18f020b85
Additional context
I replicated this issue on an M4 Pro equipped Macbook (arm64) and on an Inteli7-11850H equipped Kubuntu 22.04 Linux laptop (amd64)
The text was updated successfully, but these errors were encountered: