Repository navigation
Description
Problem
OpenClaw's plugin install validator in install-safe-path.ts rejects symlinks as install bases:
const baseLstat = await fs.lstat(baseDir);
if (!baseLstat.isDirectory() || baseLstat.isSymbolicLink()) {
throw new Error(`Invalid ${params.boundaryLabel}: base directory must be a real directory`);
}NemoClaw's sandbox layout establishes ~/.openclaw/extensions as a symlink to /sandbox/.openclaw-data/extensions so installed plugins survive sandbox recreation (see NemoClaw/Dockerfile.base line 113). This is structurally incompatible with OpenClaw's validator.
Result: openclaw plugins install <anything> fails inside the sandbox with Invalid extensions directory: base directory must be a real directory. Tracked in NemoClaw as:
- NemoClaw #2203 — original bug report, root-cause analysis
- NemoClaw #2254 — follow-up failure (EACCES writing
openclaw.jsonafter earlier steps pass) - NemoClaw PR #2295 — initial attempted fix; does not resolve root cause (see review comment)
Proposed fix
Provision ~/.openclaw/extensions as a separately-mounted persistent volume at the pod-spec level, rather than as an intra-container symlink pointing to .openclaw-data/extensions.
- Inside the container the path is a real directory — passes OpenClaw's validator.
- Plugin persistence preserved (volume survives sandbox recreation).
- No
CAP_SYS_ADMINneeded in-container — mount is established by the orchestrator before the container starts. - Decouples the extensions persistence layer from OpenClaw's internal validation semantics; future OpenClaw validator changes won't re-break plugin install.
Alternatives considered
- Intra-container bind mount. Needs
CAP_SYS_ADMINin the sandbox, which Docker's default capability set omits and granting would significantly expand the sandbox's privilege surface. Not preferred. - NemoClaw-side patch of compiled OpenClaw dist (swap
fs.lstat→fs.statininstall-safe-path.js). Works as a short-term bridge but requires re-verification on every OpenClaw version bump and weakens a (defense-in-depth) TOCTOU check. - Upstream OpenClaw PR to accept symlinks-to-real-directories. Cleanest long-term but slowest, and unclear OpenClaw maintainers would accept the relaxation.
Suggested coordination
If pod-spec persistent-volume provisioning is feasible, NemoClaw would:
- Stop creating the
.openclaw-data/extensions→~/.openclaw/extensionssymlink inDockerfile.base. - Rely on the OpenShell-provisioned mount to place the persistent directory at
~/.openclaw/extensionsdirectly.
Happy to collaborate on the transition plan — migration path for existing sandboxes, volume naming, whether this is a one-off for extensions or a broader template for other persistent paths under ~/.openclaw/.
Activity
johntmyers commentedon Apr 22, 2026
@prekshivyas what specific change are you asking for in OpenShell? Making a pod-spec pv isn't feasible here as that will be a specific deployment mode that isn't always used. We'll be deprecating K3s + Docker so you have to assume that k8s API is not always available.
prekshivyas commentedon Apr 22, 2026
Thanks for the information.
Closing this as out-of-scope for OpenShell. The realistic fixes are both NemoClaw/OpenClaw-side: patching NemoClaw's build to rewrite
install-safe-path.js(same pattern as the existing fetch-guard and exec-approvals patches in the Dockerfile), or upstreaming a fix to OpenClaw itself. Moving the conversation back to NemoClaw #2203 / #2295.fix: remove incorrect extensions symlink from Dockerfile
feat(cli): add `share mount/unmount/status` for SSHFS-based file shar…