-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Recent versions seems to have broken auth when POSTGRES_PASSWORD is set #308
New issue
Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “No 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? No Sign in to your account
Comments
Could be related to #203 (comment). |
@dpnova which version of pg-promise are you using? One of 5.x? Try 6.x, and if the problem is still there, it means the issue isn't with the driver, but elsewhere. |
In this case it is very unlikely that swapping the driver will make any difference. But you can still try. |
The Postgres image itself works fine: $ docker pull postgres:9.6
...
Digest: sha256:e92fe21f695d27be7050284229a1c8c63ac10d88cba58d779c243566e125aa34
$ docker run -d -e POSTGRES_PASSWORD=12345 --name=posty postgres:9.6
$ docker logs --tail=6 posty
PostgreSQL init process complete; ready for start up.
LOG: database system was shut down at 2017-07-07 20:32:23 UTC
LOG: MultiXact member wraparound protections are now enabled
LOG: autovacuum launcher started
LOG: database system is ready to accept connections
$ docker run -it --rm --link posty:postgres postgres:9.6 psql -h postgres -U postgres
Password for user postgres:
psql (9.6.3)
Type "help" for help.
postgres=# Can you connect to your postgres container via |
It works fine without POSTGRES_PASSWORD set in docker compose env. For some
reason that's when it breaks. I'll try repro with regular docker.
…On Sat, 8 Jul. 2017, 6:47 am yosifkit, ***@***.***> wrote:
The Postgres image itself works fine:
$ docker pull postgres:9.6...Digest: sha256:e92fe21f695d27be7050284229a1c8c63ac10d88cba58d779c243566e125aa34
$ docker run -d -e POSTGRES_PASSWORD=12345 --name=posty postgres:9.6
$ docker logs --tail=6 postyPostgreSQL init process complete; ready for start up.
LOG: database system was shut down at 2017-07-07 20:32:23 UTCLOG: MultiXact member wraparound protections are now enabledLOG: autovacuum launcher startedLOG: database system is ready to accept connections
$ docker run -it --rm --link posty:postgres postgres:9.6 psql -h postgres -U postgresPassword for user postgres: psql (9.6.3)Type "help" for help.
postgres=#
Can you connect to your postgres container via psql?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#308 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOCN5PDWuH-ibb3n-WnZwPpE_8UAIqOks5sLplagaJpZM4OPOEw>
.
|
I've only seen this in docker. Sorry travelling overseas atm
pon, 24. jul 2017. 10.05 PM Emanuele Gaifas <notifications@github.com> је
написао/ла:
… FYI, I distilled this <https://github.com/lelit/asyncpg-issue158>
minimalistic recipe that exhibits the problem, but still using docker
compose. @dpnova <https://github.com/dpnova>, were you able to determine
if the same happens with plain docker or not?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#308 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOCN8U-DWSv22uZU1KxvI7f-XuNc49Oks5sRPkZgaJpZM4OPOEw>
.
|
Sorry I mean in docker compose.
uto, 25. jul 2017. 08.45 AM David P. Novakovic <dpn@dpn.name> је написао/ла:
… I've only seen this in docker. Sorry travelling overseas atm
pon, 24. jul 2017. 10.05 PM Emanuele Gaifas ***@***.***> је
написао/ла:
> FYI, I distilled this <https://github.com/lelit/asyncpg-issue158>
> minimalistic recipe that exhibits the problem, but still using docker
> compose. @dpnova <https://github.com/dpnova>, were you able to determine
> if the same happens with plain docker or not?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#308 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAOCN8U-DWSv22uZU1KxvI7f-XuNc49Oks5sRPkZgaJpZM4OPOEw>
> .
>
|
I added an alternative recipe using plain docker and got the same problem. |
The problem is still there in PG10b3: asyncpg folks could not replicate the problem with a local build of PostgreSQL. |
As noted over at MagicStack/asyncpg#158 the problem appeared around the same time the changes were made to the image build. I reckon d8abce4 looks suspect |
FYI, current asyncpg master does not manifest the problem anymore. |
Hi @lelit I tried to follow this discussion here but not sure how I can fix this. I still immediately get this error when I set "POSTGRES_PASSWORD" using v10.1.
|
Sorry @soosap, I'm afraid I can be of little help here, because I shifted focus on other things and the transition to pg10 did not actually happen. As said, an asyncpg upgrade did fix my test suites. Anyway, maybe you can adapt my https://github.com/lelit/asyncpg-issue158 to your use case? |
Hi thanks for getting back on this. I found a workaround - when I use POSTGRES_PASSWORD_FILE and mount the password as a file to /run/secrets (effectively making use of Docker Secrets) then I don't get this error. |
I was facing the same issue when deploying the PostgreSQL image on Kubernetes. The problem was really subtle, but was caused by a trailing newline character on my password environment variable. That's why when creating base64 secrets using the command line, one should always use
What makes this hard to spot, is that there's no visible difference when inspecting the container's environment variables. Here's an example using the password
And without it:
The fact that the PostgreSQL server in this image allows local connections without a password makes the debug of this issue even more confusing:
That's why testing the connection using |
Since the original issue here appears solved, I'm going to close. 👍 |
I've tried 9.6 and 9.5 and alpine variants too.
Getting rid of the POSTGRES_PASSWORD fixes it so I'm generally ok, but this could trip other people up too... looks like it might be the issue at: MagicStack/asyncpg#158
compose:
The text was updated successfully, but these errors were encountered: