Repository navigation
fix(ci): Cache records its roots without asking R2 to create the bucket - #8573
Conversation
Every Cache push run on main fails in `just infra nix roots`: rclone's S3 backend tries CreateBucket before its first upload, and the cache-write R2 token, scoped to objects, gets 403 AccessDenied. Set no_check_bucket on the `r2:` remote so rclone writes the object directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the single-file diff to infra/nix/justfile.
RCLONE_CONFIG_R2_NO_CHECK_BUCKET: exportstrueon ther2:remote sorclone rcatstops sendingCreateBucket. This matches the existing pattern ininfra/rpm/publish.sh. Bucket creation goes throughwrangler r2 bucket create, not rclone, so the flag doesn't affectcreate.
claude-sonnet-5-5 | 𝕏
|
No actionable comments were generated in the recent review. WalkthroughThe R2 rclone configuration sets Merge Risk:
|

Problem
Every Cache push run on
mainfails, in all four jobs (for example 43271095618), atjust infra nix roots:rclone's S3 backend sends CreateBucket before its first upload into a bucket unless
no_check_bucketis set. Thecache-writeR2 token may write objects but not create buckets, so the request is refused andrcatfails.nix copyin the precedingpushstep succeeds, so paths reach nix.moq.dev, but no commit ever gets itsroots/<commit>/record andrefreshnever restarts the age of reused paths.The now-deleted Cache refresh workflow failed for the same reason: its last run, 42829996937, ended with
no closures recorded for 9492473d5f...; a Cache push run records them. moq-dev/moq#8425 deleted that workflow and fixed the earlierdoes not contain a 'flake.nix'failure inroots, which is what exposed this one.Approach
Export
RCLONE_CONFIG_R2_NO_CHECK_BUCKET=trueon ther2:remote ininfra/nix/justfile. Both buckets exist (just infra nix createmakes them), so the check only ever adds a denied request.Impact
Caused by
r2:rclone remote and therootsupload withoutno_check_bucket, so the upload needs bucket-create rights the CI token lacks.Validation
readlink | rclone rcat r2:nix-ci-moq-dev/roots/abc/dev):PUT /nix-ci-moq-devand failed with the sameCreateBucket ... 403 ... AccessDeniedas CI;RCLONE_CONFIG_R2_NO_CHECK_BUCKET=true: no bucket request, onlyPUT /nix-ci-moq-dev/roots/abc/dev?x-id=PutObject.just --justfile infra/nix/justfile --evaluateshows the new export.cache-writeEnvironment. The first Cache run onmainafter merge is the end-to-end check.just --fmt --checkon the changed justfile: clean.Models
🤖 Generated with Claude Code
(Written by Opus 5.5)
Review
Rewritten by
quest reviewafter each round.Head: 3507914
Base: origin/main at bec81e4
Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1d109-5da3-7780-9303-04eea9edf6dd, round 1Score: 10/10,
The narrowly scoped remote setting lets rclone upload root records without attempting bucket creation, matching CI credentials and an existing repository pattern without identifiable regressions.Findings: none