Skip to content

Fix pg_isready for migration_job#159

Open
gawsoftpl wants to merge 3 commits into
chatwoot:mainfrom
gawsoftpl:main
Open

Fix pg_isready for migration_job#159
gawsoftpl wants to merge 3 commits into
chatwoot:mainfrom
gawsoftpl:main

Conversation

@gawsoftpl

Copy link
Copy Markdown

Description
After setting up chatwoot today, my instance was not able to start. I am using the built-in bitnami postgrsql db.
As it turned out, the db initialization (migration job) was stuck, because the pg_isready command in the init container didn't succeed. It just printed out no attempt, which suggests an invalid configuration (see https://www.postgresql.org/docs/current/app-pg-isready.html).

Solution
After adding the -U postgres parameter manually, the command exited with 0 and the migrations where able to run

Same issue in another pull request #156

@knorr3

knorr3 commented Apr 27, 2025

Copy link
Copy Markdown

Hello @gawsoftpl,
why are you "stealing" my pull request? You just copied my entire description and code changes.

@gawsoftpl

Copy link
Copy Markdown
Author

I double this pr because nobody answer for your issue, I dont know that this project is alive? Did you write to owner of this project?

@gisostallenberg

Copy link
Copy Markdown

It should even have

export PGPASSWORD={{ .Values.postgresql.auth.postgresPassword }}

added.

As in

--- chart-backups/chatwoot/templates/migrations-job.yaml	2025-12-17 17:02:57.014540000 +0100
+++ chart-backups/chatwoot/templates/migrations-job.yaml	2025-12-17 17:03:30.803927399 +0100
@@ -36,7 +36,8 @@
         args:
           - -c
           - >-
-            PG_READY="pg_isready -h {{ template "chatwoot.postgresql.host" . }} -p {{ template "chatwoot.postgresql.port" . }}";
+            export PGPASSWORD={{ .Values.postgresql.auth.postgresPassword }}
+            PG_READY="pg_isready -h {{ template "chatwoot.postgresql.host" . }} -p {{ template "chatwoot.postgresql.port" . }} -U {{ .Values.postgresql.auth.username }}";
             until $PG_READY;
             do
               sleep 2;

@sojan-official sojan-official added the community PRs from the community label Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants