Files
llm-wiki/raw/errors/gradle-wrapper-lock-read-only-sandbox-2026-06-10.md
T

66 lines
3.3 KiB
Markdown

---
title: error / gradle-wrapper-lock-read-only-sandbox
source_type: error-note
status: raw
related_branches: [feature-sample-domain-contract-fixture]
related_projects: [ca-skeleton]
tags: [error, ca-skeleton, testing, gradle]
created: 2026-06-10
status_label: workaround
---
# error: gradle-wrapper-lock-read-only-sandbox
## Parent / 부모
- [[raw/branch-notes/feature-sample-domain-contract-fixture]] — sample fixture 구현 검증 중 Gradle wrapper cache lock 쓰기 실패가 발생.
## 증상 / 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 :sample-portfolio:test --tests ...` 및 focused test 재실행.
- 발생 시점: 2026-06-10 18:30 KST 전후.
- 발생 환경: local Codex sandbox.
- 재현 가능 여부: `always` — sandbox 기본 권한으로 Gradle wrapper lock 파일을 쓸 때 반복.
## 재현 절차 / Reproduction
1. ca-tmpl `src/`에서 sandbox 기본 권한으로 `./gradlew :sample-portfolio:test --tests '*WorkLogTest'` 실행.
2. 기대 결과: Gradle focused test 실행.
3. 실제 결과: `~/.gradle/wrapper/dists/...zip.lck` lock 파일 생성 실패로 JVM wrapper main이 종료.
## 조사 단계 / Investigation log
- 2026-06-10 18:30 — focused test를 sandbox 기본 권한으로 실행 → `Read-only file system` 메시지 확인.
- 2026-06-10 18:30 — 동일 명령을 승인 실행(`require_escalated`)으로 재시도 → RED 컴파일 실패를 정상 확인.
- 2026-06-10 18:31 — GREEN 후 `:sample-portfolio:test`, `test`, `check`도 승인 실행 → 모두 exit 0.
## 근본 원인 / Root cause
- 직접 원인: Gradle wrapper가 사용자 홈의 `~/.gradle` lock/cache 파일을 쓰려 했지만 sandbox가 해당 경로를 read-only로 제한.
- 근본 원인: ca-tmpl workspace write root와 Gradle 사용자 홈 cache 위치가 다름.
- 트리거 조건: sandbox 기본 권한에서 Gradle wrapper/cache가 아직 lock 파일 쓰기를 요구하는 test/check 명령 실행.
## Sources / 근거
- [[raw/branch-notes/feature-sample-domain-contract-fixture]] — 이번 구현의 검증 명령과 sandbox 실패 기록.
## 해결 / Resolution
- 적용한 조치: 동일 Gradle 명령을 `require_escalated`로 승인 실행.
- 검증 방법: `:sample-portfolio:test`, `verifyCleanArchitectureDependencies`, `:app-bootstrap:test --tests '*CleanArchitectureTest'`, `test`, `check` 모두 exit 0.
- 잔여 위험 / 후속 작업: Codex sandbox에서 Gradle을 처음 실행할 때 같은 lock 파일 쓰기 문제가 재발 가능.
## 회고 / Lessons
- 빨리 감지하는 신호: `~/.gradle/...zip.lck (Read-only file system)`가 보이면 코드 문제가 아니라 sandbox write 권한 문제로 본다.
- 예방 체크리스트 항목 후보: Gradle 검증이 필요한 작업은 wrapper/cache write 때문에 승인 실행이 필요할 수 있음을 기록.
- wiki로 끌어올릴 가치가 있는 일반화된 교훈: sandboxed coding agent에서 build tool home cache는 workspace 밖 write 권한을 필요로 할 수 있다.
## Related / 관련
- 관련 branch: [[raw/branch-notes/feature-sample-domain-contract-fixture]]