fix: mount the scaffolded database volume where PostgreSQL 18 stores data - #165
Merged
Conversation
…data The PostgreSQL 18 bump moved the image tag but not the volume mount. PostgreSQL 18+ images store data in a major-versioned subdirectory (/var/lib/postgresql/18/docker), so a mount at /var/lib/postgresql/data is ignored and the container refuses to start, restart-looping on "in 18+, these Docker images are configured to store database data in a format which is compatible with pg_ctlcluster". The generated compose now mounts pgdata:/var/lib/postgresql. The conformance harness did not catch this because its postgres service mounts no volume at all, so it used the new in-image default and passed. The gap was a generated artifact nothing stood up. Covered now by a unit test on the generated compose, and verified by scaffolding a project and bringing its database up: it reports PostgreSQL 18.4 with PGDATA inside the mount, and a row written before a --force-recreate survives it. Only projects scaffolded from the unreleased 18 change were affected.
This was referenced Aug 2, 2026
Contributor
Author
|
Filed #166 for the underlying gap this exposed: nothing in CI executes what |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a defect introduced by #164, caught while doing the same bump in
seamless-templates(fells-code/seamless-templates#42).The bug
#164 moved the image tag but not the volume mount. PostgreSQL 18+ images store data in a major-versioned subdirectory (
/var/lib/postgresql/18/docker), so a mount at/var/lib/postgresql/datais ignored and the container refuses to start:It restart-loops. A project scaffolded from that change had a database that never came up. See docker-library/postgres#1259.
Why CI missed it, and why that matters
The
verify / verifyjob passed on #164 and I reported it as end-to-end proof. It wasn't. The harness's postgres service mounts no volume at all, so it used the new in-image default and worked fine. The broken artifact was the generated compose file, which nothing in CI ever stands up.That is the real gap:
verifyexercises the running stack, not whatinitwrites to disk. This PR closes the specific hole with a unit test asserting the generated mount path, but the general shape — a generated artifact no test executes — is worth a follow-up.Verified
Scaffolded a project with the built CLI and brought its database up:
running (healthy),PostgreSQL 18.4 (Debian 18.4-1.pgdg13+1)PGDATA=/var/lib/postgresql/18/docker, resolving inside the mounted volumedocker compose up -d --force-recreate db, read it back: survives, so the volume is genuinely in use rather than data silently living in the container layerAlso reproduced the failure first with the old mount, so the test is against a real defect rather than a theory.
npm testpasses (816 passed, 4 skipped).Release impact
None shipped. 0.11.0 is on npm; the PostgreSQL 18 change is still sitting unreleased in the release PR (#163). This lands ahead of it, so no published version ever produced a broken scaffold.
Related
The same mount change is needed everywhere else postgres moves to 18. The five issues I filed for the org rollout all say "bump the tag" and none mention the mount; I'm updating them now.