Skip to content

Match pg_dump to the server major, or the nightly backup fails - #15

Merged
Sbussiso merged 1 commit into
masterfrom
fix/pgdump-version-match
Sep 14, 2026
Merged

Sbussiso merged 1 commit into
masterfrom
fix/pgdump-version-match

Conversation

@Sbussiso

Copy link
Copy Markdown
Contributor

The Rust port replaced the image's PGDG-sourced postgresql-client-18 with
Debian bookworm's default postgresql-client, which is 15. The cluster is
18, and pg_dump refuses to dump a newer server:

[backup_db] pg_dump 15.19 -> server 18.6
pg_dump: error: aborting because of server version mismatch
pg_dump: detail: server version: 18.6; pg_dump version: 15.19

The deploy was green and the backup would have failed at 09:47 UTC — the same
shape as the scale-to-zero break this repo already had once, where
flyctl ssh console couldn't wake a stopped machine.

What went wrong in the port

The Python Dockerfile had solved this deliberately — add the PGDG apt repo,
install postgresql-client-18, purge gnupg afterwards. My port carried over
the importance of having pg_dump (the comment even said "NOT optional here")
and dropped the solution. Restored verbatim.

How it was caught

By running the actual backup on the deployed machine, exactly as backup.yml
does — not by checking that pg_dump existed. It existed, was on PATH, and
was useless:

$ flyctl ssh console -a sentinel-license -C "sh -c 'command -v pg_dump'"
/usr/bin/pg_dump          ← looks fine

Rebuilt image now reports pg_dump (PostgreSQL) 18.6.

🤖 Generated with Claude Code

The Rust port replaced the image's PGDG-sourced postgresql-client-18 with
Debian's default postgresql-client, which is 15. The cluster is 18, and
pg_dump refuses to dump a newer server outright:

  pg_dump: error: aborting because of server version mismatch
  detail: server version: 18.6; pg_dump version: 15.19

So the deploy went green and the backup would have failed at 09:47 UTC —
the same shape as the scale-to-zero break this repo already had once,
where `flyctl ssh console` could not wake a stopped machine.

The Python Dockerfile had solved this deliberately: add the PGDG apt
repo, install postgresql-client-18, purge gnupg afterwards. The port
carried over the *importance* of having pg_dump and dropped the
*solution*. Restored verbatim.

Caught by running the real thing rather than trusting `command -v
pg_dump` — the binary was present and on PATH, and still useless.
Verified in the rebuilt image: pg_dump (PostgreSQL) 18.6.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Sbussiso
Sbussiso merged commit 91b5282 into master Sep 14, 2026
5 checks passed
@Sbussiso
Sbussiso deleted the fix/pgdump-version-match branch September 14, 2026 09:35
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