Sandbox persisted by CreateSandbox stays invisible to workspace-scoped GetSandbox/GetService/GetProvider after a watch-event persist conflict

オープン
#5,954 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
34/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
kubernetes, rust, sqlite
領域
backend

調査の方向性

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 の本文から書いたものです。

説明

state:accepted

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.OpenShell API over mTLS. The gateway logs show its calls arrive authenticated with the expected certificate subject.

Sequence

  1. The client creates a workspace once (CreateWorkspace succeeds, later GetWorkspace calls return it, phase ACTIVE).
  2. The client calls CreateSandbox with the workspace scope and a requested name. The call succeeds (gRPC OK).
  3. The Sandbox CR is created, workload and supervisor pods come up, the supervisor connects (ConnectSupervisor, GetSandboxConfig, ReportSandboxConfiguration all OK).
  4. The client then polls GetSandbox with the same {workspace, name} it just used. Every call returns NOT_FOUND. GetService and GetProvider for objects created in the same flow behave the same way.

Evidence

  • Gateway metrics over ~30 minutes: CreateSandbox code=0 2, GetSandbox code=5 858, GetProvider code=5 374, GetService code=5 303, while supervisor-facing calls (GetSandboxConfig, ReportProviderReadiness, ConnectSupervisor) all succeed.
  • The objects table in the SQLite store contains the sandbox row: correct object_type, the exact requested name, 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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NVIDIA/OpenShell のほかの issue

NVIDIA/OpenShell の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。