Skip to content

fix(openshell): non-zero GID for the sandbox image - #126

Merged
pavelanni merged 1 commit into
mainfrom
bug/openshell-image-nonzero-gid
Nov 9, 2026
Merged

pavelanni merged 1 commit into
mainfrom
bug/openshell-image-nonzero-gid

Conversation

@pavelanni

Copy link
Copy Markdown
Collaborator

Summary

Containerfile.openshell declared USER 1001:0, and OpenShell refuses to start
a sandbox whose workload identity carries a zero UID or GID:

descriptor error: workload identity must not contain UID or GID zero

Every sandbox created from the -openshell image therefore failed at creation,
which blocks the v2 zero-trust demo. The image now uses 1001:1001 for the
runtime user and for the /workspace owner.

Why gid 0 was there

1001:0 is the OpenShift arbitrary-UID convention: group 0 owns the files so a
random UID can still write. OpenShell treats a zero GID as a privilege signal in
the workload identity, so the convention does not apply inside a sandbox.

Verification

Against a live OpenShell 0.1.6 gateway (zt2, podman driver):

  • make image-openshell builds; podman image inspect reports user=1001:1001.
  • podman run --rm … id → uid=1001(1001) gid=1001(1001).
  • openshell sandbox create --from <image> reaches Ready (previously failed
    with the descriptor error), id in the sandbox matches, and
    touch /workspace/probe succeeds.
  • Inside the sandbox, docsclaw ask --config-dir /workspace/config fetched a
    document through the supervisor's token exchange (end-to-end scenario 1 of the
    v2 demo).

Test plan

  • make image-openshell && podman run --rm docsclaw:dev-openshell id shows
    gid=1001
  • create a sandbox from the image on a live gateway and confirm Ready
  • re-run the v2 scenario 1 with DocsClaw as the agent

Fixes the image blocker found in T3 of the release test plan.

🤖 Generated with Claude Code

OpenShell refuses to start a sandbox whose workload identity carries a
zero UID or GID:

  descriptor error: workload identity must not contain UID or GID zero

Containerfile.openshell declared USER 1001:0 for the OpenShift gid-0
convention, so every sandbox created from the -openshell image failed at
creation. Use 1001:1001 for the user and for the workspace owner.

Verified against a live OpenShell 0.1.6 gateway: the image builds, a
sandbox from it reaches Ready, runs as uid=1001 gid=1001, and /workspace
is writable.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Updates
    • Updated the OpenShell sandbox image to use UID and GID 1001:1001.
    • Updated the setup documentation to reflect the image’s user and group identity and /workspace ownership.

The OpenShell container identity changes from UID:GID 1001:0 to 1001:1001. The deployment documentation now describes this identity, OpenShell’s rejection of zero UID or GID values, and /workspace ownership.

Changes: OpenShell workload identity

Layer / File(s) Summary
Set and document the workload identity
Containerfile.openshell, deploy/README.md
The Containerfile sets the identity to 1001:1001 and retains writable /workspace ownership. The README documents the identity, the stated rejection of zero UID or GID values, and /workspace ownership.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: Minimal · up to ad189

The image now uses the nonzero identity required by OpenShell, with matching workspace ownership. No merge-blocking risk is established.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title "fix(openshell): non-zero GID for the sandbox image" matches the main change. Containerfile.openshell and deploy/README.md move the runtime user from 1001:0 to 1001:1001 and set the /workspa…
Description check Passed The description explains the cause (USER 1001:0 rejected by OpenShell with a zero GID error), the fix (1001:1001 for runtime user and /workspace owner), and the rationale for the old OpenShift convent…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(openshell): non-zero GID for the sandbox image" matches the main change. Containerfile.openshell and deploy/README.md move the runtime user from 1001:0 to 1001:1001 and set the /workspace owner to match, which fixes the zero-GID rejection by OpenShell.

Full details: Description check

Explanation

The description explains the cause (USER 1001:0 rejected by OpenShell with a zero GID error), the fix (1001:1001 for runtime user and /workspace owner), and the rationale for the old OpenShift convention. This matches the raw summary of the Containerfile and README edits. It also gives verification steps and a test plan.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: c02e712d-4f78-4cf8-9026-af8dea40c35a
Commits

Reviewing files that changed from the base of the PR and between db32804 and ad189a6.

Files selected for processing: 2

  • Containerfile.openshell
  • deploy/README.md

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@pavelanni
pavelanni marked this pull request as ready for review November 9, 2026 16:31
@pavelanni
pavelanni merged commit 9c7c2a3 into main Nov 9, 2026
5 checks passed
@pavelanni
pavelanni deleted the bug/openshell-image-nonzero-gid branch November 9, 2026 16:35
@pavelanni
pavelanni restored the bug/openshell-image-nonzero-gid branch November 9, 2026 16:37
@pavelanni
pavelanni deleted the bug/openshell-image-nonzero-gid branch November 9, 2026 16:38
pavelanni added a commit that referenced this pull request Nov 9, 2026
* docs(zero-trust): add the v0.21 release test plan

Test plan for the zero-trust v2 line from db32804, tiered by what the
automated suite cannot reach: real provider wire format, the OpenShell
sandbox boundary, release artifacts, and regression of the features the
zero-trust work touched.

Records the first live runs against the Zero Trust Agents v2 stack, where
scenario 1 passes with DocsClaw as the agent, and three findings: the
GID-0 image defect (#126), the missing tar that broke sandbox upload
(#127), and the 30-minute demo subject token that turns a document fetch
into a bare 502 while the LLM path stays healthy. It also corrects the
source-derived expectation that a failed exchange surfaces as
token_grant_failed.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>

* docs(zero-trust): fix execution errors in the release test plan

Review findings, each verified against the code before changing it:

- Every command now uses "${OS[@]}". A bare $OS expands only the first
  element and drops --gateway-endpoint, so the plan's own commands would
  have hit the unreachable stored zt2 endpoint.
- The docsclaw service defaults to port 8000 and health port 8100
  (internal/config/config.go). Probes used 8180, which has no listener;
  confirmed by running serve and checking 8100/8180/8081.
- T3.5 served from /config/agent-b, which cannot exist in a sandbox.
- internal/egress names no 502 code: it prints a JSON "error" field when
  present and falls back to the status text. The expectations now say
  that, and record what the body actually contains.
- Paths are marked as belonging to the v2 checkout or to docsclaw, since
  both have scripts/, deploy/ and internal/.
- Scenario 4 was missing from the T3 table.

Also found while verifying: ask and serve fail outside the image with
"mkdir /workspace: read-only file system", so every local invocation now
passes --workspace to a writable directory.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>

* docs(zero-trust): fix the second review round on the test plan

- T3.1 used doc_endpoint_host, doc_endpoint_port and doc_allowed_ips_subst
  without loading them. Source scripts/lib.sh from the v2 checkout first,
  which is also where the OS array comes from.
- T3.2 uploads /tmp/dc-sandbox-config into /workspace, so it lands at
  /workspace/dc-sandbox-config; T3.3 and T3.5 now use the paths the upload
  actually produces, with T3.5's upload spelled out.
- T1.5's probes assert a status code and a WWW-Authenticate header, so
  they need curl -i; -s alone prints only the body.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>

---------

Signed-off-by: Pavel Anni <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant