openclaw - 💡(How to fix) Fix [Bug]: system npm upgrade can leave running gateway in transient half-swapped package/plugin state [1 pull requests]

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…

During a live Linux system-global upgrade from 2026.5.16-beta.3 to 2026.5.18, the running gateway briefly loaded a half-swapped package/plugin state and logged missing bundled modules, including @openclaw/codex missing ./string-coerce-LndEvhRk.js.

Error Message

During the following system npm install window

May 18 19:39:34 polymarket-mc node[1178137]: [plugins] codex failed to load from /home/ubuntu/.openclaw/npm/node_modules/@openclaw/codex/dist/index.js: Error: Cannot find module './string-coerce-LndEvhRk.js' May 18 19:39:34 polymarket-mc node[1178137]: [plugins] 1 plugin(s) failed to initialize (load: codex). Run 'openclaw plugins list' for details. May 18 19:39:34 polymarket-mc node[1178137]: [gateway] [plugins] failed to load plugin: Error: Cannot find module './string-coerce-LndEvhRk.js' May 18 19:39:34 polymarket-mc node[1178137]: [ws] failed to load ws message handler conn=11815436-d88e-452a-b82d-9728df47c114: Cannot find module '/usr/lib/node_modules/openclaw/dist/message-handler-D5F65c4n.js' imported from /usr/lib/node_modules/openclaw/dist/server-ws-runtime-DPe-iy_y.js May 18 19:39:34 polymarket-mc node[1178137]: [openclaw] The CLI command failed. May 18 19:39:34 polymarket-mc systemd[1245]: openclaw-gateway.service: Failed with result 'exit-code'. May 18 19:39:40 polymarket-mc node[1178688]: Error: Cannot find module '/usr/lib/node_modules/openclaw/dist/index.js' May 18 19:39:40 polymarket-mc systemd[1245]: openclaw-gateway.service: Failed with result 'exit-code'.

Root Cause

During a live Linux system-global upgrade from 2026.5.16-beta.3 to 2026.5.18, the running gateway briefly loaded a half-swapped package/plugin state and logged missing bundled modules, including @openclaw/codex missing ./string-coerce-LndEvhRk.js.

Fix Action

Fixed

Code Example

node=v22.22.0
npm=10.9.4
npm root -g=/usr/lib/node_modules
install root=/usr/lib/node_modules/openclaw
service=/home/ubuntu/.config/systemd/user/openclaw-gateway.service
ExecStart=/usr/bin/node /usr/lib/node_modules/openclaw/dist/index.js gateway --port 18789

---

source=/home/ubuntu/.openclaw/npm/node_modules/@openclaw/codex/dist/index.js
rootDir=/home/ubuntu/.openclaw/npm/node_modules/@openclaw/codex
version=2026.5.6
status=loaded
dependencyStatus.requiredInstalled=true

---

# Initial OpenClaw updater attempt as the gateway user
Updating OpenClaw...

Stopping managed gateway service before package update...
Stopped systemd service: openclaw-gateway.service

Update Result: ERROR
  Root: /usr/lib/node_modules/openclaw
  Reason: global install stage
  Before: 2026.5.16-beta.3
  After: 2026.5.16-beta.3

Steps:
  ✗ global install stage (0ms)
      EACCES: permission denied, mkdtemp '/usr/lib/node_modules/.openclaw-update-stage-S61KvY'

Recovery hints:
  - Detected permission failure (EACCES). Re-run with a writable global prefix or sudo (for system-managed Node installs).
  - Example: npm config set prefix ~/.local && npm i -g openclaw@latest

Restarted systemd service: openclaw-gateway.service
Restarted managed gateway service after failed update.

---

# During the following system npm install window
May 18 19:39:34 polymarket-mc node[1178137]: [plugins] codex failed to load from /home/ubuntu/.openclaw/npm/node_modules/@openclaw/codex/dist/index.js: Error: Cannot find module './string-coerce-LndEvhRk.js'
May 18 19:39:34 polymarket-mc node[1178137]: [plugins] 1 plugin(s) failed to initialize (load: codex). Run 'openclaw plugins list' for details.
May 18 19:39:34 polymarket-mc node[1178137]: [gateway] [plugins] failed to load plugin: Error: Cannot find module './string-coerce-LndEvhRk.js'
May 18 19:39:34 polymarket-mc node[1178137]: [ws] failed to load ws message handler conn=11815436-d88e-452a-b82d-9728df47c114: Cannot find module '/usr/lib/node_modules/openclaw/dist/message-handler-D5F65c4n.js' imported from /usr/lib/node_modules/openclaw/dist/server-ws-runtime-DPe-iy_y.js
May 18 19:39:34 polymarket-mc node[1178137]: [openclaw] The CLI command failed.
May 18 19:39:34 polymarket-mc systemd[1245]: openclaw-gateway.service: Failed with result 'exit-code'.
May 18 19:39:40 polymarket-mc node[1178688]: Error: Cannot find module '/usr/lib/node_modules/openclaw/dist/index.js'
May 18 19:39:40 polymarket-mc systemd[1245]: openclaw-gateway.service: Failed with result 'exit-code'.

---

# Recovery evidence after completed install + doctor --fix + restart
OpenClaw 2026.5.18 (50a2481)
/usr/bin/openclaw -> /usr/lib/node_modules/openclaw/openclaw.mjs
package_root=/usr/lib/node_modules/openclaw
readyz={"ready":true,"failing":[]}
plugins list: count=92, enabled=11, errors=[]
openclaw doctor --deep --lint --json: findingCount=0
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

During a live Linux system-global upgrade from 2026.5.16-beta.3 to 2026.5.18, the running gateway briefly loaded a half-swapped package/plugin state and logged missing bundled modules, including @openclaw/codex missing ./string-coerce-LndEvhRk.js.

Steps to reproduce

  1. Start from a root-owned system-global npm install where the user gateway service runs from /usr/lib/node_modules/openclaw.
  2. Run openclaw update --channel stable --yes as the non-root gateway user.
  3. Observe the update fail at the global install stage with EACCES, then restart the existing gateway.
  4. Run the documented/manual system package recovery path with the system npm binary: sudo -n /usr/bin/npm install -g openclaw@latest while the gateway service is still running.
  5. Observe the gateway logs during the npm package replacement window.
  6. Complete the install, run HOME=/home/ubuntu openclaw gateway install --force, restart the gateway, and observe that the missing-module condition clears.

Expected behavior

The update/recovery path should not leave the running gateway loading from a package tree while npm is replacing bundled files.

For a system-global install requiring sudo, OpenClaw should either keep the gateway stopped through the package replacement, fail closed with an explicit instruction to stop the gateway before manual npm install, or otherwise avoid transient plugin/core module resolution failures during package replacement.

Actual behavior

The gateway attempted to continue loading runtime/plugin code during the package replacement window and logged missing modules from both the user-managed plugin tree and the global core dist tree.

After the install completed, openclaw doctor --fix, plugin registry refresh, and a clean gateway restart cleared the condition. The failure was transient rather than persistent.

OpenClaw version

Upgrade path: OpenClaw 2026.5.16-beta.3 (d08cbf7) -> OpenClaw 2026.5.18 (50a2481)

Operating system

Ubuntu 24.04.3 LTS, Linux 6.17.0-1011-oracle, aarch64

Install method

System-global npm install, root-owned prefix:

node=v22.22.0
npm=10.9.4
npm root -g=/usr/lib/node_modules
install root=/usr/lib/node_modules/openclaw
service=/home/ubuntu/.config/systemd/user/openclaw-gateway.service
ExecStart=/usr/bin/node /usr/lib/node_modules/openclaw/dist/index.js gateway --port 18789

Model

openai/gpt-5.5

Provider / routing chain

OpenClaw gateway -> OpenAI Codex/ChatGPT auth, effective Codex harness for agent turns.

Additional provider/model setup details

Enabled plugins after recovery: active-memory, anthropic, file-transfer, google, memory-core, memory-wiki, ollama, openai, telegram, tokenjuice, codex.

codex plugin after recovery:

source=/home/ubuntu/.openclaw/npm/node_modules/@openclaw/codex/dist/index.js
rootDir=/home/ubuntu/.openclaw/npm/node_modules/@openclaw/codex
version=2026.5.6
status=loaded
dependencyStatus.requiredInstalled=true

Logs, screenshots, and evidence

# Initial OpenClaw updater attempt as the gateway user
Updating OpenClaw...

Stopping managed gateway service before package update...
Stopped systemd service: openclaw-gateway.service

Update Result: ERROR
  Root: /usr/lib/node_modules/openclaw
  Reason: global install stage
  Before: 2026.5.16-beta.3
  After: 2026.5.16-beta.3

Steps:
  ✗ global install stage (0ms)
      EACCES: permission denied, mkdtemp '/usr/lib/node_modules/.openclaw-update-stage-S61KvY'

Recovery hints:
  - Detected permission failure (EACCES). Re-run with a writable global prefix or sudo (for system-managed Node installs).
  - Example: npm config set prefix ~/.local && npm i -g openclaw@latest

Restarted systemd service: openclaw-gateway.service
Restarted managed gateway service after failed update.
# During the following system npm install window
May 18 19:39:34 polymarket-mc node[1178137]: [plugins] codex failed to load from /home/ubuntu/.openclaw/npm/node_modules/@openclaw/codex/dist/index.js: Error: Cannot find module './string-coerce-LndEvhRk.js'
May 18 19:39:34 polymarket-mc node[1178137]: [plugins] 1 plugin(s) failed to initialize (load: codex). Run 'openclaw plugins list' for details.
May 18 19:39:34 polymarket-mc node[1178137]: [gateway] [plugins] failed to load plugin: Error: Cannot find module './string-coerce-LndEvhRk.js'
May 18 19:39:34 polymarket-mc node[1178137]: [ws] failed to load ws message handler conn=11815436-d88e-452a-b82d-9728df47c114: Cannot find module '/usr/lib/node_modules/openclaw/dist/message-handler-D5F65c4n.js' imported from /usr/lib/node_modules/openclaw/dist/server-ws-runtime-DPe-iy_y.js
May 18 19:39:34 polymarket-mc node[1178137]: [openclaw] The CLI command failed.
May 18 19:39:34 polymarket-mc systemd[1245]: openclaw-gateway.service: Failed with result 'exit-code'.
May 18 19:39:40 polymarket-mc node[1178688]: Error: Cannot find module '/usr/lib/node_modules/openclaw/dist/index.js'
May 18 19:39:40 polymarket-mc systemd[1245]: openclaw-gateway.service: Failed with result 'exit-code'.
# Recovery evidence after completed install + doctor --fix + restart
OpenClaw 2026.5.18 (50a2481)
/usr/bin/openclaw -> /usr/lib/node_modules/openclaw/openclaw.mjs
package_root=/usr/lib/node_modules/openclaw
readyz={"ready":true,"failing":[]}
plugins list: count=92, enabled=11, errors=[]
openclaw doctor --deep --lint --json: findingCount=0

Impact and severity

Affected: Linux/systemd users on root-owned system-global npm installs who recover from updater EACCES using manual sudo npm install -g openclaw@latest while the gateway is running.

Severity: Medium. This creates a transient gateway outage and confusing plugin/core missing-module diagnostics during the upgrade window.

Frequency: Observed once on a live VPS during 2026.5.16-beta.3 -> 2026.5.18. NOT_ENOUGH_INFO for broader reproducibility.

Consequence: Gateway can crash/restart during upgrade and report plugin failures that are not persistent after the install finishes.

Additional information

This did not reproduce as a persistent @openclaw/codex install failure. After the completed install, doctor --fix, plugin registry refresh, and clean restart, codex loaded successfully and plugin list reported zero errors.

This may be adjacent to older upgrade/cutover state issues such as #76865 and plugin sync reports such as #78892, but the observed symptom here was a transient half-swapped package state during manual system npm recovery after an updater EACCES.

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…

FAQ

Expected behavior

The update/recovery path should not leave the running gateway loading from a package tree while npm is replacing bundled files.

For a system-global install requiring sudo, OpenClaw should either keep the gateway stopped through the package replacement, fail closed with an explicit instruction to stop the gateway before manual npm install, or otherwise avoid transient plugin/core module resolution failures during package replacement.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING