Repository navigation
Description
HealthLog version
1.48.4 (checked against 1.48.5 — unchanged)
Deployment type
Self-hosted (Docker) — the app image from GHCR, with its own Postgres rather than the
project's compose db.
What happened?
Two findings with one cause: the PostgreSQL client major in the image is also the highest
server major HealthLog can run against, and nothing says so.
1. A server on 19 takes the app down. The pre-migration dump runs the bundled pg_dump
18.6 against a 19.0 server, which aborts with a server version mismatch. docker-entrypoint.sh
then stops the boot — "not migrating without the dump", which is the right call — and the
container crashloops. The nightly dump and db-restore fail the same way, but those fail
quietly from an operator's seat: there have been no app-level dumps here since the server moved.
docs/ops/postgres-major-upgrade.md reads as if the major were the operator's choice for a
BYO install: "Installs that bring their own Postgres (Unraid, an existing database server) are
not touched: HealthLog runs on 16 and 18 alike, and the move there is yours to schedule." In
fact the image caps it at the bundled major, and the cap does not bite when the database moves
— it bites at the next release that carries a migration. Here that was three hours later, which
is what made the cause hard to find.
2. The bundled stack cannot follow to 19 the way the file plans. docker-compose.yml mounts
the volume one level up "so the next major can sit beside this one in the same volume". The
official image refuses exactly that: docker_error_old_databases() collects every
/var/lib/postgresql/*/docker that holds a PG_VERSION and exits 1 before the server starts
(docker-library/postgres#1259). So a db bumped to 19 never becomes healthy, and db-upgrade,
which waits on its healthcheck, never runs. pg_upgrade --link, which that layout is for, needs
both majors' binaries in one image: the alpine images carry one each, and bridging it with a
glibc image would re-collate the existing text indexes.
I hit both on nine clusters on 2026-11-20, when an automerged postgres:18 → 19 bump went out
across them, and moved each with a logical dump/restore. HealthLog was the one that stayed down,
because of (1).
Expected behavior
- A server major the bundled client cannot dump is either supported, or refused with a message
that names both versions and the way out — rather than surfacing aspg_dump's mismatch line
inside a boot abort three hours after the change that caused it. - The BYO freedom the docs describe and the ceiling the image sets agree with each other,
whichever way that is resolved. - The bundled stack has a path to the next major that the official image allows.
Steps to reproduce
For (1):
- Start a
postgres:19.0-alpineand pointDATABASE_URLat it (any BYO setup does). - Start an app release that carries a pending migration.
- The boot stops:
pg_dump: error: aborting because of server version mismatch, followed by
"HealthLog: ERROR — not migrating without the dump".node scripts/db-dump.mjs dailyfails
the same way on an already-migrated database.
For (2):
- On a stack whose
postgres-datavolume holds a populated Postgres 18, changedbto
postgres:19.0-alpine. docker compose up -d. The db container exits 1 with "there appears to be PostgreSQL data
in: /var/lib/postgresql/18/docker", anddb-upgradestays queued behind the healthcheck.
Screenshots / other logs
pg_dump: error: server version: 19.0 (Debian 19.0-1.pgdg13+1); pg_dump version: 18.6 (Debian 18.6-1.pgdg13+1)
pg_dump: error: aborting because of server version mismatch
HealthLog: ERROR — not migrating without the dump. Free disk space or fix the error above and start again.
HealthLog: to migrate without a dump this once, set DB_BACKUP_BEFORE_MIGRATE=false.
Pre-flight checks
- I confirmed this is not a duplicate of an existing issue.
- I redacted any secrets, tokens, or personal data from logs.
Offer
The client half of the fix is up as a pull request: it stands on its own, fixes (1) for
every install that brings its own database, and forces nothing on anybody, because a client
reads its own major and older. Close it without ceremony if you would rather have the whole
move in one change, or none of it yet.
The bundled half — (2) — I have deliberately not written, because its shape depends on
answers that are yours: without a second volume the 19 server cannot come up at all past
docker_error_old_databases, and I have no way to prove a volume move here. Say which way you
want it and I will send it.
What the whole change would be:
pgclienttopostgres:19.0-trixie, digest-pinned, and the 18 paths, theld.so.confentry,
PATHand both--versionbuild checks with it.dbtopostgres:19.0-alpine, plus an 18 → 19 move modelled on the 16 → 18 step that is
already there: a separate volume for 19, the 18 volume mounted read-only, the dump streamed in
one transaction, every table's row count compared,--analyze-in-stages, a marker on the old
volume, andappgated behind it. The separate volume is what gets past
docker_error_old_databaseswithoutpg_upgrade— the same shape the 16 → 18 step uses, and
it keeps the old volume as the way back.src/__tests__/runtime-package-pins.test.ts(the client/database agreement and theCOPY
path),src/__tests__/database-pin-is-watched.test.ts(it asserts exactly two postgres images
in the compose file), thepostgres:18-alpineservices ine2e.ymland
post-publish-verify.yml,scripts/compose-dr-drill.sh,
scripts/compose-db-upgrade-check.sh,docs/contributing/benchmarks.md, the docs
(postgres-major-upgrade.md,getting-started.md,truenas.md, CONTRIBUTING's
"PostgreSQL 16+"), and the compose comment that promises the same-volume layout.
Three things I would rather you decided than guessed at:
- Timing, and whether the two halves ship together. The 19.0 images were published on
2026-11-20. Bundling a major that new is a different risk appetite from the one the pin
comments describe. The halves are separable: the client bump alone fixes (1) for every BYO
install and forces nothing on anybody, because a client dumps its own major and older. Its
cost is that it putspg_restore19 against the bundled 18 server in the disaster-recovery
path, which is the direction the present rule deliberately avoids. If you would rather bundle
19 after 19.1 in February, the client half still stands on its own in the meantime. - The 16 → 18 hop. Keep both steps in the file (16 → 18 → 19), or declare that installs
from v1.45 and earlier update through a 1.46–1.48 release first and drop the 16 step, as its
comment already anticipates? - A guard, regardless of 19. Should the dump compare
server_version_numagainst
pg_dump --versionbefore it runs and say so plainly? That is what turns the next major from
a mismatch line in a crashloop into one sentence an operator can act on — and it is worth
having even if the version bump waits.
Activity
MBombeck commentedon Nov 22, 2026
Thank you for the careful report, and for #1432, which is merged. The client half ships with 1.49.0: the image carries the PostgreSQL 19 client tools, so an install that brings its own server on 19 dumps, migrates and boots again, and the upgrade guide now names the ceiling.
The second half, moving the bundled
dbto 19 with a path the official image accepts, is a larger change to the compose stack and its upgrade step. I'm leaving this issue open for that part.MBombeck commentedon Nov 23, 2026
@aw23edfr4 The client half is out now in 1.49.0: https://github.com/MBombeck/HealthLog/releases/tag/v1.49.0
The image carries the PostgreSQL 19 client tools, so a server on 19 gets its pre-migration dump and its nightly dumps again, and 16 and 18 work as before. Thanks again for tracking it down and for sending the fix with it. The second half, moving the bundled
dbto 19, is still open here.MBombeck commentedon Nov 26, 2026
@aw23edfr4 Sorry for leaving your three questions open. Here is where things stand on
mainand on the 1.50 branch today.1. Timing. The bundled
dbstays onpostgres:18.6-alpinein 1.50.0 (Saturday, 5 December). Only the client moved to 19, through your #1432, so the two halves are already separate. I don't have a date for the bundled move yet. I'm not keen on bundling a major before its first minor release, so 19.1 in February is the earliest I'd look at it.2. The 16 to 18 step. It is still in
docker-compose.ymlon both branches, unchanged, and nothing removes it for now. I lean towards keeping it in front of a 19 step rather than telling old installs which release they have to stop at, but that isn't decided.3. A version check before the dump. It doesn't exist yet. The dump records
server_version_numin its manifest, but nothing compares it withpg_dump --versionbefore the run, so the next major after 19 would fail exactly the way you saw it: a mismatch line inside a boot abort. That is a real gap and worth closing whether or not the bump waits. I can't name a release for it yet, and I'll update this issue when it's on a branch.MBombeck commentedon Nov 27, 2026
@aw23edfr4 The version check from your third question is on
mainnow (#1591), so gap 3 is closed there.Before the dump before migrating, the nightly dump and
db-restorerunpg_dumporpg_restore, they compare the server'sserver_version_numwith the client's major. A server newer than the client is refused before anything is written, with one line that names both: "This image's PostgreSQL client (pg_dump) is 19; your server is 20", followed by the way out.At boot the app still won't migrate without its dump. It says why once and then waits ten minutes before it exits, so
restart: unless-stoppedno longer cycles it every few seconds, anddocker stopends the wait straight away. A boot with nothing to migrate starts and logs the same line as a warning. A nightly dump that fails this way shows as failing on the backups page from the first night and goes to admins as a backup alert, instead of reading as "the last dump failed".docs/ops/postgres-major-upgrade.mdnow says it plainly: the highest server major HealthLog supports is the client major in the image, 19 today, and it shows how to check both.It is planned for the next patch release on Saturday, 28 November, and is in the
:edgeimage until then. The bundled move ofdbto 19 is still open here.fix(backup): check the client major against the server before dump an…
MBombeck commentedon Nov 28, 2026
@aw23edfr4 the version check is in 1.49.1, out today: https://github.com/MBombeck/HealthLog/releases/tag/v1.49.1
If your PostgreSQL server runs a newer major than the client tools in the image, the app now names both versions and the way out instead of failing on the dump. Thanks again for tracing this one so carefully. If you can try it against your setup, I'd be glad to know it reads clearly. Refs #1431