openclaw - 💡(How to fix) Fix openclaw plugins install <path> rejects valid plugin paths with cryptic error; correct install path nowhere documented [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#72946Fetched 2026-04-28 06:29:45
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Participants
Timeline (top)
closed ×1commented ×1cross-referenced ×1

In plain English: openclaw plugins install <path> rejects valid plugin paths with the error "Invalid path: must stay within extensions directory" — but it never tells you where that directory is. Users hit this trying to install a plugin from a build-output dir; the error gives no actionable guidance and the secondary "hook pack" error muddies the diagnosis further. Workaround: skip the CLI and cp -a the plugin directly into /sandbox/.openclaw-data/extensions/<plugin-id> — auto-discovery picks it up at next gateway start.

Error Message

Invalid path: must stay within extensions directory Also not a valid hook pack: Error: package.json missing openclaw.hooks

Root Cause

openclaw plugins install <path> requires the source path to already be located under the configured extensions directory (in NemoClaw, that's /sandbox/.openclaw-data/extensions/, symlinked from /sandbox/.openclaw/extensions). The error message names "extensions directory" but doesn't print the path the CLI is checking against, doesn't say the contract is "must already be there before install can run", and doesn't say the install is essentially a registration step rather than a copy step.

The secondary "hook pack" error is a fallback attempt that fires when the plugins install path doesn't recognize the directory shape. It compounds the confusion because users see two errors and don't know which is the actual reason for the failure.

Fix Action

Fix / Workaround

In plain English: openclaw plugins install <path> rejects valid plugin paths with the error "Invalid path: must stay within extensions directory" — but it never tells you where that directory is. Users hit this trying to install a plugin from a build-output dir; the error gives no actionable guidance and the secondary "hook pack" error muddies the diagnosis further. Workaround: skip the CLI and cp -a the plugin directly into /sandbox/.openclaw-data/extensions/<plugin-id> — auto-discovery picks it up at next gateway start.

Workaround we use

Code Example

# In a NemoClaw sandbox image build (Dockerfile step):
RUN openclaw plugins install /opt/openclaw-deep-observability

---

Invalid path: must stay within extensions directory
Also not a valid hook pack: Error: package.json missing openclaw.hooks

---

cp -a /opt/openclaw-deep-observability /sandbox/.openclaw-data/extensions/openclaw-deep-observability

---

-Invalid path: must stay within extensions directory
+Invalid path: source must already be located under the extensions directory
+(currently /sandbox/.openclaw-data/extensions/). To install from a source
+outside this directory, copy the plugin into place first:
+    cp -a <source> /sandbox/.openclaw-data/extensions/<plugin-id>
RAW_BUFFERClick to expand / collapse

Summary

In plain English: openclaw plugins install <path> rejects valid plugin paths with the error "Invalid path: must stay within extensions directory" — but it never tells you where that directory is. Users hit this trying to install a plugin from a build-output dir; the error gives no actionable guidance and the secondary "hook pack" error muddies the diagnosis further. Workaround: skip the CLI and cp -a the plugin directly into /sandbox/.openclaw-data/extensions/<plugin-id> — auto-discovery picks it up at next gateway start.

Repro

# In a NemoClaw sandbox image build (Dockerfile step):
RUN openclaw plugins install /opt/openclaw-deep-observability

Output:

Invalid path: must stay within extensions directory
Also not a valid hook pack: Error: package.json missing openclaw.hooks

Exit 1.

The plugin tree at /opt/openclaw-deep-observability/ is a perfectly valid OpenClaw plugin (built dist/, package.json with openclaw.plugin block, etc.). The CLI rejects it because the source path isn't already located under the extensions directory.

Root cause

openclaw plugins install <path> requires the source path to already be located under the configured extensions directory (in NemoClaw, that's /sandbox/.openclaw-data/extensions/, symlinked from /sandbox/.openclaw/extensions). The error message names "extensions directory" but doesn't print the path the CLI is checking against, doesn't say the contract is "must already be there before install can run", and doesn't say the install is essentially a registration step rather than a copy step.

The secondary "hook pack" error is a fallback attempt that fires when the plugins install path doesn't recognize the directory shape. It compounds the confusion because users see two errors and don't know which is the actual reason for the failure.

Workaround we use

Skip openclaw plugins install entirely. cp -a the plugin tree into the extensions directory; the gateway auto-discovers it at startup:

cp -a /opt/openclaw-deep-observability /sandbox/.openclaw-data/extensions/openclaw-deep-observability

After the cp, openclaw plugins list shows the plugin discovered with all hooks registered.

Suggested fix (in priority order)

1. Print the expected path in the error message

-Invalid path: must stay within extensions directory
+Invalid path: source must already be located under the extensions directory
+(currently /sandbox/.openclaw-data/extensions/). To install from a source
+outside this directory, copy the plugin into place first:
+    cp -a <source> /sandbox/.openclaw-data/extensions/<plugin-id>

This alone removes 90% of the confusion. Users get an immediately actionable hint.

2. Drop the secondary "hook pack" error when "Invalid path" already fired

The second error is misleading — users assume the plugin IS broken, when actually the plugins-install CLI just rejected the path before it could examine the plugin contents.

3. Make plugins install <path> accept any path and copy/link automatically

The friendlier behavior: detect that <path> is a valid plugin (has package.json + openclaw.plugin.json or openclaw.hooks block), and copy/link it into the extensions directory automatically. This matches what users expect from pip install <path>, npm install <path>, etc.

If a copy is undesirable (read-only build context, etc.), an --in-place=copy|link|register-only flag would let the user pick.

Alternatives considered

  • Document the contract loudly in the CLI help: lower bar than fixing the error, but openclaw plugins install --help is short and doesn't include this gotcha. A docs fix alone would be insufficient given how many users hit this.

Test plan

After fix lands:

  • openclaw plugins install /tmp/path/outside-extensions should either succeed (option 3) or fail with a clear error pointing at the right copy command (option 1).
  • openclaw plugins install /sandbox/.openclaw-data/extensions/<existing-plugin> should still work as today.

Risk / blast radius

  • Option 1 (better error message): zero risk.
  • Option 2 (drop secondary error): zero risk.
  • Option 3 (auto-copy): bigger change. Risk of accidentally writing to a system path. Mitigated by limiting destination to the extensions directory (already enforced).

Open questions for maintainers

  1. Is the "must stay within extensions directory" constraint a security one (preventing arbitrary-path symlink attacks), or just an artifact of the registration-vs-copy split? The answer affects which fix path to take.
  2. The auto-discovery from extensions/ already works without plugins install. What's the intended use case for plugins install once the plugin's already in extensions? (Worth clarifying in docs regardless of fix path.)

Tested-against

  • OpenClaw v2026.4.9
  • NemoClaw v0.0.26 (sandbox provider — extensions path is /sandbox/.openclaw-data/extensions/)

Severity

Medium-high. Anyone trying to install an OpenClaw plugin via the CLI for the first time hits this; the error doesn't lead anywhere productive without source-diving into the openclaw npm package.

extent analysis

TL;DR

The most likely fix is to enhance the error message of openclaw plugins install to include the expected path, allowing users to understand and correct their plugin installation attempts.

Guidance

  • Enhance the error message: Modify the error message to include the expected path, as suggested in the issue, to provide users with actionable feedback.
  • Verify the fix: Test the updated openclaw plugins install command with a plugin path outside the extensions directory to ensure it produces a clear and helpful error message.
  • Consider dropping the secondary "hook pack" error: If the "Invalid path" error is enhanced, the secondary error may become redundant and could be removed to avoid confusion.
  • Evaluate the feasibility of auto-copying plugins: Assess the security implications and user expectations of automatically copying or linking plugins into the extensions directory when using openclaw plugins install.

Example

-Invalid path: must stay within extensions directory
+Invalid path: source must already be located under the extensions directory
+(currently /sandbox/.openclaw-data/extensions/). To install from a source
+outside this directory, copy the plugin into place first:
+    cp -a <source> /sandbox/.openclaw-data/extensions/<plugin-id>

Notes

The provided suggestions focus on enhancing user feedback and experience. Further changes, such as auto-copying plugins, require careful consideration of security and usability implications.

Recommendation

Apply the workaround of manually copying the plugin into the extensions directory, as described in the issue, until a more permanent fix is implemented. This approach ensures that plugins can be installed and used without relying on the openclaw plugins install command.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix openclaw plugins install <path> rejects valid plugin paths with cryptic error; correct install path nowhere documented [1 comments, 2 participants]