Skip to content

nightly-e2e: gateway recovery does not regenerate proxy-env.sh guard chain (#2701) #5262

Closed as not planned

Description

@hunglp6d

Bug Report

Description

Problem Statement

The issue-2478-crash-loop-recovery nightly E2E job failed because the gateway recovery script in src/lib/agent/runtime.ts (both buildOpenClawRecoveryScript() and buildRecoveryScript()) only warns when /tmp/nemoclaw-proxy-env.sh is missing at recovery time but does not attempt to regenerate it from the preload scripts still on disk. Without proxy-env.sh, NODE_OPTIONS is empty, which means the safety-net and ciao-network-guard preload scripts are not loaded, and the E2E assertion checking for nemoclaw-sandbox-safety-net and nemoclaw-ciao-network-guard in NODE_OPTIONS fails:

FAIL: after recovery NODE_OPTIONS must contain sandbox-safety-net and ciao-network-guard (#2701)

This is the aarch64 crash-loop recovery path where the gateway process dies and the recovery script must bring it back with all security guards intact.

Proposed Design

Replace the warn-and-proceed branches in both buildOpenClawRecoveryScript() (line ~205) and buildRecoveryScript() (line ~279) in src/lib/agent/runtime.ts with regenerate-and-proceed logic that:

  1. Scans /tmp/ for known preload scripts (nemoclaw-sandbox-safety-net.js, nemoclaw-ciao-network-guard.js, nemoclaw-http-proxy-fix.js, etc.)
  2. Reconstructs NODE_OPTIONS from the --require directives for each found script
  3. Writes a fresh /tmp/nemoclaw-proxy-env.sh, sources it, and logs the regeneration
  4. Falls back to the original warn-and-proceed only if no preload scripts are found at all
  5. After regeneration, re-checks that the critical guards (safety-net and ciao-network-guard) are present in NODE_OPTIONS

Alternatives Considered

  1. Persisting proxy-env.sh to a crash-safe location: Rejected because /tmp is the documented ephemeral state directory for sandbox runtime, and adding persistence mechanics is out of scope.
  2. Making the E2E test tolerate missing guards: Rejected because the guards are security-critical — the test correctly requires them.

Category

test_failure

Reproduction Steps

  1. Check out NemoClaw at commit a3ae21b6eed8399099fd390bd45ad43e78218258
  2. Run the issue-2478-crash-loop-recovery E2E scenario, which triggers a gateway crash and recovery
  3. Observe that after recovery, NODE_OPTIONS is empty and the #2701 assertion fails

Environment

  • OS: GitHub Actions runner (Ubuntu 22.04, aarch64 emulation)
  • Node.js: v22.16+
  • Docker: Docker-in-Docker (GitHub Actions)
  • NemoClaw: main @ a3ae21b
  • Other: Nightly E2E run 27386272836

Debug Output

N/A — CI job logs available at https://github.com/NVIDIA/NemoClaw/actions/runs/27386272836

Logs

[gateway-recovery] WARNING: /tmp/nemoclaw-proxy-env.sh missing — proceeding without library guards
FAIL: after recovery NODE_OPTIONS must contain sandbox-safety-net and ciao-network-guard (#2701)

Checklist

  • I confirmed this bug is reproducible (required)
  • I searched existing issues and this is not a duplicate (required)

Suggested Labels

nightly-e2e, auto-diagnosed, test-failure, agent-runtime, security


Suggested Labels (apply manually after triage)

nightly-e2e, auto-diagnosed, test-failure, agent-runtime, security


Related PR: #5259

Activity

  1. added
    area: sandbox
    area: security
    integration: openclaw
    on Nov 13, 2026
  2. added theissue type on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: sandboxarea: securityintegration: openclaw

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions