Sandbox persisted by CreateSandbox stays invisible to workspace-scoped GetSandbox/GetService/GetProvider after a watch-event persist conflict
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 34/100
研究方向
Start in compute/mod.rs around the watch-event apply site near line 5003 where the optimistic-locking PersistenceError conflict is logged and the event is dropped; read the retry added for removals in d08935e7e (#5666) and compare it with the addition/update apply paths. Reproduce with the described CreateSandbox-then-GetSandbox sequence against a SQLite-backed gateway and confirm the conflict warning correlates with the missing workspace-scoped index entry. Done means a conflicting add/update watch event is retried or reapplied so GetSandbox, GetService and GetProvider find the object, including after an index rebuild from the store.
由索引模型根據 Issue 內容生成。
描述
Summary
After a client calls CreateSandbox, the sandbox is persisted to the SQLite store and its workload comes up, but every subsequent workspace-scoped lookup (GetSandbox, GetService, GetProvider with workspace_scope) returns NOT_FOUND. The sandbox stays invisible forever, including across gateway restarts, so orchestration flows that poll for the sandbox they just created deadloop.
Version
Reproduced at openshell commit 814f32099427c7b3072116c7e466bf025d829e27, whose crates/ and deploy/helm/ trees are identical to upstream v0.1.10 (152c59d3178039e3fbb4a5595f9fff7216a6be92).
Last known good: 9412bcf7468fd2617148042cedc591e5dd443a22, a build from upstream/main shortly after v0.1.8. The same client sequence works against it.
Environment
- Single gateway replica, SQLite persistence on a PVC.
- Kubernetes compute driver,
workspace_mode=operator, sandboxes created in per-tenant workspaces that already exist and are ACTIVE. - Client is an external orchestrator (OpenClaw Enterprise controller) speaking the
openshell.v1.OpenShellAPI over mTLS. The gateway logs show its calls arrive authenticated with the expected certificate subject.
Sequence
- The client creates a workspace once (CreateWorkspace succeeds, later GetWorkspace calls return it, phase ACTIVE).
- The client calls
CreateSandboxwith the workspace scope and a requested name. The call succeeds (gRPC OK). - The Sandbox CR is created, workload and supervisor pods come up, the supervisor connects (
ConnectSupervisor,GetSandboxConfig,ReportSandboxConfigurationall OK). - The client then polls
GetSandboxwith the same{workspace, name}it just used. Every call returns NOT_FOUND.GetServiceandGetProviderfor objects created in the same flow behave the same way.
Evidence
- Gateway metrics over ~30 minutes:
CreateSandbox code=02,GetSandbox code=5858,GetProvider code=5374,GetService code=5303, while supervisor-facing calls (GetSandboxConfig,ReportProviderReadiness,ConnectSupervisor) all succeed. - The
objectstable in the SQLite store contains the sandbox row: correctobject_type, the exact requestedname, and a payload that references the correct workspace. So the write landed; only the scoped lookup misses. - At the moment of creation the gateway logs:
WARN openshell_server::compute: Failed to apply compute driver event
error=concurrent modification detected during sandbox reconciliation
(current resource_version: 11)
This is the optimistic-locking Conflict from PersistenceError mapped in compute/mod.rs, logged at the watch-event apply site that drops the event without retrying it (compute/mod.rs around line 5003).
- Restarting the gateway does not help: the sandbox is still NOT_FOUND after the index is rebuilt from the store.
Hypothesis
The CreateSandbox RPC and the driver watch event for the same sandbox race on the persist layer. The watch-event apply loses the optimistic-concurrency check and is dropped with only a warning, so whatever that apply path is responsible for (indexing the sandbox under its workspace scope) never happens. d08935e7e (fix(compute): retry watch-driven sandbox removal after a concurrent write, #5666) added a retry for removals; additions and updates appear to still be dropped.
Impact
Any controller that provisions sandboxes and then waits to observe them cannot converge. For us this blocks every agent deployment on the affected gateway.
Workaround
None found. Rolling the gateway back to the v0.1.8-era build (which required removing the newer sqlx migration record from the store, since the older binary refuses to start with an applied migration missing from its embedded set) restores the working behavior.
- 主要語言
- 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 天內回覆