#clawdbot doctor crashing after upgrade to 2026.1.23-1 (c8afa82)

1 messages ยท Page 1 of 1 (latest)

urban heath
#

<--- Last few GCs --->

[166605:0xd196000] 59764 ms: Scavenge (interleaved) 472.0 (486.0) -> 471.5 (491.0) MB, pooled: 0 MB, 73.06 / 0.00 ms (average mu = 0.350, current mu = 0.214) allocation failure;
[166605:0xd196000] 63681 ms: Mark-Compact 474.9 (491.0) -> 473.3 (493.7) MB, pooled: 0 MB, 3807.96 / 0.00 ms (average mu = 0.216, current mu = 0.120) allocation failure; scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

1: 0xe40d24 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [clawdbot-doctor]
2: 0x1216be0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [clawdbot-doctor]
3: 0x1216eb7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [clawdbot-doctor]
4: 0x1444875 [clawdbot-doctor]
5: 0x145e109 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [clawdbot-doctor]
6: 0x14327b8 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [clawdbot-doctor]
7: 0x14336e5 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [clawdbot-doctor]
8: 0x140c3be v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [clawdbot-doctor]
9: 0x186da1c v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [clawdbot-doctor]
10: 0x1dcb476 [clawdbot-doctor]

misty spruceBOT
# urban heath <--- Last few GCs ---> [166605:0xd196000] 59764 ms: Scavenge (interleaved) 4...

Based on the error, here's guidance for setecastronomy8:

JavaScript Heap Out of Memory - Solution

The clawdbot-doctor process crashed after hitting Node.js's default heap limit (~491 MB). This can happen after an upgrade if the new version uses more memory.

Quick Fix: Increase Node.js Heap Size

Option 1: Set environment variable

export NODE_OPTIONS="--max-old-space-size=4096"
clawdbot doctor

Option 2: Permanent fix - add to your shell profile

#
# Add to ~/.zshrc or ~/.bashrc
export NODE_OPTIONS="--max-old-space-size=4096"

Option 3: For the daemon/service
Create or edit ~/.clawdbot/.env:

NODE_OPTIONS=--max-old-space-size=4096

If the Issue Persists

  1. Check what changed in 2026.1.23-1:
    • Review the changelog for memory-related changes
    • Could be a new dependency or feature using more memory
#
  1. Run with verbose logging to identify what's consuming memory:

    clawdbot doctor --verbose
    
  2. Check for memory leaks:

    clawdbot status --all
    # Look for unusually high memory usage
    

Alternative: Run with increased memory for specific commands

NODE_OPTIONS="--max-old-space-size=8192" clawdbot doctor --repair
#

Note: The default heap limit is ~512 MB for Node.js 22+. Setting it to 4096 MB (4GB) should resolve this for most use cases. If you're on a memory-constrained VPS, 2048 MB is a reasonable middle ground.

urban heath
#

"old-space-size"?

If 512 isn't big enough and it's default then it needs to be permenently increased. How do I do that?

Why is doing an upgrade wiping out this setting if it's needed to function properly?

misty spruceBOT
#
source ~/.zshrc  # or ~/.bashrc
clawdbot doctor --repair
clawdbot daemon restart

2. Why This Happened

The upgrade didn't wipe anything - this setting likely wasn't needed before because 2026.1.23-1 apparently uses more memory than your previous version. Common causes:

  • New dependency in the release
  • A new feature that loads more into memory
  • Unintentional memory leak in the new version
  • Session history grew since the last doctor run

This is a Node.js runtime limit, not a Clawdbot config setting, so there's nothing for the upgrade to preserve.

#

Recommendation: Open a GitHub issue about this crash on upgrade so the team can investigate whether the new version has a regression or if 4096MB should be the new default. Include your clawdbot --version output.

urban heath
#

It's only clawdbot doctor that's crashing. Not gateway.

misty spruceBOT
# urban heath It's only clawdbot doctor that's crashing. Not gateway.

Ah, that's helpful context!

Good News

The gateway itself is fine - it's just clawdbot doctor that hits memory limits during its health checks/probes.

Quick Fix

# Run doctor with increased heap
NODE_OPTIONS="--max-old-space-size=4096" clawdbot doctor --repair

Or set it permanently in ~/.clawdbot/.env so it's always available when you run doctor:

#
NODE_OPTIONS=--max-old-space-size=4096

Why Doctor Hits This

clawdbot doctor runs deep probes including:

  • Provider API calls (model probes, auth checks)
  • Channel connectivity tests
  • Config validation scans
  • Log parsing

This is more intensive than normal gateway operation, which explains why the gateway runs fine but doctor crashes on limited RAM.


Still worth noting as a bug - if doctor routinely crashes on upgrades, that's a UX issue. The team might want to either:

#
  • Increase the default heap in the doctor command
  • Add a pre-check warning when memory looks constrained

Feel free to open a GitHub issue with the crash details so they can address it properly.

urban heath
#

What now?

misty spruceBOT
# urban heath What now?

Next Steps

  1. Add to ~/.clawdbot/.env:

    NODE_OPTIONS=--max-old-space-size=4096
    
  2. Run doctor:

    clawdbot doctor --repair
    
  3. (Optional) Report the bug:
    https://github.com/clawdbot/clawdbot/issues/new

    • Title: "clawdbot doctor crashes with heap out of memory after upgrade to 2026.1.23-1"
    • Paste the error from the thread
    • Mention your environment (OS, RAM available)
#

That's it. The gateway was never down - just couldn't run the post-upgrade health check. If doctor completes successfully, you're good to go.

urban heath
#
  1. I already did this. It odesn't work.
misty spruceBOT
# urban heath 1. I already did this. It odesn't work.

Debug This

  1. Verify the file exists and is readable:

    cat ~/.clawdbot/.env
    
  2. Try running with explicit env:

    NODE_OPTIONS="--max-old-space-size=4096" clawdbot doctor
    
  3. Check if there are syntax issues (extra spaces, etc.):

    • Should be exactly: NODE_OPTIONS=--max-old-space-size=4096
    • No quotes around the value
    • No spaces around the =
#
  1. Try a higher value:
    NODE_OPTIONS="--max-old-space-size=8192" clawdbot doctor
    

If explicit env works but the .env file doesn't, the doctor command might not be loading .env from ~/.clawdbot/. What does cat ~/.clawdbot/.env show?

urban heath
#

export NODE_OPTIONS="--max-old-space-size=4096" before runnign the command works.

But this obviously does not get read from /.clawdbot/.env or you gave me a wrong command

DID YOU MEAN

export NODE_OPTIONS="--max-old-space-size=4096" in .env or

NODE_OPTIONS="--max-old-space-size=4096"

Id on't wnat to have to remember to type this long command every time. It should be permenently set

misty spruceBOT
#

# Then reload
source ~/.zshrc

Now clawdbot doctor will work normally without the long prefix.


Why .env might not work: The doctor command runs early in the startup sequence and may not fully load the .env file from ~/.clawdbot/. Shell profile is more reliable.

urban heath
#

It doesn't load it.