juspay / hyperswitch

An open source payments switch written in Rust to make payments fast, reliable and affordable
https://hyperswitch.io/
Apache License 2.0
12.58k stars 1.35k forks source link

[BUG] FATAL: role "root" does not exist #6577

Open Shark-Firewall opened 15 hours ago

Shark-Firewall commented 15 hours ago

Bug Description

Whenever hyperswitch-pg-1 sever running in docker-compose, it though an error " role "root" does not exist"

Expected Behavior

Error should not come.

Actual Behavior

Screenshot from 2024-11-14 19-27-00

Steps To Reproduce

Provide an unambiguous set of steps to reproduce this bug. Include code or configuration to reproduce, if relevant.

  1. Open Docker Desktop
  2. Run hyperswitch-pg-1 server
  3. After some time, you will see the error

Context For The Bug

While setting hyperswitch on my local machine, I came across this error.

Environment

Are you using hyperswitch hosted version? Yes/No If yes, please provide the value of the x-request-id response header to help us debug your issue.

If not (or if building/running locally), please provide the following details:

  1. Operating System or Linux distribution: Ubuntu 24.04
  2. Rust version (output of rustc --version): ``: rustc 1.82.0 (f6e511eec 2024-10-15)
  3. App version (output of cargo r --features vergen -- --version): `` NA

Have you spent some time checking if this bug has been raised before?

Have you read the Contributing Guidelines?

Are you willing to submit a PR?

Yes, I am willing to submit a PR!

SanchithHegde commented 10 hours ago

I think this is arising from the healthcheck command we've defined for the Postgres container. Although this should not affect the Docker Compose setup itself: everything should work as expected even if this message is being logged.

@Shark-Firewall Could you try updating this line to the below line and try?

      test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
Shark-Firewall commented 10 hours ago

@SanchithHegde After updating what you recommended, the above error is not coming in the logs

SanchithHegde commented 9 hours ago

@Shark-Firewall Cool, feel free to open a PR for the same. If you're opening the PR, please ensure you make the same change in the docker-compose-development.yml file as well.