Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgres_db FATAL: database "dbuser" does not exist #1566

Open
GitNees opened this issue Dec 19, 2024 · 6 comments
Open

postgres_db FATAL: database "dbuser" does not exist #1566

GitNees opened this issue Dec 19, 2024 · 6 comments

Comments

@GitNees
Copy link

GitNees commented Dec 19, 2024

Hi,

Just running the app with docker, but this error keeps popping up.
I googled, but cant find any info.

postgres_db | 2024-12-19 11:41:37.292 UTC [199] FATAL: database "dbuser" does not exist
postgres_db | 2024-12-19 11:41:52.409 UTC [207] FATAL: database "dbuser" does not exist
postgres_db | 2024-12-19 11:42:07.534 UTC [215] FATAL: database "dbuser" does not exist
postgres_db | 2024-12-19 11:42:22.655 UTC [223] FATAL: database "dbuser" does not exist

Anything that could case a problem?

@rkdover
Copy link

rkdover commented Dec 21, 2024

I have this issue as well, unsure of how to resolve it.

@rkdover
Copy link

rkdover commented Dec 21, 2024

You know, going back to the last human commit of that file, it still throws the same error. I wonder if there's some dbuser config you need to do manually that isn't mentioned?

@eikek
Copy link
Owner

eikek commented Jan 9, 2025

From what I know, the user is created by the postgres image startup script. Perhaps that changed at some version? You can always create the user manually, though.

@zupermann
Copy link

I encountered the same problem.
I believe that in my case the issue was that on the default docker network there was another Postgres container (of an entire different service) with the same name and Sharry connected to it instead of own Postgres container.

To rule this issue out you can test by stopping all other Postgres containers before starting Sharry.

If the same issue is confirmed you can just change the container name from docker-compose.yml

@michnovka
Copy link

I fixed this by updating the test case:

  db:
    image: postgres:17.1
    container_name: postgres_db
    volumes:
      - postgres_data:/var/lib/postgresql/data/
    environment:
      - POSTGRES_USER=dbuser
      - POSTGRES_PASSWORD=dbpass
      - POSTGRES_DB=dbname
      - PGUSER=dbuser
    healthcheck:
      test: pg_isready -d dbname
      interval: 15s
      timeout: 60s
      retries: 5
      start_period: 15s

@eikek can you please review and possibly fix this in main repo?

@eikek
Copy link
Owner

eikek commented Jan 22, 2025

@michnovka it looks good to me, thank you. You can open a PR with this change if you like (and it works for you) 🙏🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants