Repository navigation
fix(image): name the role and database in the health check - #3
Conversation
pg_isready defaulted to the OS user, so every probe connected as root to
a database named root. It still reported healthy, but the server logged
`FATAL: role "root" does not exist` every 10 s.
The HEALTHCHECK now passes -U "${POSTGRES_USER:-postgres}" -d postgres in
shell form, so the variable expands inside the container. test/smoke.sh
runs the same line and fails if the server logged a missing role or
database.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
🤖 Claude Code · Migrate DB image and fix configurable health checkMigrated the remote database deployment to the rawback-app/db 1.0.0 image with 256 MB shared memory, then updated the image repository so its health check uses the configured PostgreSQL user.
10.2M tokens: 130 input · 56.3K output · 10M cache read · 170.7K cache write 📝 AI summaryInspected the deployment over In a scratch clone of View this session on ShellTime → Updated 2026-10-25 12:18 UTC by ShellTime · totals for the whole session so far · the session page is visible to its owner |
Summary
The image's
HEALTHCHECKranpg_isready -q -h 127.0.0.1with no user. pg_isready then connects as the OS user (root) to a database namedroot. It still exits 0, so the container shows healthy, but the server logsFATAL: role "root" does not existon every probe: 8,640 lines a day at the 10 s interval. We saw this right after moving thertastaging Postgres ontoghcr.io/rawback-app/db:1.0.0.pg_isready -q -h 127.0.0.1 -U "${POSTGRES_USER:-postgres}" -d postgres, in shell form soPOSTGRES_USERexpands inside the container. Thepostgresdatabase always exists after initdb, whateverPOSTGRES_USERandPOSTGRES_DBare. It still probes over TCP, so first start behaves as before.FATAL: role/database … does not exist. Without that check, the old command would have passed the smoke test, since pg_isready exits 0 either way.Component versions: unchanged (PostgreSQL 18.6, PostGIS 3.6.4, PGroonga 4.0.9). As a
fix, this cuts a patch release. Consumers only need to pull the new tag and recreate the container. The data directory and extensions are untouched, soupdate-extensions.shisn't needed for this one.Testing
On a throwaway
ghcr.io/rawback-app/db:1.0.0container, with--health-cmdset to the new line (Docker stores it asCMD-SHELL, the same as the shell-formHEALTHCHECK):POSTGRES_USERin the probe made the server log a FATAL for that role, so the variable expands in the container.pg_isready -q -h 127.0.0.1loggedFATAL: role "root" does not exist, and the smoke test's new grep matches that line.bash -n test/smoke.shpasses. shellcheck isn't installed locally; SC2016 is disabled on the one intentionally single-quoted line.The image build plus
test/smoke.shruns in this PR'sBuildworkflow.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.