fix(docker): make the git-checkout volume writable by the runtime user - #1468
Conversation
|
Warning Review limit reached
Next review available in: 10 minutes Limit 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. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
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 |
A named volume is created root-owned, and one created by an earlier image keeps that image's uid. Staging's app_git-repos is owned by 100:101 at mode 0755 while the buildpack image runs as 1002:1001, so the agent could not create its content-addressed store: Failed to lock CAS blob 0a603c06... Caused by: java.nio.file.AccessDeniedException: /data/git-repos/cas Nothing writes there until an agent job runs, so this surfaced on the first practice review rather than at startup — the deployment looked healthy and reviews failed. The preview stack already carries a volume-init for exactly this; the production stack did not. Only entries with the wrong owner are touched, so an already-correct volume costs a metadata walk. chown -h retargets symlinks instead of following them: the tree contains dangling links, and following those turns the fix into a wall of errors that exits non-zero. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZADQeSx6zQNNqsdu7AAqZ
A new named volume is created root-owned, and one created by an earlier image keeps that image's uid. Staging's is 100:101 at 0755 while the buildpack image runs as 1002:1001, so the agent could not create its content-addressed store: Failed to lock CAS blob 0a603c06... Caused by: java.nio.file.AccessDeniedException: /data/git-repos/cas Nothing writes there until an agent job runs, so the deployment reported healthy and the first practice review failed. chown -Rh, not a find predicate: -h retargets the dangling symlinks the tree contains instead of following them out of the volume, and the predicate it replaces skipped the group entirely, so it did not do what it claimed. The preview stack gets the same text and the same command — it had drifted to chown -R, which has the symlink hole. volume-init is a dependency of both application roles, so it runs on every start: network_mode none because it needs no networking, a logging cap because every sibling has one, and a digest-pinned base because an unpinned tag in that position can block the stack from starting. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZADQeSx6zQNNqsdu7AAqZ
35e3313 to
96ceb24
Compare
📚 Documentation Preview
|
Description
The first practice review ever executed on staging failed like this:
A named volume is created root-owned, and one created by an earlier image keeps that image's uid. Staging's
app_git-reposis owned by 100:101 at mode0755while the buildpack image runs as 1002:1001, so the agent cannot create its content-addressed store under the volume.Nothing writes there until an agent job runs, which is why this never showed up before: the deployment reports healthy, the health indicator is green, and the failure appears only when someone finally enables reviews. The preview stack already carries a
volume-initfor exactly this reason — the production stack does not.What changes
A one-shot
volume-initthat both application roles wait on, matching the preview stack:Two deliberate details:
! -user 1002— only entries with the wrong owner are touched, so an already-correct volume costs one metadata walk rather than a recursive rewrite of every deploy. Staging's tree is 6 GB across 216 repositories.chown -h— the tree contains dangling symlinks (vendored framework directories withVersions/Currentpointing at nothing). Without-h,chownfollows them, fails withNo such file or directory, and exits non-zero, which would make the init container fail the deploy. Verified on the live volume: it errored without-h, and reported zero remaining wrong-owner entries with it.How to test
On the affected volume:
The agent then creates
/data/git-repos/cas(drwxr-xr-x 1002 1001) on the next job, and theAccessDeniedExceptionis gone — confirmed on staging, where the following review reached evidence collection instead of failing at sandbox preparation.Checklist
.changeset/README.md**Operators:** …) andMIGRATION.mdis updatedNo new variable and no operator action — the init runs as part of the stack.
MIGRATION.mdis untouched.