openclaw - 💡(How to fix) Fix Gateway blocks HTTP server startup while reinstalling 63 bundled runtime deps on every restart [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#73055Fetched 2026-04-28 06:28:07
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
closed ×1commented ×1

Error Message

2026-04-27T21:32:38.931+00:00 [gateway] starting...
2026-04-27T21:33:07.665+00:00 [plugins] acpx staging bundled runtime deps (1 missing, 62 install specs)
2026-04-27T21:37:10.468+00:00 [gateway] starting HTTP server...

Total startup delay: ~4.5 minutes from 'starting' to HTTP server binding.

Root Cause

OpenClaw uses a bundled runtime deps system at plugin-runtime-deps/openclaw-{version}-{hash}/. On every restart after a crash, the gateway:

  1. Finds 62-63 missing package specs
  2. Runs npm install for each one sequentially
  3. Only after ALL installs complete does it bind the HTTP server

Each package install takes ~15-20 seconds, totaling ~5 minutes of blocking time.

Code Example

2026-04-27T21:32:38.931+00:00 [gateway] starting...
2026-04-27T21:33:07.665+00:00 [plugins] acpx staging bundled runtime deps (1 missing, 62 install specs)
2026-04-27T21:37:10.468+00:00 [gateway] starting HTTP server...
RAW_BUFFERClick to expand / collapse

Problem

When the OpenClaw gateway crashes or is restarted, it spends ~5 minutes reinstalling 63 bundled runtime dependency packages before the HTTP server becomes available on /health.

This causes:

  • Gateway health checks timeout for ~5 minutes post-restart
  • Channels (Telegram etc.) fail to initialize during this window
  • Confusing to debug — looks like the gateway is hung when it is actually just installing packages

Root Cause

OpenClaw uses a bundled runtime deps system at plugin-runtime-deps/openclaw-{version}-{hash}/. On every restart after a crash, the gateway:

  1. Finds 62-63 missing package specs
  2. Runs npm install for each one sequentially
  3. Only after ALL installs complete does it bind the HTTP server

Each package install takes ~15-20 seconds, totaling ~5 minutes of blocking time.

Expected Behavior

The HTTP server should bind and respond to /health within seconds of startup, regardless of bundled runtime deps status. Runtime dep installation should happen in the background or be cached incrementally.

Logs

2026-04-27T21:32:38.931+00:00 [gateway] starting...
2026-04-27T21:33:07.665+00:00 [plugins] acpx staging bundled runtime deps (1 missing, 62 install specs)
2026-04-27T21:37:10.468+00:00 [gateway] starting HTTP server...

Total startup delay: ~4.5 minutes from 'starting' to HTTP server binding.

Suggested Fixes

  1. Background install: Run bundled runtime dep installation in background, not blocking the main event loop
  2. Incremental cache: Only install packages that actually changed between restarts, not all 63 every time
  3. Early HTTP bind: Bind the HTTP server port early, return 503 or 'starting' status until ready
  4. Startup grace period: Health monitor should consider gateway 'starting' not 'failed' during this window

Environment

  • OpenClaw version: 2026.4.14
  • Node.js: v22.22.2
  • OS: Ubuntu 24.04
  • Memory: 4GB RAM

extent analysis

TL;DR

Implementing a background installation of bundled runtime dependencies or an incremental cache can significantly reduce the startup delay of the OpenClaw gateway.

Guidance

  • Consider implementing a background install mechanism to run bundled runtime dep installation without blocking the main event loop, allowing the HTTP server to start sooner.
  • Explore incremental cache approaches to only install packages that have changed between restarts, reducing the number of installations required.
  • Evaluate the feasibility of early HTTP bind, where the server binds early and returns a 503 status or a 'starting' message until all dependencies are installed and the server is fully ready.
  • Review the startup grace period concept for the health monitor to avoid marking the gateway as 'failed' during the initial startup delay.

Example

No specific code example is provided due to the lack of detailed implementation details in the issue description. However, the concept would involve modifying the startup script or the dependency installation process to run in parallel with the HTTP server initialization.

Notes

The effectiveness of these suggestions may depend on the specific implementation details of the OpenClaw gateway and its dependency management system. Testing and validation would be necessary to ensure that any changes do not introduce new issues or affect the stability of the gateway.

Recommendation

Apply a background install workaround to immediately address the startup delay issue, as it seems to be the most direct approach to prevent the blocking installation of dependencies from delaying the HTTP server startup.

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 Gateway blocks HTTP server startup while reinstalling 63 bundled runtime deps on every restart [1 comments, 2 participants]