Skip to content

fix(docker): add database name to postgres healthcheck#116

Merged
FSM1 merged 1 commit into
mainfrom
fix/postgres-healthcheck-db
Feb 12, 2026
Merged

fix(docker): add database name to postgres healthcheck#116
FSM1 merged 1 commit into
mainfrom
fix/postgres-healthcheck-db

Conversation

@FSM1

@FSM1 FSM1 commented Feb 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds -d ${DB_DATABASE:-cipherbox_staging} to the postgres healthcheck pg_isready command in the staging compose file
  • Without -d, pg_isready defaults to connecting to a database matching the username (cipherbox), which doesn't exist on staging — the actual database is cipherbox_staging
  • This caused FATAL: database "cipherbox" does not exist log spam every 5 seconds

Test plan

  • Fix applied directly on the staging VPS — postgres container is healthy and FATAL errors have stopped
  • Verified in Grafana Cloud Loki that critical log spam is no longer being produced

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Enhanced database healthcheck configuration in the staging environment to more accurately verify database availability.

pg_isready without -d defaults to connecting to a database matching
the username ("cipherbox"), which doesn't exist on staging where the
database is "cipherbox_staging". This caused FATAL log spam every 5s.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Feb 12, 2026

Copy link
Copy Markdown

Walkthrough

Modified the postgres healthcheck configuration in the staging docker-compose file to use a multiline array format and explicitly specify the target database using the -d argument to pg_isready.

Changes

Cohort / File(s) Summary
Docker Compose Configuration
docker/docker-compose.staging.yml
Expanded postgres healthcheck test from single command string to multiline array, adding -d ${DB_DATABASE:-cipherbox_staging} parameter to explicitly target the staging database in the readiness probe.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly describes the main change: adding a database name to the postgres healthcheck. It accurately reflects the core fix in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/postgres-healthcheck-db

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@FSM1 FSM1 enabled auto-merge (squash) February 12, 2026 23:08
@FSM1 FSM1 merged commit 3f58d46 into main Feb 12, 2026
8 checks passed
@FSM1 FSM1 deleted the fix/postgres-healthcheck-db branch February 12, 2026 23:09
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.

1 participant