# Postgres just stopped working

**URL:** <https://discuss.circleci.com/t/postgres-just-stopped-working/34511>\
**Category:** Databases\
**Created:** [February 16, 2020, 4:52am UTC](https://discuss.circleci.com/t/postgres-just-stopped-working/34511 "2020-02-16T04:52:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![brettpthomas](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/brettpthomas/32/22858_2.png) [@brettpthomas](https://discuss.circleci.com/u/brettpthomas)\
**Post date:** [February 16, 2020, 4:52am UTC](https://discuss.circleci.com/t/postgres-just-stopped-working/34511/1 "2020-02-16T04:52:40Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ohbarye](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/ohbarye/32/24206_2.png) [@ohbarye](https://discuss.circleci.com/u/ohbarye)\
**Post date:** [February 16, 2020, 4:13pm UTC](https://discuss.circleci.com/t/postgres-just-stopped-working/34511/2 "2020-02-16T16:13:49Z")

</div>

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](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](https://github.com/docker-library/postgres/issues/681)

---

<div class="post-metadata">

**Author:** ![ilayaraja](https://avatars.discourse-cdn.com/v4/letter/i/6a8cbe/32.png) [@ilayaraja](https://discuss.circleci.com/u/ilayaraja)\
**Post date:** [February 16, 2020, 4:57pm UTC](https://discuss.circleci.com/t/postgres-just-stopped-working/34511/3 "2020-02-16T16:57:22Z")

</div>

Having the same issue.

---

<div class="post-metadata">

**Author:** ![PetterS](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/petters/32/19679_2.png) [@PetterS](https://discuss.circleci.com/u/PetterS)\
**Post date:** [February 16, 2020, 7:22pm UTC](https://discuss.circleci.com/t/postgres-just-stopped-working/34511/4 "2020-02-16T19:22:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ilayaraja](https://avatars.discourse-cdn.com/v4/letter/i/6a8cbe/32.png) [@ilayaraja](https://discuss.circleci.com/u/ilayaraja)\
**Post date:** [February 17, 2020, 3:35am UTC](https://discuss.circleci.com/t/postgres-just-stopped-working/34511/5 "2020-02-17T03:35:49Z")

</div>

Looks like there is breaking change in Postgres docker image. [https://github.com/docker-library/postgres/issues/681](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

---

<div class="post-metadata">

**Author:** ![Pawan](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/pawan/32/24016_2.png) [@Pawan](https://discuss.circleci.com/u/Pawan)\
**Post date:** [February 17, 2020, 3:14pm UTC](https://discuss.circleci.com/t/postgres-just-stopped-working/34511/6 "2020-02-17T15:14:47Z")

</div>

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](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](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](https://support.circleci.com/hc/en-us/articles/115015742147-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](https://github.com/docker-library/postgres/issues/681)

Regards,  
Pawan Bahuguna

---

<div class="post-metadata">

**Author:** ![FelicianoTech](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/felicianotech/32/21348_2.png) [@FelicianoTech](https://discuss.circleci.com/u/FelicianoTech)\
**Post date:** [February 18, 2020, 4:50pm UTC](https://discuss.circleci.com/t/postgres-just-stopped-working/34511/7 "2020-02-18T16:50:28Z")

</div>

Posted more on this [here](https://discuss.circleci.com/t/postgresql-image-password-not-specified-issue/34555).

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [February 28, 2020, 4:50pm UTC](https://discuss.circleci.com/t/postgres-just-stopped-working/34511/8 "2020-02-28T16:50:30Z")

</div>

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