Skip to content

Update preflight fails on low-memory systems (4GB Hetzner VPS) #1868

@RonanCodes

Description

@RonanCodes

Problem

The pnpm clawdbot update command fails on systems with limited RAM due to the preflight validation system running out of memory during repeated full builds.

Error Details

The update process failed with two distinct error types:

1. Recent commits - Module error (upstream bug)

First 3 commits failed with:

error: Cannot find module './cjs/index.cjs' from ''
Bun v1.3.6 (Linux x64)

Affected commits:

2. Older commits - OOM kills

Subsequent commits were killed by the system OOM killer:

◇  ✗ preflight build (6aec34bc) (89.4s)
    Killed

Affected commits tested: 6aec34b, 1c606fd, d1dd8a1, a22ac64, 71eb6d5, a14ca1a, 4c11fc0

Final result:

Update Result: ERROR
  Root: /home/clawdbot/clawdbot
  Reason: preflight-no-good-commit
  Before: 2026.1.24-3

Total time: 984.9s

System Specifications

Hosting: Hetzner Cloud

  • Instance ID: 118248348
  • Region: eu-central (nbg1-dc3)
  • Server type: CPX/CX series (based on hostname pattern)

Hardware:

  • CPU: 2 vCPUs (Intel Xeon Skylake)
  • RAM: 3.7 GB (no swap configured)
  • Disk: 38GB SSD (16GB used, 20GB available)

Software:

  • OS: Ubuntu 24.04.3 LTS (Noble Numbat)
  • Kernel: 6.8.0-90-generic
  • Node.js: v24.13.0 (via nvm)
  • pnpm: 0.34.5
  • Clawdbot: 2026.1.24-3

Analysis

The preflight system in src/infra/update-runner.ts (lines 483-540) is memory-intensive because it:

  1. Creates a temporary git worktree
  2. For each of up to 10 commits, performs:
    • Fresh checkout
    • pnpm install (from scratch)
    • pnpm lint
    • pnpm build (TypeScript compilation with multiple workers)
  3. Does this sequentially until finding a working commit

This is significantly more memory-intensive than a normal build because:

  • Each build is isolated and fresh (no shared node_modules)
  • Multiple sequential builds can accumulate temp files
  • TypeScript compilation spawns worker processes
  • No incremental compilation caching

Reproduction

On a 4GB RAM Hetzner VPS:

cd /home/clawdbot/clawdbot
pnpm clawdbot update

Wait ~16 minutes for all preflight checks to fail.

Suggested Solutions

  1. Add memory requirements to docs - Document minimum 8GB RAM for updates
  2. Optimize preflight - Share node_modules between preflight attempts
  3. Reduce parallelism - Limit TypeScript worker count during preflight
  4. Add --skip-preflight flag - Allow users to bypass validation on trusted systems
  5. Better error messages - Detect low memory and suggest swap or upgrade

Workarounds

For users on low-memory systems:

  1. Add swap space (temporary fix)
  2. Upgrade to 8GB+ RAM instance
  3. Skip updates if current version works
  4. Use global npm install instead of git-based install

Additional Context

The current installation (2026.1.24-3) was built successfully initially, likely because it was installed from a pre-built npm package or built under different conditions (not in an isolated worktree).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions