Postgres just stopped working

Credit card failed, and soon after our django/postgres setup just stopped working:

Error: Database is uninitialized and superuser password is not specified.
   You must specify POSTGRES_PASSWORD for the superuser. Use
   "-e POSTGRES_PASSWORD=password" to set it in "docker run".

   You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
   without a password. This is *not* recommended. See PostgreSQL
   documentation about "trust":
   https://www.postgresql.org/docs/current/auth-trust.html
 Exited with code 1

However, it looks like our account still has credits on the free tier. Is there a way to confirm this isn’t an account issue before I go debug?

I can assure you that the error is not related to your account issue because the error attributes to the official PostgreSQL docker image’s update.

The error message comes from https://github.com/docker-library/postgres/blob/05ac2d3ba69fc62c7acf6f689d3a93e5e862f738/docker-entrypoint.sh#L112-L119 .

To resolve it, you need to set POSTGRES_PASSWORD as the message says.

For further details, see https://github.com/docker-library/postgres/issues/681

Having the same issue.

Just change the PostgreSQL image to a more specific version, not the latest. E.g. changing from 9.5 to 9.5.18 fixed the problem for us.

Probably a mistake when building the latest images.

So no, it’s neither an account issue nor a problem on your end.

1 Like

Looks like there is breaking change in Postgres docker image. https://github.com/docker-library/postgres/issues/681

The fix is to either set a password with POSTGRES_PASSWORD=<password> or allow no password explicitly with POSTGRES_HOST_AUTH_METHOD=trust. Can set these environment variables in CircleCI

1 Like

Hi,

This appears to have been caused by a breaking change in the official Postgres docker image: https://github.com/docker-library/postgres/issues/681#issuecomment-586517154

If you wish to use the latest versions of the Postgres docker image (or CircleCI convenience image), there is a workaround shared on the issue thread here: https://github.com/docker-library/postgres/issues/681#issuecomment-586811176

Alternatively, you can pin the Docker image to an earlier version. To do this, find the last successful job follow the steps in this support article: Pinning a Docker image to a specific version

For further discussion about this issue, I would suggest reaching out to the Postgres image maintainers on this GitHub issues thread: https://github.com/docker-library/postgres/issues/681

Regards,
Pawan Bahuguna

1 Like

Posted more on this here.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.