Bash tool dies (exit 1, no output) when a bound NFS/autofs mountpoint hangs — bubblewrap namespace setup blocks; poisoned until restart
Summary
On Linux, the Bash tool can suddenly start returning **exit code 1 with no stdout/stderr for every command — including trivial ones like true or echo — and stays broken for the rest of the session until the claude process is restarted. dangerouslyDisableSandbox / sandbox.enabled: false do not** restore it.
The trigger is a hung mountpoint (in my case NFS-over-Tailscale that wedged into uninterruptible D-state after a network blip). Because the Bash sandbox uses bubblewrap, which recursively binds the host root tree into a fresh mount namespace on every command, a single hung mountpoint anywhere under / makes namespace setup block/fail → all Bash commands die. The failure then persists in the session even after the underlying mount is recovered, until claude itself is restarted.
This appears to be the shared root cause behind several separately-reported issues:
- #41124 (Arch/CachyOS: every command exits 1, no output; sandbox-disable + restart don't help)
- #31588 (Bash hangs when cwd/home is on NFS)
- #41983 ("all Bash commands hang, poisoned until process restart")
None of those names the bubblewrap-recursive-bind-over-hung-mount mechanism, so filing a focused one.
Reproduction (mechanism)
- Mount a network filesystem somewhere under
/(NFS, sshfs, autofs, fuse) on the host runningclaude. - Make its backing server unreachable so the mount wedges (processes stuck in D-state;
ps -eo pid,stat,wchanshowsD+ e.g.folio_wait_bit_common). - Run any Bash tool command. It returns exit 1 with empty output (commands may actually execute — proven via file redirection — but output capture / namespace setup fails).
- Recover the mount fully (D-state cleared, mount healthy). Bash tool still fails until
claudeis restarted.
Environment
- OS: Arch Linux (kernel 6.19.x)
- Mount: NFS v4.2 over Tailscale (
soft,timeo=30,retrans=2), previously viax-systemd.automount - Bash sandbox: bubblewrap
Why current options don't help
dangerouslyDisableSandbox: trueandsandbox.enabled: falseare reported not to restore Bash on this path (#41124).- There is no documented setting to exclude a path/mount from the sandbox's mount namespace, and bubblewrap by default rec-binds the whole root, so a dead mount anywhere is swept in.
Feature request
Provide a way to keep a hung mountpoint from poisoning the Bash sandbox, e.g.:
- A
sandbox.filesystem.excludeMounts(or--tmpfs/no-recursive-bind) option so specified paths (e.g./mnt/nas) are not bound into the namespace. - Make bubblewrap namespace construction tolerant of an unreachable mountpoint (bind only needed paths instead of rec-binding
/), so one dead mount can't kill all Bash. - Self-heal the Bash subsystem after a transient namespace-setup failure, rather than staying poisoned until process restart.
Workaround (for others hitting this)
- Recover/unwedge the mount (server-side), then restart
claude— the per-command namespace is rebuilt fresh but the poisoned state persists in the running process until restart. - Prevent it: mount network FS
soft(nothard), avoidx-systemd.automount(autofs re-mount races leave half-wedged mountpoints), and keepclaude's cwd/$HOMEoff the network FS.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗