A breaking change was recently made to the Postgres 9.x images available on Docker Hub. You can find the relevant PR at https://github.com/docker-library/postgres/pull/658

The change is intended to make Postgres more secure by default and was determined by the Postgres maintainers to be a necessary break.

You may encounter the following error during project creation.

Waiting for local database serverCouldn't connect to database container. Database server may not be started.

Alternatively, you may see the following in log output.

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

We recommend reading the Postgres authentication documentation to fully understand authentication settings.

You can use the POSTGRES_HOST_AUTH_METHOD environment property by making the following change to your docker-compose.yml.

Before:

 db:
    image: postgres:9.6-alpine
    environment:
      POSTGRES_DB: "db"


After:

db:
    image: postgres:9.6-alpine
    environment:
      POSTGRES_DB: "db"
      POSTGRES_HOST_AUTH_METHOD: "trust"

Once you have made this change, you can proceed to update your Divio project in the usual way.

docker-compose stop 
docker-compose up -d db
divio project update


Note that Divio have already implemented this change so new projects will already have this environment variable set.

Did this answer your question?