openclaw - 💡(How to fix) Fix 2026.4.24: ENOTEMPTY race on plugin-sdk during parallel plugin/channel bootstrap [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#71805Fetched 2026-04-26 05:08:02
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
closed ×1commented ×1cross-referenced ×1

On [email protected] (commit cbcfdf6), the gateway fails to fully boot because multiple bundled plugin/channel loaders race on the same shared plugin-sdk directory under ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.24-*/dist/extensions/node_modules/openclaw/plugin-sdk. One loader wins; the rest crash with ENOTEMPTY: directory not empty, rmdir '.../plugin-sdk'.

Net effect: Discord plugin fails to register, several bundled channels (matrix, twitch, zalo, qqbot) fail to load, and the WS endpoint reports unreachable (timeout) even though the systemd unit is active (running).

Error Message

[plugins] discord failed during register from /home/admin/.npm-global/lib/node_modules/openclaw/dist/extensions/discord/index.js: Error: ENOTEMPTY: directory not empty, rmdir '/home/admin/.openclaw/plugin-runtime-deps/openclaw-unknown-94d7fff93c31/dist/extensions/node_modules/openclaw/plugin-sdk' [plugins] 1 plugin(s) failed to initialize (register: discord). Run 'openclaw plugins list' for details. [channels] failed to load bundled channel matrix: ENOTEMPTY: directory not empty, rmdir '/home/admin/.openclaw/plugin-runtime-deps/openclaw-2026.4.24-4493ea0b4ae8/dist/extensions/node_modules/openclaw/plugin-sdk' [channels] failed to load bundled channel twitch: ENOTEMPTY ... plugin-sdk [channels] failed to load bundled channel zalo: ENOTEMPTY ... plugin-sdk [channels] failed to load bundled channel qqbot: ENOTEMPTY ... plugin-sdk

Root Cause

Summary

On [email protected] (commit cbcfdf6), the gateway fails to fully boot because multiple bundled plugin/channel loaders race on the same shared plugin-sdk directory under ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.24-*/dist/extensions/node_modules/openclaw/plugin-sdk. One loader wins; the rest crash with ENOTEMPTY: directory not empty, rmdir '.../plugin-sdk'.

Fix Action

Workaround

Roll back to 2026.4.14:

npm i -g [email protected]
systemctl --user daemon-reload
systemctl --user restart openclaw-gateway

Code Example

[plugins] discord failed during register from /home/admin/.npm-global/lib/node_modules/openclaw/dist/extensions/discord/index.js:
  Error: ENOTEMPTY: directory not empty, rmdir
  '/home/admin/.openclaw/plugin-runtime-deps/openclaw-unknown-94d7fff93c31/dist/extensions/node_modules/openclaw/plugin-sdk'
[plugins] 1 plugin(s) failed to initialize (register: discord). Run 'openclaw plugins list' for details.
[channels] failed to load bundled channel matrix: ENOTEMPTY: directory not empty, rmdir
  '/home/admin/.openclaw/plugin-runtime-deps/openclaw-2026.4.24-4493ea0b4ae8/dist/extensions/node_modules/openclaw/plugin-sdk'
[channels] failed to load bundled channel twitch: ENOTEMPTY ... plugin-sdk
[channels] failed to load bundled channel zalo:   ENOTEMPTY ... plugin-sdk
[channels] failed to load bundled channel qqbot:  ENOTEMPTY ... plugin-sdk

---

npm i -g openclaw@2026.4.14
systemctl --user daemon-reload
systemctl --user restart openclaw-gateway
RAW_BUFFERClick to expand / collapse

Summary

On [email protected] (commit cbcfdf6), the gateway fails to fully boot because multiple bundled plugin/channel loaders race on the same shared plugin-sdk directory under ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.24-*/dist/extensions/node_modules/openclaw/plugin-sdk. One loader wins; the rest crash with ENOTEMPTY: directory not empty, rmdir '.../plugin-sdk'.

Net effect: Discord plugin fails to register, several bundled channels (matrix, twitch, zalo, qqbot) fail to load, and the WS endpoint reports unreachable (timeout) even though the systemd unit is active (running).

Environment

  • OpenClaw: 2026.4.24 (cbcfdf6)
  • Last known-good: 2026.4.14 (323493f) — unaffected, rollback restores normal operation
  • OS: Linux 6.12.62+rpt-rpi-2712 (arm64), Raspberry Pi 5
  • Node: 22.22.2
  • Install: npm i -g openclaw into ~/.npm-global
  • Service: systemctl --user openclaw-gateway (with 20-performance.conf drop-in)

Reproduction

  1. From a working 2026.4.14 install: npm i -g [email protected]
  2. systemctl --user daemon-reload && systemctl --user restart openclaw-gateway
  3. openclaw status and inspect logs.

Observed errors

[plugins] discord failed during register from /home/admin/.npm-global/lib/node_modules/openclaw/dist/extensions/discord/index.js:
  Error: ENOTEMPTY: directory not empty, rmdir
  '/home/admin/.openclaw/plugin-runtime-deps/openclaw-unknown-94d7fff93c31/dist/extensions/node_modules/openclaw/plugin-sdk'
[plugins] 1 plugin(s) failed to initialize (register: discord). Run 'openclaw plugins list' for details.
[channels] failed to load bundled channel matrix: ENOTEMPTY: directory not empty, rmdir
  '/home/admin/.openclaw/plugin-runtime-deps/openclaw-2026.4.24-4493ea0b4ae8/dist/extensions/node_modules/openclaw/plugin-sdk'
[channels] failed to load bundled channel twitch: ENOTEMPTY ... plugin-sdk
[channels] failed to load bundled channel zalo:   ENOTEMPTY ... plugin-sdk
[channels] failed to load bundled channel qqbot:  ENOTEMPTY ... plugin-sdk

openclaw status reports:

  • Gateway: local · ws://127.0.0.1:18789 (local loopback) · unreachable (timeout)
  • Gateway service: systemd installed · enabled · running (pid …, state active)

Why it looks like a race

  • Two distinct cache prefixes are involved in the same boot: openclaw-2026.4.24-4493ea0b4ae8 (versioned) and openclaw-unknown-94d7fff93c31 (the unknown- one is suspicious in itself — looks like a loader that didn't resolve the running version).
  • All five failing loaders point at the same node_modules/openclaw/plugin-sdk path inside their respective cache root. The successful loader leaves files behind; the others attempt rmdir on a populated directory and abort.
  • Wiping ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.24-* and openclaw-unknown-* does not help — the race reproduces on the very next start with freshly-created directories. So this is not stale-cache cleanup; it's a concurrent extract-then-rmdir on a shared path.

Workaround

Roll back to 2026.4.14:

npm i -g [email protected]
systemctl --user daemon-reload
systemctl --user restart openclaw-gateway

Suggested fix directions

  • Per-plugin cache root (e.g. …/plugin-runtime-deps/<version>/<plugin-name>/…) instead of a shared plugin-sdk directory across all bundled plugins/channels.
  • Or: serialize the SDK-link step behind a mutex / lockfile so only one loader performs the rmdir+link, and the others reuse the materialized result.
  • Separately worth investigating why one of the cache roots is named openclaw-unknown-* rather than version-pinned — this suggests a code path that bootstraps without a resolved version.

Logs / artifacts

Happy to attach a full journalctl --user -u openclaw-gateway excerpt or openclaw status --deep output if useful — say the word.

extent analysis

TL;DR

The most likely fix is to implement a per-plugin cache root or serialize the SDK-link step behind a mutex to prevent concurrent access to the shared plugin-sdk directory.

Guidance

  • Investigate the code path that bootstraps without a resolved version, resulting in the openclaw-unknown-* cache root.
  • Consider implementing a mutex or lockfile to synchronize access to the plugin-sdk directory.
  • Review the plugin loading process to determine if a per-plugin cache root is feasible and would resolve the issue.
  • Verify that the issue is resolved by checking the openclaw status output and the logs for any errors related to plugin loading.

Example

No code snippet is provided as the issue requires a high-level fix, such as modifying the plugin loading process or implementing synchronization mechanisms.

Notes

The issue is specific to the 2026.4.24 version of OpenClaw, and rolling back to 2026.4.14 is a known workaround. The root cause is related to concurrent access to the shared plugin-sdk directory.

Recommendation

Apply a workaround by rolling back to 2026.4.14 until a permanent fix is implemented, as the issue is specific to the 2026.4.24 version and the rollback is a known solution.

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 2026.4.24: ENOTEMPTY race on plugin-sdk during parallel plugin/channel bootstrap [1 comments, 2 participants]