Skip to content

🐛(backend) fix postgres healthcheck #748

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

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

cameroncking
Copy link
Contributor

@cameroncking cameroncking commented Mar 17, 2025

Purpose

Today, the docker healthcheck does not include the postgreql user or database name. This causes errors such as the following:

kc_postgresql-1  | 2025-03-17 03:16:17.323 UTC [13424] FATAL:  role "root" does not exist

Proposal

Update the pg_isready command to specify the username and password such as pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}.

See also:

Test

After applying this fix, the error message mentioned above no longer appears in docker compose logs -f.

$ make test
...
1124 passed, 9579 warnings in 18.60s

@cameroncking cameroncking changed the title Add PG DB/User to healthcheck 🐛(backend) fix postgres healthcheck Mar 17, 2025
@lunika
Copy link
Member

lunika commented Mar 17, 2025

Hi @cameroncking ,

Thank you very much for your contribution, we appreciate it. And it was something we planned to fix so your contribution is more than welcome.

I let you squash your commit and rename it following our convention https://suitenumerique.gitbook.io/handbook/git#type-scope-and-subject

@cameroncking cameroncking force-pushed the main branch 2 times, most recently from 62bccfc to ff0df0c Compare March 17, 2025 18:32
@cameroncking
Copy link
Contributor Author

I believe I have updated the commit message correctly. Thank you for the quick review!

@lunika
Copy link
Member

lunika commented Mar 17, 2025

Almost done, The last line in your commit body is too long:

4: B1 Line exceeds max length (81>80): "This resolves an error that appears in the logs, where 'root' is used by default."

Going to a new line after the word by will fix the problem.

@cameroncking cameroncking force-pushed the main branch 2 times, most recently from 50da03c to 05294fe Compare March 18, 2025 00:21
Adds PostgreSQL user and database names to the docker-compose.yaml healthchecks.
This resolves an error that appears in the logs, where 'root' is used by
default.
@lunika lunika enabled auto-merge (rebase) March 18, 2025 08:32
@lunika lunika merged commit bcdaedb into suitenumerique:main Mar 18, 2025
16 of 18 checks passed
@AntoLC AntoLC mentioned this pull request Mar 19, 2025
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

Successfully merging this pull request may close these issues.

2 participants