Skip to content

verifyGatewayContainerRunning crashes on second sandbox onboard (Buffer vs string) #2054

@TruongNguyenG

Description

@TruongNguyenG

Description

verifyGatewayContainerRunning() calls .trim() on result.stdout, which is a Buffer, not a string. Crashes with TypeError when onboarding a second sandbox while a gateway is already running. First onboard succeeds, second crashes at preflight.

Regression from PR #2032.

Reproduction Steps

  1. Run NEMOCLAW_SANDBOX_NAME=sandbox-a nemoclaw onboard --non-interactive (succeeds)
  2. Run NEMOCLAW_SANDBOX_NAME=sandbox-b nemoclaw onboard --non-interactive (crashes at preflight)

Environment

  • OS: Ubuntu 24.04 (GitHub Actions ubuntu-latest)
  • Node.js: v22.22.2
  • Docker: GitHub runner default
  • NemoClaw: v0.1.0 (main branch, Apr 18 2026)
  • OpenShell CLI: openshell 0.0.26

Debug Output

Not applicable — crash occurs before debug can run.

Logs

TypeError: (result.stdout || "").trim is not a function
    at verifyGatewayContainerRunning (onboard.js:106:54)
    at preflight (onboard.js:2068:32)
    at Object.onboard [as runOnboard] (onboard.js:5191:25)
    at async runOnboardCommand (onboard-command.js:82:5)
    at async onboard (nemoclaw.js:703:5)

Source: src/lib/onboard.ts line 141
  if (result.status === 0 && (result.stdout || "").trim() === "true") {

Fix: String(result.stdout || "").trim()
PR with fix: https://github.com/NVIDIA/NemoClaw/compare/main...TruongNguyenG:NemoClaw:fix/gateway-container-probe-buffer

Checklist

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

Metadata

Metadata

Assignees

Labels

VRDCIssues and PRs submitted by NVIDIA VRDC test team.area: cliCommand line interface, flags, terminal UX, or outputarea: installInstall, setup, prerequisites, or uninstall flowarea: onboardingOnboarding FSM, provider setup, sandbox launch, or first-run flowarea: sandboxOpenShell sandbox lifecycle, runtime, config, or recoveryplatform: ubuntuAffects Ubuntu Linux environments

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions