can1357/oh-my-pi · error
Failed to mount ${target}${suffix}
Error message
Failed to mount ${target}${suffix} What it means
mountRemote runs `sshfs <args> <target> <mountPath>` and throws this error when sshfs exits non-zero, appending sshfs's stderr. The failure is in the sshfs tool itself — which wraps both SSH connectivity and FUSE mounting — so causes range from auth/network issues to missing FUSE support.
Source
Thrown at packages/coding-agent/src/ssh/sshfs-mount.ts:136
await Promise.all([ensureDir(REMOTE_DIR), ensureDir(mountPath)]);
if (await isMounted(mountPath)) {
if (!registered) {
registered = true;
postmortem.register("sshfs-cleanup", unmountAll);
}
mountedPaths.add(mountPath);
return mountPath;
}
const target = `${buildSshTarget(host.username, host.host)}:${remotePath}`;
const args = buildSshfsArgs(host);
const result = await $`sshfs ${args} ${target} ${mountPath}`.nothrow();
if (result.exitCode !== 0) {
const detail = result.stderr.toString().trim();
const suffix = detail ? `: ${detail}` : "";
throw new Error(`Failed to mount ${target}${suffix}`);
}
mountedPaths.add(mountPath);
return mountPath;
}
export async function unmountRemote(host: SSHConnectionTarget): Promise<boolean> {
const mountPath = getMountPath(host);
if (!(await isMounted(mountPath))) {
mountedPaths.delete(mountPath);
return false;
}
const success = await unmountPath(mountPath);
if (success) {
mountedPaths.delete(mountPath);
}
View on GitHub (pinned to 9690622007)
Solutions
- Read the appended stderr detail for the specific sshfs cause
- Install FUSE support: Linux `apt install sshfs fuse3`; macOS install macFUSE; containers need --device /dev/fuse --cap-add SYS_ADMIN (or fusermount3 setup)
- Verify plain `ssh <target>` works first; fix auth/host issues before mounting
- Unmount stale mounts: fusermount -u <mountPath> and retry
- Ensure the mount point exists and is empty
Example fix
# before (in container) $ omp ssh mount prod:/data /mnt/data # Failed to mount: fuse device not found # after $ docker run --device /dev/fuse --cap-add SYS_ADMIN ... $ sudo apt-get install -y sshfs fuse3 $ omp ssh mount prod:/data /mnt/data
Defensive patterns
Strategy: validation
Validate before calling
import { $ } from "bun";
// preflight: sshfs present, FUSE device available, target reachable
const hasSshfs = await $`which sshfs`.quiet().nothrow();
const fuseDev = await fs.stat("/dev/fuse").catch(() => null);
if (hasSshfs.exitCode !== 0 || !fuseDev) throw new Error("sshfs/FUSE unavailable: install sshfs + fuse3 (container: --device /dev/fuse)"); Try / catch
try {
const mp = await mountRemote(host);
} catch (err) {
if (err instanceof Error && err.message.startsWith("Failed to mount ")) {
const detail = err.message.split(": ").slice(1).join(": ");
if (/fusermount|fuse/i.test(detail)) console.error("FUSE not available — run privileged or install fuse3");
if (/Permission denied|publickey/i.test(detail)) console.error("Fix ssh auth before mounting");
await $`fusermount -u ${mountPath}`.quiet().nothrow(); // clear stale mount
}
throw err;
} Prevention
- Install sshfs + fuse3 on hosts that mount; macFUSE on macOS
- Grant containers /dev/fuse and SYS_ADMIN (or use unprivileged user namespaces)
- Verify `ssh <target> true` before mounting
- fusermount -u stale mount points before remounting
When it happens
Trigger: sshfs not installed or lacking setuid/fusermount permissions, mount point already in use or nonempty, remote auth failure, OS without /dev/fuse (containers without --privileged/--device /dev/fuse).
Common situations: Running inside a Docker container/CI without FUSE access, macOS without macFUSE installed, remote host unreachable or key rejected, stale mount at the target path, sshfs not installed at all.
Related errors
- SSH control directory ${dir} ${isSymlink ? "is a symlink" :
- SSH control directory ${dir} ${reason}
- SSH key is not a file: ${keyPath}
- SSH key permissions must be 600 or stricter: ${keyPath}
- unknown filetype: {ft_debug}
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/00eba60d930befd5.
Report an issue: GitHub.