NemoClaw icon indicating copy to clipboard operation
NemoClaw copied to clipboard

[E2E] test-token-rotation.sh exits hard when install.sh aborts on environmental preflight failure

Open hunglp6d opened this issue 7 months ago • 0 comments

Description

What happens

test/e2e/test-token-rotation.sh calls exit 1 mid-Phase 0 whenever install.sh --non-interactive returns a non-zero exit code (test-token-rotation.sh:146 on main). When this happens:

  • No Summary is printed.
  • Phases 1 through 5 are never run.
  • CI reports a generic failure without saying which phases would have passed.

The same hard-exit pattern is repeated in each per-phase onboard branch (Phases 2–5), so a single mid-test failure would also stop the rest of the run.

When it triggers

Reliably reproduces under any network that blocks outbound HTTPS to api.telegram.org. The onboard step at [5/8] Messaging channels prints:

Aborting onboarding in non-interactive mode due to Telegram network reachability failure. FAIL: install.sh failed (exit 1)

install.sh exits 1 and the test stops right after.

Expected behavior

Environmental failures (Telegram or Discord API unreachable) should be treated as SKIPs, not fatal errors:

  • Record the skip and mark the dependent phases as skipped too.
  • Still print the Summary so CI can show the full picture.

Hard exit should be reserved for real infrastructure problems — for example, openshell or nemoclaw missing from PATH after install.

Reproduction Steps

  1. Setup: get on a network that blocks outbound HTTPS to api.telegram.org.

  2. Export environment variables and fake tokens:

    export NVIDIA_API_KEY=nvapi-...
    export NEMOCLAW_NON_INTERACTIVE=1
    export NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE=1
    export TELEGRAM_BOT_TOKEN_A=fake-a TELEGRAM_BOT_TOKEN_B=fake-b
    export DISCORD_BOT_TOKEN_A=fake-c DISCORD_BOT_TOKEN_B=fake-d
    
  3. Run the test from the repo root:

    bash test/e2e/test-token-rotation.sh
    
  4. What you should see: the script exits with code 1 partway through Phase 0. No Summary is printed and Phases 1–5 are skipped — the run looks like a generic failure without saying which phases would have passed.


Optional check — to confirm the network is the actual cause, hit Telegram directly from the same shell:

curl -sI --max-time 10 https://api.telegram.org/

Environment

  • OS: macOS 15.x (Apple M4); also affects ubuntu-latest in nightly CI under restricted networks
  • Node.js: v24.14.1
  • Docker: Docker Desktop with Colima runtime
  • NemoClaw: built from main

Debug Output


Logs

➜  NemoClaw 
➜  NemoClaw bash test/e2e/test-token-rotation.sh                                                            

=== Phase 0: Install NemoClaw and first onboard with token A ===
  [info] Running install.sh --non-interactive (includes first onboard)...

==> /tmp/nemoclaw-e2e-install.log <==

==> /tmp/nemoclaw-e2e-install.log <==

   ███╗   ██╗███████╗███╗   ███╗ ██████╗  ██████╗██╗      █████╗ ██╗    ██╗
   ████╗  ██║██╔════╝████╗ ████║██╔═══██╗██╔════╝██║     ██╔══██╗██║    ██║
   ██╔██╗ ██║█████╗  ██╔████╔██║██║   ██║██║     ██║     ███████║██║ █╗ ██║
   ██║╚██╗██║██╔══╝  ██║╚██╔╝██║██║   ██║██║     ██║     ██╔══██║██║███╗██║
   ██║ ╚████║███████╗██║ ╚═╝ ██║╚██████╔╝╚██████╗███████╗██║  ██║╚███╔███╔╝
   ╚═╝  ╚═══╝╚══════╝╚═╝     ╚═╝ ╚═════╝  ╚═════╝╚══════╝╚═╝  ╚═╝ ╚══╝╚══╝

  Launch OpenClaw in an OpenShell sandbox.


[1/3] Node.js
  ──────────────────────────────────────────────────
[INFO]  Node.js found: v24.14.1
[INFO]  Runtime OK: Node.js v24.14.1, npm 11.11.0

[2/3] NemoClaw CLI
  ──────────────────────────────────────────────────
[INFO]  Installer payload is not a persistent source checkout — installing from GitHub…
[INFO]  Installing NemoClaw from GitHub…
[INFO]  Resolved install ref: latest
[INFO]  Cloning NemoClaw source
Cloning into '/Users/hple/.nemoclaw/source'...
Note: switching to '68fa01ccfcbf25a59bede65b586ed072678d6b2a'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

[INFO]  Preparing OpenClaw package
[INFO]  Pre-extracting [email protected] with system tar (GH-503 workaround)…
[INFO]  openclaw pre-extracted successfully
[INFO]  Installing NemoClaw dependencies

added 293 packages, removed 1 package, and audited 294 packages in 2s

85 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
[INFO]  Building NemoClaw CLI modules

> [email protected] build:cli
> tsc -p tsconfig.src.json

[INFO]  Building NemoClaw plugin

added 183 packages, and audited 184 packages in 815ms

69 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

> [email protected] build
> tsc

[INFO]  Linking NemoClaw CLI

added 1 package, and audited 3 packages in 2s

found 0 vulnerabilities
[INFO]  Created user-local shim at /Users/hple/.local/bin/nemoclaw
[INFO]  Created user-local shim at /Users/hple/.local/bin/nemoclaw
[INFO]  Verified: nemoclaw is available at /Users/hple/.local/bin/nemoclaw

[3/3] Onboarding
  ──────────────────────────────────────────────────

  Detected container runtime: colima
[WARN]  Host preflight found warnings.
  - Install OpenShell: OpenShell is required before onboarding can create or manage a gateway.
    Run the NemoClaw installer or `scripts/install-openshell.sh`.

  Third-Party Software Notice - NemoClaw Installer
  ──────────────────────────────────────────────────
  NemoClaw is licensed under Apache 2.0 and automatically
  retrieves, accesses or interacts with third-party software
  and materials, including by deploying OpenClaw in an
  OpenShell sandbox. Those retrieved materials are not
  distributed with this software and are governed solely
  by separate terms, conditions and licenses.
  
  You are solely responsible for finding, reviewing and
  complying with all applicable terms, conditions, and
  licenses, and for verifying the security, integrity and
  suitability of any retrieved materials for your specific
  use case.
  
  This software is provided "AS IS", without warranty of
  any kind. The author makes no representations or
  warranties regarding any third-party software, and
  assumes no liability for any losses, damages, liabilities
  or legal consequences from your use or inability to use
  this software or any retrieved materials. Use this
  software and the retrieved materials at your own risk.
  
  OpenClaw security guidance
  https://docs.openclaw.ai/gateway/security

  [non-interactive] Third-party software notice accepted via --yes-i-accept-third-party-software.
[INFO]  Running nemoclaw onboard…

  NemoClaw Onboarding
  (non-interactive mode)
  ===================

  [1/8] Preflight checks
  ──────────────────────────────────────────────────
  ✓ Docker is running
  ✓ Container runtime: colima
  openshell CLI not found. Installing...
  ✓ openshell CLI: openshell 0.0.29
  ✓ Port 8080 available (OpenShell gateway)
  ✓ Port 18789 available (NemoClaw dashboard)
  ✓ Apple GPU detected: Apple M4 (10 cores), 24576 MB unified memory
  ⓘ NIM requires NVIDIA GPU — will use cloud inference

  [2/8] Starting OpenShell gateway
  ──────────────────────────────────────────────────
  Using pinned OpenShell gateway image: ghcr.io/nvidia/openshell/cluster:0.0.29
  Starting gateway cluster...
  Still starting gateway cluster... (5s elapsed)
  Still starting gateway cluster... (10s elapsed)
  Still starting gateway cluster... (20s elapsed)
  Still starting gateway cluster... (30s elapsed)
  Still starting gateway cluster... (40s elapsed)
  Still starting gateway cluster... (50s elapsed)
  Still starting gateway cluster... (60s elapsed)
  Starting OpenShell gateway pod...
  Installing OpenShell components...
  Starting OpenShell gateway pod...
  Still starting OpenShell gateway pod... (70s elapsed)
  Still starting OpenShell gateway pod... (80s elapsed)
  Waiting for gateway health...
  Waiting for gateway health...
  Gateway container is still running healthy; allowing up to 300s for first-time startup.
  ✓ Gateway is healthy
  Patching CoreDNS DNS forwarding...
Patching CoreDNS to forward to 192.168.5.1...
CoreDNS patched. Waiting for rollout...
Done. DNS should resolve in ~10 seconds.
✓ Active gateway set to 'nemoclaw'

  [3/8] Configuring inference (NIM)
  ──────────────────────────────────────────────────
  [non-interactive] Provider: build
  Chat Completions API available — OpenClaw will use openai-completions.
  Using NVIDIA Endpoints with model: nvidia/nemotron-3-super-120b-a12b

  [4/8] Setting up inference provider
  ──────────────────────────────────────────────────
✓ Active gateway set to 'nemoclaw'
✓ Created provider nvidia-prod
Gateway inference configured:

  Route: inference.local
  Provider: nvidia-prod
  Model: nvidia/nemotron-3-super-120b-a12b
  Version: 1
  Timeout: 60s (default)
  ✓ Inference route set: nvidia-prod / nvidia/nemotron-3-super-120b-a12b

  [5/8] Messaging channels
  ──────────────────────────────────────────────────
  [non-interactive] Messaging tokens detected: telegram, discord

  ⚠ api.telegram.org is not reachable from this host.
    Telegram integration requires outbound HTTPS access to api.telegram.org.
    This is commonly blocked by corporate network proxies.
  Aborting onboarding in non-interactive mode due to Telegram network reachability failure.
  FAIL: install.sh failed (exit 1)
  [info] Last 30 lines of install log:
Done. DNS should resolve in ~10 seconds.
✓ Active gateway set to 'nemoclaw'

  [3/8] Configuring inference (NIM)
  ──────────────────────────────────────────────────
  [non-interactive] Provider: build
  Chat Completions API available — OpenClaw will use openai-completions.
  Using NVIDIA Endpoints with model: nvidia/nemotron-3-super-120b-a12b

  [4/8] Setting up inference provider
  ──────────────────────────────────────────────────
✓ Active gateway set to 'nemoclaw'
✓ Created provider nvidia-prod
Gateway inference configured:

  Route: inference.local
  Provider: nvidia-prod
  Model: nvidia/nemotron-3-super-120b-a12b
  Version: 1
  Timeout: 60s (default)
  ✓ Inference route set: nvidia-prod / nvidia/nemotron-3-super-120b-a12b

  [5/8] Messaging channels
  ──────────────────────────────────────────────────
  [non-interactive] Messaging tokens detected: telegram, discord

  ⚠ api.telegram.org is not reachable from this host.
    Telegram integration requires outbound HTTPS access to api.telegram.org.
    This is commonly blocked by corporate network proxies.
  Aborting onboarding in non-interactive mode due to Telegram network reachability failure.
➜  NemoClaw

Checklist

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

hunglp6d avatar Apr 22 '26 09:04 hunglp6d