Skip to content

fix(host-mount): report the real reason a host directory is unusable - #9787

Merged
prekshivyas merged 2 commits into
NVIDIA:mainfrom
udsy19:fix/host-mount-error-cause
Aug 21, 2026
Merged

fix(host-mount): report the real reason a host directory is unusable#9787
prekshivyas merged 2 commits into
NVIDIA:mainfrom
udsy19:fix/host-mount-error-cause

Conversation

@udsy19

@udsy19 udsy19 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Both source-stat failure paths in --host-mount validation used a bare catch {} and reported host directory does not exist, so a directory under an unreadable ancestor was reported as missing. They now forward the underlying error.

Related Issue

Fixes #9786

Changes

  • failHostMount takes an optional cause; the two failure paths now report host directory is not usable: <path> plus the underlying error message, with that error attached as cause.
  • Same shape normalizePersistedSandboxHostMounts and verifyReadOnlyHostMountSources already use in this file. No new import, no new pattern.
  • A missing directory still reports no such file or directory, so the two existing assertions moved to that text.

Type of Change

  • Code change (feature, bug fix, or refactor)

Quality Gates

  • Tests added or updated for changed behavior
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)

The existing rejects missing, unreadable, relative, symlinked, non-normalized, and terminal-control paths case gains a path whose ancestor is a regular file and asserts cause.code === "ENOTDIR". On main that cause is undefined.

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: npx vitest run --project cli src/lib/onboard/host-mount/ passes; a sweep of all 17 test files that reference host mounts passes, 555 tests, no failures.
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed

Signed-off-by: Udaya Tejas udayatejas2004@gmail.com

Summary by CodeRabbit

  • Bug Fixes
    • Improved host-mount validation error messages by preserving the underlying filesystem error and affected path.
    • Distinguishes missing paths from unreadable directories and invalid child paths.
    • Reports clearer details when a file appears before a requested child path.

parseReadOnlyHostMount reported "host directory does not exist" for any
lstat/stat failure, so a directory that exists but sits under an
unreadable ancestor was reported as missing. Forward the underlying error
the way normalizePersistedSandboxHostMounts and
verifyReadOnlyHostMountSources already do in this file.

Signed-off-by: Udaya Tejas <udayatejas2004@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 51e57203-1819-4b3e-ba73-5760ec10a27d

📥 Commits

Reviewing files that changed from the base of the PR and between 46e10df and 34aaa48.

📒 Files selected for processing (2)
  • src/lib/onboard/host-mount/host-mount.test.ts
  • src/lib/state/registry/host-mount.ts

Included review availability: Your plan provides up to 12 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Host-mount validation now preserves underlying lstatSync and statSync errors. Tests cover missing sources, unreadable paths, and ENOTDIR failures.

Changes

Host-mount validation

Layer / File(s) Summary
Preserve filesystem validation errors
src/lib/state/registry/host-mount.ts, src/lib/onboard/host-mount/host-mount.test.ts
Validation helpers now retain filesystem error causes and source paths. Tests update missing-source messages and add coverage for unreadable paths and ENOTDIR.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 34aaa

The change improves host-directory validation errors while preserving missing-directory behavior, and no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: ericksoa, apurvvkumaria

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: reporting the actual reason a host directory is unusable.
Linked Issues check ✅ Passed The changes preserve lstat/stat failures, expose them as error.cause, and add ENOTDIR coverage, satisfying issue #9786.
Out of Scope Changes check ✅ Passed The implementation and test updates directly support host-mount error reporting and contain no unrelated changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Blocking findings reported

Advisor assessment: Blockers require maintainer review
Next action: Review the blockers below.
Findings: 1 blocker · 0 warnings · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 1 blocker · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings differ; normalized terminology decisions differ; normalized E2E selections differ; Nemotron reported 1 fewer blocker, the same number of warnings, the same number of suggestions.
2 additional E2E selections from the second opinion

Advisory only. The primary lane did not select these E2E jobs or targets.

  • double-onboard: The completed second-opinion lane identified E2E coverage that the primary lane omitted.
  • onboard-managed-image-buildless-e2e: The completed second-opinion lane identified E2E coverage that the primary lane omitted.

Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests.

1 semantic terminology decision

Terminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.

  • justified — unreadable at src/lib/onboard/host-mount/host-mount.test.ts:48: Keep the term in the test title. The test assertions identify the concrete ENOTDIR condition.

E2E guidance

Advisory only. A maintainer can dispatch the default E2E suite for the commit under review.

Recommended E2E: None

Manual-only E2E: onboard-repair, onboard-resume, cloud-onboard
The manual PR workflow does not run these selectors for the commit under review. Run them from reviewed code on main.

Blockers

PRA-1 Blocker — Cover final host-directory stat failures

  • Location: src/lib/state/registry/host-mount.ts:63
  • Category: tests
  • Problem: The changed parser preserves filesystem errors at both `lstatSync` and final `statSync` boundaries, but the changed test only reaches the component `lstatSync` failure. The final `statSync` catch has no direct regression coverage.
  • Impact: A later change can alter the final-stat error path without failing the changed regression test, restoring a generic or misleading error when the source changes after component inspection.
  • Fix: Add one focused test that lets component inspection succeed, makes the final `fs.statSync` throw a representative filesystem error, and asserts both the outer message and `Error.cause`.
  • Verification: Inspect the mock call sequence in the added test to confirm that `lstatSync` succeeds for every path component and that the assertion follows the final `statSync` throw.
  • Test coverage: A unit test for a final `statSync` failure after successful component inspection, asserting that the error message contains the filesystem code and `error.cause` has that code.
  • Evidence: src/lib/onboard/host-mount/host-mount.test.ts:68-80 asserts the component-inspection ENOTDIR error and cause. src/lib/state/registry/host-mount.ts:63-67 catches final `fs.statSync` failures and calls `failUnreadableHostMountSource`. src/lib/state/registry/host-mount.ts:23-29 formats the user-visible error and supplies `{ cause }`.

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed commit 34aaa4878e606ca2e3834bdf4c8cfb0799805d42. The two source-stat failure paths now preserve the underlying filesystem error as cause, distinguishing a missing path from an unusable path without changing validation or authorization behavior. Focused host-mount validation passed 17 tests after building generated CLI artifacts. Both advisor lanes reported no findings. The initial shard 2 failure occurred after tests during artifact handling; its bounded failed-job rerun is in progress and no failed check remains.

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed commit 2dccd03f2ea42c9c5774c11ce2c598cd10ca0718 after GitHub updated the branch from current main. The host-mount validation still preserves the underlying filesystem failure as the error cause without changing the user-facing classification or mount policy. After building generated CLI artifacts, the focused host-mount suite passed 12 tests.

@prekshivyas
prekshivyas merged commit bf90e8c into NVIDIA:main Aug 21, 2026
51 of 53 checks passed
@wscurran wscurran added the bug-fix PR fixes a bug or regression label Aug 24, 2026
ericksoa added a commit that referenced this pull request Sep 3, 2026
## Summary

Allows explicitly selected, registered native runtime providers to own
host readiness without being blocked by Docker-only availability,
reachability, runtime, or storage requirements. This restores the
documented Docker-less native Podman installer path while keeping
default Docker, platform, GPU, gateway, and unrelated blockers
fail-closed.

## Related Issue

Fixes #10891

## Changes

- Add an explicit, registry-validated provider-owned host-readiness
boundary and use it in both CLI onboarding and installer preflight.
- Keep default Docker and Docker-backed managed vLLM fail-closed;
Docker-less native Podman still runs its own doctor, GPU, bridge, and
DNS checks.
- Prove the public installer path with Docker removed on the Podman E2E
lane, post-install Docker absence, retained evidence, and fail-safe
restoration ordering.
- Align prerequisites, quickstarts, platform support, inference,
security, and troubleshooting guidance with the implemented boundary.

## Type of Change
- [ ] Code change (feature, bug fix, or refactor)
- [x] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Verification
- [ ] `npx prek run --all-files` passes
- [ ] `npm test` passes without unrelated infrastructure failures
- [x] Tests added or updated for new or changed behavior
- [x] No secrets, API keys, or credentials committed
- [x] Docs updated for user-facing behavior changes
- [x] Documentation validation passes with zero errors
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

Exact-head evidence for `68893d8bfc36e2e30c2b9a18449d43e5ec26c3cd`:

- [PR Review
Advisor](https://github.com/NVIDIA/NemoClaw/actions/runs/33757032152):
all nine specialists succeeded; every artifact was inspected and reports
no remaining finding.
- CodeRabbit reviewed the exact head, confirmed both requested fixes,
accepted Podman `ownsHostReadiness: true`, and has zero unresolved
threads.
- [Rootless Podman CPU
Qualification](https://github.com/NVIDIA/NemoClaw/actions/runs/33757034936):
success with Docker disabled.
- [Managed
Images](https://github.com/NVIDIA/NemoClaw/actions/runs/33757034962):
all ten jobs succeeded, including exact all-agent activation and both
OpenClaw MCP discovery passes.
- [Focused
E2E](https://github.com/NVIDIA/NemoClaw/actions/runs/33760249117):
`cloud-onboard / podman / public-nvidia` succeeded. The retained receipt
records `dockerClientAvailable: false` at `/usr/bin/docker`; the
post-install `command -v docker` probe exited 1; installer, sandbox,
inference/security checks, restoration, and cleanup passed.
- Code scanning, installer hashes, DCO, docs, CLI/installer parity,
governance, local focused suites, mock/live parity, growth guardrails,
CLI typecheck, repository checks, Fern validation, lint, and commit/push
hooks passed.

Known unrelated CI state:

- The full Linux package-contract runner passed 1,238 tests but npm
10.9.8 crashed in `managed-image-registry-transport.test.ts` with
upstream npm/cli issue [#9787](npm/cli#9787).
The exact test passes standalone and the same npm crash is present on
unrelated PRs; three exact-head attempts reproduced the npm defect.
- Self-hosted image qualification has two pre-existing migration
failures that reproduce on the prior head and are owned by separate PR
#10941. This PR does not change those image/test surfaces.

## AI Disclosure
- [x] AI-assisted — tool: Codex

---
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>

---------

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

host-mount reports "does not exist" for a directory that exists but is unreachable

4 participants