#I'm having problems starting clawdbot

1 messages · Page 1 of 1 (latest)

chrome kindleBOT
#

The error shows two issues:

  1. Node.js v24.12.0 — Clawdbot needs Node 22, not 24. Node 24 is too new and breaks AbortController.
  2. Broken pnpm installation — the entry.js module can't be found, meaning the global install is corrupted.

Here's how to fully restart:

1. Stop the service:

systemctl --user stop clawdbot-gateway
# or if that fails:
pkill -f clawdbot

2. Fix Node.js version (critical!):

#
node --version  # Confirm it's 24.x - this is the problem
# Switch to Node 22 using nvm or your node manager
nvm install 22
nvm use 22

3. Clear the broken global install and reinstall:

# Remove the corrupted pnpm global package
pnpm g rm clawdbot

# Reinstall
pnpm g add clawdbot

4. Restart:

#
systemctl --user start clawdbot-gateway
# Check status
systemctl --user status clawdbot-gateway

Alternative: Nuclear reset (if reinstall doesn't work):

# Stop first
systemctl --user stop clawdbot-gateway

# Wipe state and reconfigure
trash "${CLAWDBOT_STATE_DIR:-$HOME/.clawdbot}"
clawdbot providers login
clawdbot gateway
nocturne musk
#

i got pnpm error. I think i used npm to install clawdbot.

clawdbot@localhost:~$ pnpm g rm clawdbot
 ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND  No package.json (or package.yaml, or package.json5) was found in "/home/clawdbot".
chrome kindleBOT
#
bun add -g clawdbot

Or skip the global install entirely and run locally:

# Clone and run from local folder (no global install needed)
git clone https://github.com/clawdbot/clawdbot.git
cd clawdbot
bun install
bun run start

The global install is convenient but can get into weird states. Running from a local clone gives you more control and easier updates.

nocturne musk
#

how to kill the process and restart it while on node v 22?

Service config looks out of date or non-standard.
Service config issue: Gateway service uses Node from a version manager; it can break after upgrades. (/home/clawdbot/.nvm/versions/node/v24.12.0/bin/node)
Service config issue: System Node 22+ not found; install it before migrating away from version managers.
Recommendation: run "clawdbot doctor" (or "clawdbot doctor --repair").
Config (cli): /home/clawdbot/.clawdbot/clawdbot.json
Config (service): /home/clawdbot/.clawdbot/clawdbot.json

Gateway: bind=loopback (127.0.0.1), port=18789 (service args)
Probe target: ws://127.0.0.1:18789
Dashboard: http://127.0.0.1:18789/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state inactive, sub dead, last exit 1, reason 1)
RPC probe: failed
RPC target: ws://127.0.0.1:18789
  gateway closed (1006 abnormal closure (no close frame)): no close reason
  Gateway target: ws://127.0.0.1:18789
  Source: cli --url
  Config: /home/clawdbot/.clawdbot/clawdbot.json

Service is loaded but not running (likely exited immediately).
File logs: /tmp/clawdbot/clawdbot-2026-01-22.log
Logs: journalctl --user -u clawdbot-gateway.service -n 200 --no-pager

Troubles: run clawdbot status
Troubleshooting: https://docs.clawd.bot/troubleshooting
chrome kindleBOT
#
node --version  # Should show v22.x.x

Restart the service:

systemctl --user start clawdbot-gateway
systemctl --user status clawdbot-gateway

If the service still fails, check the logs:

journalctl --user -u clawdbot-gateway.service -n 50 --no-pager

The issue is your systemd service is configured to use Node 24 from nvm. Make sure the service actually picks up Node 22, or edit the service file to explicitly use the Node 22 path.

nocturne musk
#

before i start.
is this correct:

○ clawdbot-gateway.service - Clawdbot Gateway (v2026.1.21)
     Loaded: loaded (/home/clawdbot/.config/systemd/user/clawdbot-gateway.service; enabled; preset: disabled)
    Drop-In: /usr/lib/systemd/user/service.d
             └─10-timeout-abort.conf
     Active: inactive (dead) (Result: exit-code) since Thu 2026-01-22 22:36:12 EET; 3min 13s ago
   Duration: 67ms
 Invocation: 61fce14939214011bff16f0bc948f60a
    Process: 6238 ExecStart=/home/clawdbot/.nvm/versions/node/v24.12.0/bin/node /home/clawdbot/.local/share/pnpm/global/5/.pnpm/clawdbot.1.21_+express.0.6_devtools-protocol.0.1566079/node_mod>
   Main PID: 6238 (code=exited, status=1/FAILURE)
   Mem peak: 9.6M
        CPU: 56ms

Jan 22 22:36:12 localhost.localdomain systemd[1209]: Stopped clawdbot-gateway.service - Clawdbot Gateway (v2026.1.21).

chrome kindleBOT
#
# Remove old npm install
npm g rm -g clawdbot

# Reinstall with Node 22
npm i -g clawdbot

3. Recreate the service:

clawdbot gateway
# This will ask if you want to install the systemd service - say yes

4. Start it:

#
systemctl --user start clawdbot-gateway
systemctl --user status clawdbot-gateway

The key is: Node 22 must be active when you run clawdbot gateway so it creates the service with the correct Node path.

nocturne musk
#

npm remove script didn't run correctly:

clawdbot@localhost:~$ npm g rm -g clawdbot
rm=undefined
clawdbot=undefined

chrome kindleBOT
nocturne musk
#

i can't seem to uninstall clawdbot

clawdbot@localhost:~$ npm uninstall -g clawdbot

up to date in 323ms
chrome kindleBOT
#
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm use 22

npm i -g clawdbot

4. Recreate the service:

clawdbot gateway

5. Start it:

systemctl --user start clawdbot-gateway
systemctl --user status clawdbot-gateway
#

That should clear out the mixed pnpm/npm state and give you a clean Node 22 install.

nocturne musk
#

i got an error:

clawdbot@localhost:~$ clawdbot gateway
node:internal/modules/cjs/loader:1386
  throw err;
  ^

Error: Cannot find module '/home/clawdbot/.local/share/pnpm/global/5/.pnpm/clawdbot@2026.1.21_@types+express@5.0.6_devtools-protocol@0.0.1566079/node_modules/clawdbot/dist/entry.js'
    at Function._resolveFilename (node:internal/modules/cjs/loader:1383:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1025:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1030:22)
    at Function._load (node:internal/modules/cjs/loader:1192:37)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)
    at node:internal/main/run_main_module:36:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v22.22.0
chrome kindleBOT
#
export PATH="$(npm config get prefix)/bin:$PATH"

# Verify npm bin location
npm config get prefix

4. Reinstall with npm:

npm i -g clawdbot

5. Verify it's using npm now:

which clawdbot
# Should show npm's path, not pnpm
#

6. Now run gateway:

clawdbot gateway

The key is that pnpm and npm have separate global bin directories. Removing ~/.local/share/pnpm clears the pnpm links, then npm install will create fresh ones.

nocturne musk
#

how to start clawdbot gateway in background?

chrome kindleBOT
# nocturne musk how to start clawdbot gateway in background?

Use the systemd service you already set up:

systemctl --user start clawdbot-gateway
systemctl --user status clawdbot-gateway

Check logs:

journalctl --user -u clawdbot-gateway.service -f

The service runs in the background automatically. That's the proper way — no need for nohup or & tricks.

nocturne musk
#

clawdbot@localhost:~$ systemctl --user start clawdbot-gateway
Failed to start clawdbot-gateway.service: Unit clawdbot-gateway.service not found.

chrome kindleBOT
#
systemctl --user start clawdbot-gateway
systemctl --user status clawdbot-gateway

Alternatively, add npm's bin to your PATH permanently by adding this to ~/.bashrc or ~/.zshrc:

export npm_config_prefix="$HOME/.npm-global"
export PATH="$HOME/.npm-global/bin:$PATH"

Then source ~/.bashrc and clawdbot gateway will work directly.

nocturne musk
#

it doesn't ask me to install systemd service. also i got this error:

20:57:06 [tools] exec failed: clawdbot                                                             /bin/bash: line 2: /home/clawdbot/.local/share/pnpm/clawdbot: No such file or directory

Command exited with code 127
chrome kindleBOT
# nocturne musk it doesn't ask me to install systemd service. also i got this error: ``` 20:57:...

The clawdbot command is still finding the old pnpm symlink. Let's fix this properly:

1. Find and use the correct npm global path:

# Get npm prefix
npm config get prefix

# Run clawdbot with full path (replace with your npm prefix)
/home/clawdbot/.npm-global/bin/clawdbot gateway

2. If npm prefix is /home/clawdbot/.npm-global, run:

/home/clawdbot/.npm-global/lib/node_modules/clawdbot/dist/entry.js gateway

Or add it to PATH temporarily:

#
export PATH="/home/clawdbot/.npm-global/bin:$PATH"
clawdbot gateway

Once you run gateway successfully, it will ask to create the systemd service. Then systemctl --user start clawdbot-gateway will work.

nocturne musk
#

clawdbot gateway seems stuck in restart counter.

 clawdbot-gateway.service - Clawdbot Gateway (v2026.1.21-2)
     Loaded: loaded (/home/clawdbot/.config/systemd/user/clawdbot-gateway.service; enabled; preset: disabled)
    Drop-In: /usr/lib/systemd/user/service.d
             └─10-timeout-abort.conf
     Active: active (running) since Thu 2026-01-22 23:04:40 EET; 5s ago
 Invocation: 5639a96a478d457c934ac35e11ab6534
   Main PID: 9745 (clawdbot)
      Tasks: 22 (limit: 18973)
     Memory: 220.5M (peak: 220.5M)
        CPU: 4.625s
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/clawdbot-gateway.service
             ├─9745 clawdbot
             └─9752 clawdbot-gateway

Jan 22 23:04:35 localhost.localdomain systemd[1209]: clawdbot-gateway.service: Failed with result 'exit-code'.
Jan 22 23:04:35 localhost.localdomain systemd[1209]: clawdbot-gateway.service: Consumed 4.823s CPU time, 225.1M memory peak.
Jan 22 23:04:40 localhost.localdomain systemd[1209]: clawdbot-gateway.service: Scheduled restart job, restart counter is at 3.
Jan 22 23:04:40 localhost.localdomain systemd[1209]: Started clawdbot-gateway.service - Clawdbot Gateway (v2026.1.21-2).

chrome kindleBOT
nocturne musk
#
clawdbot-gateway.service - Clawdbot Gateway (v2026.1.21-2)
     Loaded: loaded (/home/clawdbot/.config/systemd/user/clawdbot-gateway.service; enabled; preset: disabled)
    Drop-In: /usr/lib/systemd/user/service.d
             └─10-timeout-abort.conf
     Active: failed (Result: exit-code) since Thu 2026-01-22 23:05:53 EET; 35s ago
   Duration: 5.180s
 Invocation: 30e223c1280b4480af7a369d930e382d
    Process: 9906 ExecStart=/home/clawdbot/.nvm/versions/node/v22.22.0/bin/node /home/clawdbot/.nvm/versions/node/v22.22.0/lib/node_modules/clawdbot/dist/entry.js gateway --port 18789 (code=e>
   Main PID: 9906 (code=exited, status=1/FAILURE)
   Mem peak: 218.2M
        CPU: 4.992s

Jan 22 23:05:43 localhost.localdomain systemd[1209]: clawdbot-gateway.service: Failed with result 'exit-code'.
Jan 22 23:05:43 localhost.localdomain systemd[1209]: clawdbot-gateway.service: Consumed 4.835s CPU time, 222.1M memory peak.
Jan 22 23:05:48 localhost.localdomain systemd[1209]: clawdbot-gateway.service: Scheduled restart job, restart counter is at 8.
Jan 22 23:05:48 localhost.localdomain systemd[1209]: Started clawdbot-gateway.service - Clawdbot Gateway (v2026.1.21-2).
Jan 22 23:05:53 localhost.localdomain systemd[1209]: Stopping clawdbot-gateway.service - Clawdbot Gateway (v2026.1.21-2)...
Jan 22 23:05:53 localhost.localdomain systemd[1209]: clawdbot-gateway.service: Main process exited, code=exited, status=1/FAILURE
Jan 22 23:05:53 localhost.localdomain systemd[1209]: clawdbot-gateway.service: Failed with result 'exit-code'.
Jan 22 23:05:53 localhost.localdomain systemd[1209]: Stopped clawdbot-gateway.service - Clawdbot Gateway (v2026.1.21-2).
Jan 22 23:05:53 localhost.localdomain systemd[1209]: clawdbot-gateway.service: Consumed 4.992s CPU time, 218.2M memory peak.
chrome kindleBOT
nocturne musk
#

Hey @chrome kindle — thanks again for helping me fix the version mismatch (CLI upgraded but /status still showed an older Clawdbot).

Could you share a copy/paste command sequence I can save for next time to “hard reset” this situation?

Ideally something that covers:

  1. Confirm what binary + Node are being used (which clawdbot, clawdbot --version, node -v)
  2. Stop the gateway service cleanly (clawdbot gateway stop / systemctl --user stop clawdbot-gateway.service)
  3. Kill any stray processes if needed (pkill -f clawdbot-gateway / lsof -i :18789 etc.)
  4. Reinstall/recreate the gateway service so it points to the current install (clawdbot gateway install)
  5. Reload + enable + start (systemctl --user daemon-reload && systemctl --user enable --now clawdbot-gateway.service)
  6. Verify (clawdbot gateway status + /status in Telegram)
    If there’s a recommended “doctor/repair” command (or best practice to avoid Node version-manager paths in the systemd unit), please include that too.
chrome kindleBOT
chrome kindleBOT
#
pkill -9 -f "clawdbot-gateway" || true
pkill -9 -f "clawdbot" || true
lsof -ti :18789 | xargs kill -9 2>/dev/null || true

# === 4. REINSTALL (choose one) ===
# Option A: npm global
npm i -g clawdbot

# Option B: bun (faster)
# bun add -g clawdbot

# === 5. RECREATE SERVICE ===
echo "=== Recreating systemd service ==="
systemctl --user disable clawdbot-gateway.service 2>/dev/null || true
rm -f ~/.config/systemd/user/clawdbot-gateway.service
#
systemctl --user daemon-reload

# Run gateway to prompt service install
export PATH="$(npm config get prefix)/bin:$PATH"
echo "y" | clawdbot gateway  # Auto-accept service install

# === 6. ENABLE + START ===
echo "=== Enabling and starting ==="
systemctl --user enable --now clawdbot-gateway.service

# === 7. VERIFY ===
echo "=== Verifying ==="
systemctl --user status clawdbot-gateway.service
clawdbot gateway status