Skip to content

OpenClaw Gateway "Maximum Call Stack Size Exceeded"? Here Is the Fix

The RangeError: Maximum call stack size exceeded crash in the OpenClaw Gateway has three known causes: a config recursion bug around disabled plugins, version-specific schema compilation bugs, and oversized session payloads. This guide walks through each fix with exact commands.

You start the OpenClaw Gateway, or send a message through the Control UI, and instead of an agent reply you get a wall of red text ending in RangeError: Maximum call stack size exceeded. Sometimes the gateway crashes on boot, sometimes every plugin fails to load, and sometimes a single message silently disappears. The error looks scary, but it maps to a short list of known causes, and all of them are fixable without reinstalling from scratch.

RangeError: Maximum call stack size exceeded

This is a Node.js (V8) error, not an OpenClaw-specific one. It means a function kept calling itself, or a chain of functions kept calling each other, until the JavaScript call stack ran out of room. It is a recursion problem, not a memory or RAM problem. In OpenClaw, three triggers account for nearly every report:

  1. Config recursion: a plugin listed in plugins.entries with enabled: false that is also missing from plugins.allow makes the gateway emit a config warning, which reloads the config, which emits the warning again, forever.
  2. Version-specific bugs: certain releases shipped schema compilation bugs that overflow the stack while loading plugins or building validators. The v2026.4.5 release, for example, broke plugin loading on Windows with Node 24.
  3. Oversized session payloads: sending a large image attachment (roughly 4 MB and up) through the Control UI webchat, or sending anything when a session is near its context limit, can crash the send path with the same error.

Match your symptom to the trigger: crash on gateway start or plugin load points to causes 1 or 2; crash when sending a specific message points to cause 3.

Fix 1: Update to the Latest Stable Release (or Pin a Known-Good One)

Because several of these crashes were straight-up bugs, the first move is always to get off the affected build.

  1. Check what you are running: openclaw --version.
  2. Update through the built-in updater: openclaw update --channel stable. If you installed via npm, you can also run npm install -g openclaw@latest.
  3. If the latest release is itself the broken one (this happened with v2026.4.5, where a schema library bug crashed all plugin loading), pin the previous stable instead: npm install -g openclaw@2026.4.2 or whichever version last worked for you.
  4. Restart the gateway: openclaw gateway restart, then confirm with openclaw gateway status.

One caution: on the affected builds, openclaw doctor --fix can hit the exact same stack overflow while probing plugins, so automated repair fails too. Update the binary first, then run doctor.

Fix 2: Remove the Disabled-Plugin Config Recursion Trap

If the gateway crashes on startup and your logs show a config warning repeating right before the RangeError, you are almost certainly hitting the infinite recursion bug around disabled plugins.

  1. Find your config file: openclaw config file prints the active path (default is ~/.openclaw/openclaw.json).
  2. Open it in any editor and look at the plugins section.
  3. Find any entry in plugins.entries that has enabled: false but does not appear in the plugins.allow list.
  4. Either delete that entry entirely (if you no longer use the plugin) or add its id to plugins.allow so the warning never fires.
  5. Validate the result: openclaw config validate.
  6. Restart: openclaw gateway restart.

This bug was reported on 2026.3.28 builds, but the safe pattern is worth keeping regardless: do not leave half-removed plugin entries sitting in the config.

Fix 3: Reset the Session That Triggers the Crash

If the gateway itself runs fine but a specific message blows up, the problem is the payload or the session state, not the install.

  1. Start a fresh session instead of retrying in the crashed one. In chat, send /new to reset the conversation context.
  2. If the crash happened while sending an image, resize or compress it first. Reports show PNG and JPEG attachments around 4 MB reliably trigger the error in the webchat, while smaller files go through.
  3. If a long-running session was near its context limit, compact it or start over rather than pushing one more large message into it.
  4. Retry the message in the fresh session and watch openclaw logs --follow to confirm it goes through cleanly.

Per-OS Notes

Windows

The v2026.4.5 plugin-loading crash was reported on Windows 11 with Node 24.x, so Windows users saw this error most often. Roll forward to the current stable or pin v2026.4.2. Run openclaw gateway run in a terminal (instead of the background service) to see the full stack trace while you test.

macOS

The config recursion bug was first reported on macOS arm64 beta builds. If you run the dev or beta channel on a Mac, check the plugins section of your config before anything else, and consider switching back with openclaw update --channel stable.

Linux and VPS

The same fixes apply. Also confirm your Node version meets the requirement (Node 22.19+, 23.11+, or 24+), since mixing an old system Node with a new OpenClaw build produces strange loader behavior. node --version tells you in one second.

Frequently Asked Questions

Is "Maximum call stack size exceeded" a memory problem?

No. It is a recursion problem: code calling itself until the call stack overflows. Adding RAM or raising Node's heap size will not help. The fix is always to break the recursion, which in OpenClaw's case means updating past the buggy release, fixing the plugin config entry, or shrinking the payload that triggers it.

Will deleting the .openclaw folder fix the error?

It usually will, but it is the nuclear option: you lose your config, sessions, and pairing state. Try the targeted fixes first. If you do reset, back up ~/.openclaw/openclaw.json before deleting anything so you can restore your settings selectively.

Which OpenClaw versions are affected by this bug?

It is not one bug but a family. Known offenders include 2026.3.28 beta builds (config warning recursion) and v2026.4.5 (plugin loading crash with Node 24). The pattern to remember: check the GitHub issues for your exact version, and treat the latest stable release as the default fix.

If you would rather not track which OpenClaw release is safe this week, a managed OpenClaw host applies vetted updates and keeps a valid config for you.

Frequently asked questions

Is "Maximum call stack size exceeded" a memory problem?
No. It is a recursion problem: code calling itself until the call stack overflows. Adding RAM or raising Node's heap size will not help. The fix is always to break the recursion, which in OpenClaw's case means updating past the buggy release, fixing the plugin config entry, or shrinking the payload that triggers it.
Will deleting the .openclaw folder fix the error?
It usually will, but it is the nuclear option: you lose your config, sessions, and pairing state. Try the targeted fixes first. If you do reset, back up ~/.openclaw/openclaw.json before deleting anything so you can restore your settings selectively.
Which OpenClaw versions are affected by this bug?
It is not one bug but a family. Known offenders include 2026.3.28 beta builds (config warning recursion) and v2026.4.5 (plugin loading crash with Node 24). The pattern to remember: check the GitHub issues for your exact version, and treat the latest stable release as the default fix.
OpenClaw Maximum Call Stack Size Exceeded: 3 Real Fixes