bug: SQLite-based agents fail in sandboxes because the default policy leaves /var/tmp unwritable
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 半天
- 新手友好度
- 42/100
研究方向
Start with the default sandbox policy definition, where /tmp is read-write and /var/tmp is not, and check how Landlock rules are built from it. Reproduce with the command in the issue: touch /var/tmp/a should fail while touch /tmp/a succeeds. Done means either /var/tmp is in the default read-write baseline or TMPDIR=/tmp is set when the image doesn't define it, and the default policy docs describe the change.
由索引模型根據 Issue 內容生成。
描述
User Story
I run coding agents such as Codex in OpenShell sandboxes. Codex 0.172 exits at startup in a sandbox with the default policy, because its SQLite state database can't create a temporary file. I need common agent CLIs to start under the default policy without per-image workarounds.
Problem Statement
The default policy makes /tmp read-write but leaves /var/tmp unwritable. With TMPDIR unset, SQLite on Linux chooses its temporary directory from SQLITE_TMPDIR, TMPDIR, /var/tmp, /usr/tmp and /tmp, in that order. Its check that a directory is writable doesn't account for Landlock, so it picks /var/tmp and then fails to open a file there with SQLITE_CANTOPEN (code 14).
Any workload that uses SQLite temporary files, or that otherwise writes to /var/tmp, fails the same way.
Impact / Why This Matters
Codex 0.172 stops at startup:
Error: failed to initialize sqlite state runtime under /sandbox/.codex: failed to
migrate state DB at /sandbox/.codex/state_5.sqlite: while executing migration 23:
error returned from database: (code: 14) unable to open database file
The cause isn't visible to the user: the error names the database under the writable home directory, not /var/tmp. The workaround is to export TMPDIR and SQLITE_TMPDIR pointing at a writable directory in every image or startup command, or to add /var/tmp to a custom policy.
Acceptance Criteria
- Under the default policy, a workload that uses SQLite temporary files with
TMPDIRunset works, for example Codex 0.172 starting in a sandbox. - The default policy page documents the behavior.
Reproduction Steps
-
Create a sandbox with the default image and policy:
openshell sandbox create -- sh -c 'touch /tmp/a && echo "/tmp writable"; touch /var/tmp/a || echo "/var/tmp not writable"; sleep infinity' -
The output shows
/tmp writableand/var/tmp not writable. -
Any SQLite program that needs a temporary file, run with
TMPDIRunset, fails withunable to open database file.
Environment
- OpenShell: 0.1.10-dev, PR #5856 branch at 8c4ee70
- OS: Fedora, Linux 7.2
- Runtime: Docker compute driver, default policy, default
nvcr.io/nvidia/base/ubuntu:24.04base image with Codex 0.172.0 added
Suggested UX (if applicable)
Either option would fix it without user action:
- Add
/var/tmpto the default read-write baseline, next to/tmp. - Set
TMPDIR=/tmpin the sandbox environment when the image doesn't set it.
- 主要語言
- Rust
- 星號
- 21.5k
- 分支
- 2.1k
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
NVIDIA/OpenShell 的其他 Issue
-
state:triage-needed
難度 2/5 1-3 小時 新手友好度 86/100
-
state:triage-needed
難度 2/5 1-3 小時 新手友好度 78/100
-
bug: Ready=False/PodTerminating is treated as a terminal sandbox failure可能已有人在做 @TaylorMutch 於 9 天前認領。 未關閉state:accepted state:pr-opened
難度 2/5 1-3 小時 新手友好度 78/100
-
state:triage-needed
難度 1/5 1-3 小時 新手友好度 78/100
-
state:triage-needed
難度 2/5 1-3 小時 新手友好度 62/100
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 2 天內回覆
-
autofixer: follow-up
難度 2/5 1-3 小時 新手友好度 78/100
tursodatabase/turso#12531 ·
維護者通常 1 天內回覆
-
bug help wanted ui
難度 2/5 1-3 小時 新手友好度 82/100
userFRM/egui-charts#4292 ·
維護者通常 1 天內回覆
-
Issue-Bug Need-Review
難度 1/5 1-3 小時 新手友好度 85/100
PowerShell/DSC#1832 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆