Skip to content

bug: install.sh fails with 'BASH_SOURCE[0]: unbound variable' when piped via curl #655

Closed

Description

@ericksoa

Summary

curl -fsSL https://www.nvidia.com/nemoclaw.sh | bash fails with:

bash: line 9: BASH_SOURCE[0]: unbound variable

Root cause

PR #470 added SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" near the top of install.sh. When the script is piped via curl | bash, BASH_SOURCE is empty and set -u (from set -euo pipefail) treats it as an unbound variable.

Fix

Use a fallback:

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"

Reproduction

curl -fsSL https://www.nvidia.com/nemoclaw.sh | bash

Tested on macOS with Docker Desktop. The banner still renders but the error appears on line 2 of output.

Introduced by

#470

Activity

  1. added a commit that references this issue on Mar 22, 2026
    d76cc4c
  2. ericksoa commented on Mar 22, 2026

    @ericksoa
    MemberAuthor

    Workaround: Clone and run locally instead of piping:

    git clone --depth 1 https://github.com/NVIDIA/NemoClaw.git
    cd NemoClaw
    bash install.sh

    Fix: PR #656 — one-line change, pending merge.

  3. ericksoa commented on Mar 22, 2026

    @ericksoa
    MemberAuthor

    Note: The test log that surfaced this issue also showed a second failure — the cgroup v2 gateway crash (openat2 /sys/fs/cgroup/kubepods/pids.max: no such file or directory). That's a separate, pre-existing issue tracked in #136. If you hit both, the BASH_SOURCE fix (#656) resolves the first error but the cgroup issue will still block gateway startup until #136 is resolved.

  4. added a commit that references this issue on Mar 22, 2026
    5eb4b71
  5. added a commit that references this issue on Mar 22, 2026
    5e3dc03
  6. added a commit that references this issue on Mar 24, 2026
    d4837d3
  7. added a commit that references this issue on Mar 24, 2026
    84e86a1
  8. added theissue type on Jun 8, 2026
  9. added
    area: install
    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: install

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions