Skip to content

'Role "root" does not exist' when using docker-compose #838

Closed
@BeyondEvil

Description

@BeyondEvil

If you're encountering these in the logs:

postgres           | 2021-04-26 20:09:42.263 UTC [102] FATAL:  password authentication failed for user "root"
postgres           | 2021-04-26 20:09:42.263 UTC [102] DETAIL:  Role "root" does not exist.

And you have a healthcheck specified on the postgres service in the docker-compose.yml file, like so:

healthcheck:
      test: ["CMD", "sh", "-c", "pg_isready" -h $$(hostname -i)"]
      interval: 10s
      timeout: 15s
      retries: 3

You might have success changing it to:

healthcheck:
      test: ["CMD", "sh", "-c", "pg_isready -U $$POSTGRES_USER -h $$(hostname -i)"]
      interval: 10s
      timeout: 15s
      retries: 3

If not, maybe the solution can be found in #41

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions