CircleCI Postgres Image suddenly causing problems? “role postgres not found”

Update: To conform with upstream, we’ve removed our default root role/user so that the postgres role/user is automatically created. See this . The TL;DR is if you were using root as your user, either create it via config or use postgres as the user.

Hey everyone,

Here’s what’s going on and what caused it.

The Problem

Most of the CircleCI Docker Convenience Images are small CI tweaks we apply to the upstream Docker Library images. So the circleci/postgres image is based on the postgres image.

4 days ago the upstream maintainers made a small tweak to the image so that the postgres role/user is only created when the POSTGRES_USER is not set. So of course, we set it to root . This has caused circleci/postgres images built within the last few days to no longer have the postgres role.

The Solution

There’s 3 quick solutions:

  1. There’s already a root PostgreSQL role/user in the image. You can change your DB creds to use that instead of postgres .
  2. Set the POSTGRES_USER environment variable in your CircleCI config to postgres and you’ll get the role back in the image as it was before. This would be done something like this:
      - image: circleci/postgres:9.6-alpine
        environment:
          POSTGRES_USER: postgres
  1. Use the upstream image directly (e.g. postgres:9.6 ). Keep in mind certain utilities that CircleCI features need might not be installed.

Useful information, nice one! (I suggest that updates go at the end though, in the correct chronological order; it is confusing to read updates for something that one has not read yet).

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