--- title: error / gradle-wrapper-sandbox-lock-2026-06-25 source_type: error-note status: raw related_branches: [feature-domain-feature-onboarding-contract] related_projects: [ca-skeleton] tags: [error, ca-skeleton, testing, gradle, static-analysis] created: 2026-06-25 status_label: resolved --- # error: gradle-wrapper-sandbox-lock-2026-06-25 > Layer: `raw/errors/` — Gradle wrapper/test 실행이 sandbox 밖 cache/lock 파일 쓰기에서 막힌 도구 문제 기록. ## Parent / 부모 - [[raw/branch-notes/feature-domain-feature-onboarding-contract]] ## 증상 / Symptom - 에러 메시지 (원문 그대로): ```text Exception in thread "main" java.io.FileNotFoundException: /home/donghyeon/.gradle/wrapper/dists/gradle-9.0.0-bin/d6wjpkvcgsg3oed0qlfss3wgl/gradle-9.0.0-bin.zip.lck (Read-only file system) ``` - 발생 컨텍스트: `./gradlew :app-bootstrap:test --tests '*DomainFeatureOnboardingContractTest' --tests '*ArchitectureViolationFixtureTest'` - 발생 시점: 2026-06-25 14:43 KST - 발생 환경: local Codex workspace sandbox (`workspace-write`) - 재현 가능 여부: `always` when Gradle wrapper needs to write `~/.gradle` under sandbox-only execution. ## 재현 절차 / Reproduction 1. workspace sandbox 안에서 Gradle wrapper test 명령을 실행한다. 2. wrapper 가 `~/.gradle/wrapper/dists/.../*.lck` 파일을 열려고 한다. 3. 기대 결과: focused test 실행. 실제 결과: read-only filesystem 오류로 wrapper 시작 전 실패. ## 조사 단계 / Investigation log - 2026-06-25 14:43 — sandbox 기본 권한으로 focused test 실행 → `Read-only file system` lock 오류. - 2026-06-25 14:43 — 같은 명령을 `require_escalated` 로 재실행 → Gradle wrapper/cache write 가능, 테스트 컴파일 단계까지 진행. - 2026-06-25 14:44~14:48 — 이후 Gradle 검증 명령은 모두 `require_escalated` 로 실행 → `BUILD SUCCESSFUL`. ## 근본 원인 / Root cause - 직접 원인: Gradle wrapper 가 workspace 밖 `~/.gradle` lock/cache 파일을 써야 하는데 기본 sandbox 는 해당 경로 쓰기를 허용하지 않았다. - 근본 원인: 이 프로젝트의 검증 명령은 Gradle user home 을 사용하므로 Codex sandbox 의 workspace-only write 정책과 충돌한다. - 트리거 조건: Gradle wrapper/test/check 명령을 escalation 없이 실행할 때. ## Sources / 근거 - [[raw/branch-notes/feature-domain-feature-onboarding-contract]] — 이번 작업의 검증 명령과 해결 이력. ## 해결 / Resolution - 적용한 조치: Gradle 검증 명령을 `require_escalated` 로 재실행했다. - 검증 방법: `./gradlew verifyCleanArchitectureDependencies`, `./gradlew :app-bootstrap:test --tests '*CleanArchitectureTest'`, focused suite, `./gradlew test` 모두 `BUILD SUCCESSFUL`. - 잔여 위험 / 후속 작업: Codex sandbox 에서 Gradle 을 실행할 때는 `~/.gradle` write 필요성을 먼저 인지하고 escalation 을 요청해야 한다. ## 회고 / Lessons - 빨리 감지하는 신호: Gradle wrapper 시작 직후 `.zip.lck` + `Read-only file system` 이 보이면 코드 문제가 아니라 sandbox write 권한 문제다. - 예방 체크리스트 항목 후보: Gradle wrapper/test/check 명령은 `~/.gradle` 쓰기를 이유로 escalation 을 선요청한다. - wiki로 끌어올릴 가치가 있는 일반화된 교훈: sandboxed agent 환경에서 build tool cache path 는 workspace 밖일 수 있다. ## Related / 관련 - 관련 branch: [[raw/branch-notes/feature-domain-feature-onboarding-contract]]