fix(ci): let the preview webapp start its nginx workers - #1567
Merged
Conversation
cap_drop: ALL left nginx unable to chown its cache directories, so the webapp crash-looped as soon as it was first reached — it only starts once the application server is healthy, which no earlier preview had managed. CHOWN alone is not enough and fails deceptively: the master survives while every worker exits "fatal code 2 and cannot be respawned", leaving a container that looks up and serves nothing. Verified against the published image that CHOWN, SETGID and SETUID together keep the workers running, and that dropping any of them does not. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017VKWqbmrPJFv8aKZBp36uD
Contributor
|
Warning Review limit reachedNext included review available in 17 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
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. Comment |
Contributor
📚 Documentation Preview
|
Contributor
🧩 Storybook PreviewReview this pull request's components and interaction states: Preview for commit 0292380. Updates automatically on new commits. |
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.
Description
The first preview to get this far crash-looped in its SPA container:
cap_drop: ALLleaves nginx's master unable to prepare its cache directories. This is a latent bug from the original hardening rather than a regression: the webappdepends_onthe application server being healthy, and until #1566 no preview ever reached that point, so the container had never actually started.CHOWNalone is not enough, and it fails in the worst way — the master survives and reportsstart worker processes, then every worker exits:leaving a container Docker still calls
runningwhile it serves nothing. nginx runs its workers as thenginxuser, so it needsSETGIDandSETUIDtoo. That is the same shape as the PostgreSQL entry already in the allowlist, and the allowlist comment now says what the two have in common instead of listing one of them.How to test
Measured against the published image on the staging host, not reasoned about — two containers side by side, 20 seconds each:
cap_drop: ALLchown(...) failed (1: Operation not permitted)+ CHOWNfatal code 2 and cannot be respawned+ CHOWN, SETGID, SETUIDstart worker process 45, 46, 47— stays upbun run formatandbun run checkare green;check-preview-stack.tsstill fails on any capability not in the allowlist.This pull request cannot preview itself — the controller refuses any head that edits
docker/preview/**— so #1538 redeploying after merge is the end-to-end test. Everything ahead of the SPA already works there: the seed loader clones and silences staging's data, and the application server is healthy against it and against staging's broker.Checklist