Skip to content

[Bug] nemoclaw connect hangs indefinitely with no timeout or status indicator when sandbox is starting up or has crashed #430

Closed

Description

@saismrutiranjan18

Affected Component

nemoclaw <n> connect command

Problem

Running nemoclaw my-assistant connect while the sandbox is in any
non-ready state (starting, pulling image, crashed, stopped) causes the
command to hang indefinitely with no output, no progress indicator,
and no timeout.

The 2.4 GB sandbox image can take several minutes to pull on first run.
During this time, users see a blank terminal with no indication whether:

  • The sandbox is starting normally (wait)
  • The image is still being pulled (wait longer)
  • The sandbox has crashed (investigate with logs)
  • The gateway is unreachable (configuration issue)
  • The connection is actually hanging at the network level

This is especially problematic immediately after nemoclaw onboard completes,
as the README instructs users to immediately run nemoclaw my-assistant connect
— which will hang if the sandbox image is still being pulled.

Steps to Reproduce

# Immediately after onboard, before sandbox is ready:
nemoclaw my-assistant connect
# Hangs indefinitely with no output

# Also reproducible by stopping a sandbox and connecting:
nemoclaw stop
nemoclaw my-assistant connect
# Should fail immediately with a clear error; instead hangs

Expected Behavior

$ nemoclaw my-assistant connect
Waiting for sandbox 'my-assistant' to be ready...
  Status: pulling-image  (12s elapsed)
  Status: pulling-image  (15s elapsed)
  Status: starting       (18s elapsed)
  Status: running        (21s elapsed)
Sandbox is ready. Connecting...
sandbox@my-assistant:~$

Or on failure:

$ nemoclaw my-assistant connect
Waiting for sandbox 'my-assistant' to be ready...
  Status: failed (24s elapsed)

[ERROR] Sandbox 'my-assistant' is in a failed state.
        Run: nemoclaw my-assistant logs --follow
        Run: nemoclaw my-assistant status

Suggested Fix

Add a readiness poll with configurable timeout in the connect command:

wait_for_sandbox() {
  local name="$1"
  local timeout="${NEMOCLAW_CONNECT_TIMEOUT:-120}"
  local interval=3
  local elapsed=0

  echo "Waiting for sandbox '$name' to be ready..."

  while [ "$elapsed" -lt "$timeout" ]; do
    local status
    status=$(openshell sandbox list --json 2>/dev/null \
      | jq -r --arg n "$name" '.[] | select(.name==$n) | .status' 2>/dev/null \
      || echo "unknown")

    case "$status" in
      running)
        echo "Sandbox ready. Connecting..."
        return 0
        ;;
      failed|error|crashed)
        echo ""
        echo "[ERROR] Sandbox is in '$status' state."
        echo "        Run: nemoclaw $name logs --follow"
        return 1
        ;;
      *)
        printf "\r  Status: %-20s (%ds elapsed)" "$status" "$elapsed"
        sleep "$interval"
        elapsed=$((elapsed + interval))
        ;;
    esac
  done

  echo ""
  echo "[TIMEOUT] Sandbox did not become ready within ${timeout}s."
  echo "          Check: openshell sandbox list"
  return 1
}

Also respect a NEMOCLAW_CONNECT_TIMEOUT environment variable for users
who need longer timeouts on slow networks.

Activity

  1. added a commit that references this issue on Mar 20, 2026
    954e578
  2. wscurran commented on Mar 20, 2026

    @wscurran
    Contributor

    Thanks for describing the issue with the nemoclaw connect command hanging indefinitely when the sandbox is not in a ready state, which is frustrating and something we should fix.

  3. added 6 commits that reference this issue on Mar 21, 2026
    a645867
    8dce304
    286fe06
    377044b
    8f7d2b6
    1d5807d
  4. 920204 commented on Mar 24, 2026

    @920204

    Bug Report: Critical Issues with NemoClaw on WSL2 (Docker Desktop)
    Environment
    OS: Windows 11 → WSL2 Ubuntu

    Docker: Docker Desktop with WSL2 backend

    NemoClaw: installed via nemoclaw_install.sh

    OpenShell: v0.0.10

    Container Image: ghcr.io/nvidia/openshell/cluster:0.0.10

    🛑 Bug 1: nemoclaw connect fails with exit 255 after container restart
    Summary
    After any Docker container restart (including system reboots), the command nemoclaw nemo-claw connect consistently fails.

    Error Message: Command failed (exit 255): openshell sandbox connect "nemo-claw"

    Current Workaround: Must run nemoclaw nemo-claw destroy followed by nemoclaw onboard every time, which is unsustainable for a standard workflow.

    Root Cause Analysis
    The entrypoint script /usr/local/bin/cluster-entrypoint.sh generates a new random SSH_HANDSHAKE_SECRET on every container start:

    Bash
    SSH_HANDSHAKE_SECRET="${SSH_HANDSHAKE_SECRET:-$(head -c 32 /dev/urandom | od -A n -t x1 | tr -d ' \n')}"
    Gateway (openshell-0): Managed by Helm, receives the NEW secret upon restart.

    Sandbox (nemo-claw): Not managed by Helm; it retains the OLD secret from the initial onboard time.

    Result: The NSSH1 handshake fails due to secret mismatch.

    Log Evidence:

    Gateway logs: SSH tunnel failure error=sandbox handshake rejected

    Sandbox logs: SSH connection: handshake verification failed peer=10.42.0.41:50034

    Tried Workarounds (Unsuccessful)
    Clearing mTLS cache.

    Recreating gateway pod (secret simply regenerates).

    Manually setting helm upgrade --set server.sshHandshakeSecret (overwritten by entrypoint script on next restart).

    Suggested Fixes
    Persistence: Save the generated secret to the K3s data volume (e.g., /var/lib/rancher/k3s/server/) and check for its existence before generating a new one.

    Environment Variable: Allow SSH_HANDSHAKE_SECRET to be passed as a Docker -e variable to fix the value.

    Controller Management: Wrap the sandbox pod in a Deployment/StatefulSet so it can react to Helm manifest changes.

    🛑 Bug 2: Agent reasoning interrupted mid-response
    Summary
    The OpenClaw agent (LINE/TUI) intermittently stops responding during complex, multi-step reasoning tasks. The output cuts off abruptly without error messages.

    Steps to Reproduce
    Connect to sandbox and start the agent.

    Submit a complex query requiring deep reasoning.

    Observe the response stream stopping mid-sentence.

    Potential Causes
    Inference Timeout: NVIDIA endpoint API timing out.

    Token Limits: Max token limit reached without a "finish_reason" handler.

    Network Stability: Proxy/Load Balancer timeouts in the OpenShell inference layer.

    Reproduction Rate
    Bug 1: 100% (Every restart)

    Bug 2: 20-30% (Intermittent, complexity-dependent)

    Additional Notes
    I have access to full logs and a reproduction environment. Please let me know if further diagnostics are required.

  5. added 2 commits that reference this issue on Mar 25, 2026
    89a490b
    5d79bef
  6. added a commit that references this issue on Mar 28, 2026
    240d0ee
  7. added a commit that references this issue on Mar 30, 2026
    3c82130
  8. added 3 commits that reference this issue on Mar 31, 2026
    8347129
    fb72886
    9f39a84
  9. added 4 commits that reference this issue on Apr 14, 2026
    07d1e17
    7554e69
    efb68b3
    c9c0773
  10. added a commit that references this issue on Apr 21, 2026
    49ec895
  11. added
    area: cli
    and removed on Jun 3, 2026
  12. added theissue type on Jun 8, 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: cli

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions