#Openclaw run error

1 messages · Page 1 of 1 (latest)

wicked ruin
#

I'm runnning OpenClaw 2026.5.22 (a374c3a) and just got a run error update after trying to install a new tool. Here's the results from running status and gateway checks

openclaw status --all
openclaw gateway status
openclaw status --deep

run error: session file changed while embedded prompt lock was released:
/Users/oc-bbbb1/.openclaw/agents/main/sessions/7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl

stiff treeBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

obtuse fernBOT
silver mothBOT
# wicked ruin I'm runnning OpenClaw 2026.5.22 (a374c3a) and just got a run error update afte...

That looks like a session transcript concurrency guard, not a normal tool-install failure: OpenClaw saw the same session JSONL change while the embedded runner had released its prompt lock.

Since you already included the version 2026.5.22 (a374c3a), I’d try this in the least-destructive order:

  1. Stop any other active runs for that same session/thread, then restart the gateway:
openclaw gateway restart
openclaw doctor
openclaw status --all
  1. If it keeps failing on exactly that same file, back up that one transcript and its lock file, then start a fresh session:
mkdir -p ~/.openclaw/session-backups
cp /Users/oc-bbbb1/.openclaw/agents/main/sessions/7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl ~/.openclaw/session-backups/
ls -l /Users/oc-bbbb1/.openclaw/agents/main/sessions/7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl*
silver mothBOT
# wicked ruin I'm runnning OpenClaw 2026.5.22 (a374c3a) and just got a run error update afte...

If there’s a matching .jsonl.lock left behind after the gateway is fully stopped, move it aside rather than deleting it. Don’t remove the transcript unless you’re okay losing that session history.

  1. If it reproduces after a restart or on a new session, that’s worth filing as a bug with the exact error, openclaw --version, and a redacted openclaw status --all: https://github.com/openclaw/openclaw/issues

Docs for the standard triage ladder are here: https://docs.openclaw.ai/help/faq and https://docs.openclaw.ai/gateway/troubleshooting

wicked ruin
#

I entered the prompts in step 1 and got the following:

openclaw gateway restart
openclaw doctor
openclaw status --all

run error: session file changed while embedded prompt lock was released:
/Users/oc-bbbb1/.openclaw/agents/main/sessions/7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl
local ready | error
agent main | session main | anthropic/claude-opus-4-7 | tokens 40k/1.0m (4%)

silver mothBOT
# wicked ruin I entered the prompts in step 1 and got the following: openclaw gateway resta...

Thanks, that confirms restart/doctor didn’t clear the active session state. Next I’d force a fresh session.

First try the clean path: send /new or /reset as a standalone message in the OpenClaw chat/session that is failing. Docs: https://docs.openclaw.ai/help/faq#how-do-i-start-a-fresh-conversation

If the error prevents even that, move only that one transcript out of the sessions folder while the gateway is stopped:

openclaw gateway stop

mkdir -p ~/.openclaw/session-backups
mv /Users/oc-bbbb1/.openclaw/agents/main/sessions/7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl ~/.openclaw/session-backups/

# only if this exists:
mv /Users/oc-bbbb1/.openclaw/agents/main/sessions/7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl.lock ~/.openclaw/session-backups/

openclaw gateway start
silver mothBOT
wicked ruin
silver mothBOT
# wicked ruin

That means moving only the transcript wasn’t enough. The session store is probably still pointing main at that same session id, so OpenClaw recreates/reuses the same 7a29... JSONL path after startup.

At this point I’d preserve a backup, then move the main session index aside so OpenClaw has to rebuild fresh session bindings:

openclaw backup create --verify --no-include-workspace

openclaw gateway stop

STAMP="$(date +%Y%m%d-%H%M%S)"
mkdir -p "$HOME/.openclaw/session-backups/$STAMP"

cd /Users/oc-bbbb1/.openclaw/agents/main/sessions

[ -e sessions.json ] && mv sessions.json "$HOME/.openclaw/session-backups/$STAMP/"
[ -e sessions.json.lock ] && mv sessions.json.lock "$HOME/.openclaw/session-backups/$STAMP/"
silver mothBOT
# wicked ruin

[ -e 7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl ] && mv 7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl "$HOME/.openclaw/session-backups/$STAMP/"
[ -e 7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl.lock ] && mv 7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl.lock "$HOME/.openclaw/session-backups/$STAMP/"

openclaw gateway start
openclaw status --all

This resets the main agent’s session bindings, but keeps the files under ~/.openclaw/session-backups/<timestamp> plus the backup archive.

If it still reports the exact same path after sessions.json is moved aside, that’s no longer normal recovery territory. Please file it with the version, the exact error, and the fact that both the transcript and sessions.json were moved: https://github.com/openclaw/openclaw/issues

wicked ruin
silver mothBOT
# wicked ruin

Same path after moving both the transcript and sessions.json is suspicious. Before changing anything else, let’s verify whether the files are actually gone and whether the gateway was fully stopped.

Please run this exactly and paste the output:

openclaw gateway stop
openclaw gateway status

SESSION_DIR="/Users/oc-bbbb1/.openclaw/agents/main/sessions"

ls -la "$SESSION_DIR" | grep -E 'sessions\.json|7a29ef8f-b7c3-4651-8b3d-303837926211|\.lock' || true

find "$HOME/.openclaw/session-backups" -name 'sessions.json' -o -name '7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl' | tail -20

openclaw logs --follow
silver mothBOT
# wicked ruin

For the last command, let it print the next fresh error, then stop it with Ctrl-C.

If the ls command still shows 7a29... or sessions.json after gateway stop, the previous moves didn’t take effect or something is recreating them. If those files are gone but status --all still shows the same error, it may be reporting an old log tail rather than the current state.

Also: at this point this is likely issue-worthy. The bug report should mention that /reset, gateway restart, moving the transcript, and moving sessions.json did not clear the embedded prompt lock error: https://github.com/openclaw/openclaw/issues

wicked ruin
silver mothBOT
# wicked ruin

That output is from the OpenClaw agent responding to the commands as chat text, not from your Mac terminal. The “Whoa — wall of queued commands...” line is the assistant interpreting the shell commands instead of macOS executing them.

Please do this outside Discord/OpenClaw, in the macOS Terminal app:

  1. Send /stop once in the broken OpenClaw chat to clear the queued agent run.
  2. Open Terminal.app.
  3. Paste the diagnostic block there, not into Discord and not into the OpenClaw chat.

Use this shorter version first:

openclaw gateway stop
openclaw gateway status

SESSION_DIR="/Users/oc-bbbb1/.openclaw/agents/main/sessions"
silver mothBOT
# wicked ruin
ls -la "$SESSION_DIR" | grep -E 'sessions\.json|7a29ef8f-b7c3-4651-8b3d-303837926211|\.lock' || true

find "$HOME/.openclaw/session-backups" \( -name 'sessions.json' -o -name '7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl' \) | tail -20

Then paste the actual Terminal output here. Don’t run openclaw logs --follow yet; it will keep streaming and may make this more confusing. 🦞

wicked ruin
#

my last input was not from discord...it was from the terminal. i followed your instructions and got the following:openclaw gateway stop
openclaw gateway status

SESSION_DIR="/Users/oc-bbbb1/.openclaw/agents/main/sessions"
ls -la "$SESSION_DIR" | grep -E 'sessions.json|7a29ef8f-b7c3-4651-8b3d-303837926211|.lock' || true

find "$HOME/.openclaw/session-backups" ( -name 'sessions.json' -o -name '7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl' ) | tail -20

run error: session file changed while embedded prompt lock was released:
/Users/oc-bbbb1/.openclaw/agents/main/sessions/7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl
local ready | error
agent main | session main | anthropic/claude-opus-4-7 | tokens 40k/1.0m (4%)

silver mothBOT
# wicked ruin my last input was not from discord...it was from the terminal. i followed your ...

You’re right, my read of that was off. Sorry — thanks for sticking with it.

What’s odd is that the pasted output still doesn’t show the expected output from gateway stop, gateway status, ls, or find; it only shows the OpenClaw run-error summary. So either one of those commands is itself triggering the status reporter, or the relevant shell output is getting swallowed/omitted.

Let’s make the next check atomic. Please run these one at a time in Terminal and paste the output after each command, especially command 2 and 3:

command -v openclaw
openclaw gateway status
SESSION_DIR="/Users/oc-bbbb1/.openclaw/agents/main/sessions"; ls -la "$SESSION_DIR" | grep -E 'sessions\.json|7a29ef8f-b7c3-4651-8b3d-303837926211|\.lock' || true
silver mothBOT
# wicked ruin my last input was not from discord...it was from the terminal. i followed your ...
find "$HOME/.openclaw/session-backups" \( -name 'sessions.json' -o -name '7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl' \) | tail -20

Small but important: the find parentheses need the backslashes above. Without them, the shell treats them as syntax, not find arguments.

If command 3 shows that sessions.json or 7a29... still exists in the sessions dir, we know the move didn’t land. If command 3 is empty but the run error still appears, this is almost certainly stale status/log state or a bug in status recovery, and I’d stop trying manual repairs and file it: https://github.com/openclaw/openclaw/issues

wicked ruin
#

Here's what I got afert the first command:command -v openclaw

run error: session file changed while embedded prompt lock was released:
/Users/oc-bbbb1/.openclaw/agents/main/sessions/7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl
local ready | error

silver mothBOT
# wicked ruin Here's what I got afert the first command:command -v openclaw ...

That confirms the commands are being entered into an OpenClaw interactive session/TUI, not a plain shell. command -v openclaw is a shell builtin; in a real macOS shell it should only print a path like /opt/homebrew/bin/openclaw or nothing. It cannot produce an OpenClaw run-error summary by itself.

Do this:

  1. Quit the current OpenClaw interactive session/window with Ctrl-C, Ctrl-D, or close that terminal tab.
  2. Open a brand-new Terminal.app window/tab.
  3. Before running any OpenClaw command, test the shell:
echo SHELL_OK
pwd

You should see SHELL_OK and a filesystem path. If you see the run error again, you’re still inside OpenClaw, not the shell.

Once echo SHELL_OK works, run:

silver mothBOT
wicked ruin
#

Here's what I got:oc-bbbb1@Roys-Mac-mini ~ % command -v openclaw
openclaw gateway status
/opt/homebrew/bin/openclaw

🦞 OpenClaw 2026.5.22 (a374c3a) — Deployed locally, trusted globally, debugged eternally.

│
â—‡
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-05-25.log
Command: /opt/homebrew/opt/node/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Working dir: ~/.openclaw
Service env: OPENCLAW_GATEWAY_PORT=18789

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.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.

CLI version: 2026.5.22 (/opt/homebrew/bin/openclaw)
Gateway version: 2026.5.22

Runtime: running (pid 17587, state active)
Connectivity probe: ok
Capability: admin-capable

Listening: 127.0.0.1:18789
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
oc-bbbb1@Roys-Mac-mini ~ %

silver mothBOT
# wicked ruin Here's what I got:oc-bbbb1@Roys-Mac-mini ~ % command -v openclaw openclaw gatewa...

Good, now we’re in the real shell. Gateway is healthy: Runtime: running, Connectivity probe: ok.

Next, please run these two commands in that same Terminal window and paste the output:

SESSION_DIR="/Users/oc-bbbb1/.openclaw/agents/main/sessions"; ls -la "$SESSION_DIR" | grep -E 'sessions\.json|7a29ef8f-b7c3-4651-8b3d-303837926211|\.lock' || true
find "$HOME/.openclaw/session-backups" \( -name 'sessions.json' -o -name '7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl' \) | tail -20

If the first command is empty, the stuck files really were moved and openclaw status --all may just be showing the last failed run/error summary. If the first command still lists sessions.json or 7a29..., then we’ll fix the move from the real shell now.

wicked ruin
#

here's the output from the first:

oc-bbbb1@Roys-Mac-mini ~ % SESSION_DIR="/Users/oc-bbbb1/.openclaw/agents/main/sessions"; ls -la "$SESSION_DIR" | grep -E 'sessions.json|7a29ef8f-b7c3-4651-8b3d-303837926211|.lock' || true
-rw-r--r-- 1 oc-bbbb1 staff 92853 May 25 08:40 7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl
-rw------- 1 oc-bbbb1 staff 249 May 25 08:40 7a29ef8f-b7c3-4651-8b3d-303837926211.trajectory-path.json
-rw------- 1 oc-bbbb1 staff 4514747 May 25 08:40 7a29ef8f-b7c3-4651-8b3d-303837926211.trajectory.jsonl
-rw------- 1 oc-bbbb1 staff 688451 May 25 08:40 sessions.json

here's the output from the second:

oc-bbbb1@Roys-Mac-mini ~ % find "$HOME/.openclaw/session-backups" ( -name 'sessions.json' -o -name '7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl' ) | tail -20
find: /Users/oc-bbbb1/.openclaw/session-backups: No such file or directory

silver mothBOT
# wicked ruin here's the output from the first: oc-bbbb1@Roys-Mac-mini ~ % SESSION_DIR="/User...

That explains it: the earlier move never happened. The stuck transcript and sessions.json are still in the live sessions directory, and there’s no backup folder yet.

Run this from the same real Terminal window:

openclaw gateway stop
openclaw gateway status

STAMP="$(date +%Y%m%d-%H%M%S)"
BACKUP_DIR="$HOME/.openclaw/session-backups/$STAMP"
SESSION_DIR="/Users/oc-bbbb1/.openclaw/agents/main/sessions"

mkdir -p "$BACKUP_DIR"

mv "$SESSION_DIR/sessions.json" "$BACKUP_DIR/" 2>/dev/null || true
mv "$SESSION_DIR/sessions.json.lock" "$BACKUP_DIR/" 2>/dev/null || true
silver mothBOT
# wicked ruin here's the output from the first: oc-bbbb1@Roys-Mac-mini ~ % SESSION_DIR="/User...

mv "$SESSION_DIR/7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl" "$BACKUP_DIR/" 2>/dev/null || true
mv "$SESSION_DIR/7a29ef8f-b7c3-4651-8b3d-303837926211.jsonl.lock" "$BACKUP_DIR/" 2>/dev/null || true
mv "$SESSION_DIR/7a29ef8f-b7c3-4651-8b3d-303837926211.trajectory-path.json" "$BACKUP_DIR/" 2>/dev/null || true
mv "$SESSION_DIR/7a29ef8f-b7c3-4651-8b3d-303837926211.trajectory.jsonl" "$BACKUP_DIR/" 2>/dev/null || true

echo "Backed up to: $BACKUP_DIR"
ls -la "$SESSION_DIR" | grep -E 'sessions\.json|7a29ef8f-b7c3-4651-8b3d-303837926211|\.lock' || true
ls -la "$BACKUP_DIR"

openclaw gateway start
openclaw gateway status

The important check is the second ls: it should print nothing for the live SESSION_DIR. If it still lists those files, stop there and paste that output. If it’s empty, try a simple message to OpenClaw again.

wicked ruin
silver mothBOT
# wicked ruin

Good: the backup/move worked. The ls shown there is the backup folder, and it contains the stuck sessions.json + 7a29... files, so we got them out of the live session directory.

Now the current issue is separate: the gateway service definition was repaired from 2026.5.19 to 2026.5.22, then the LaunchAgent was still warming up and the port was not listening yet.

Give it ~10 seconds, then run:

openclaw gateway status
openclaw status --all

If it still says connect ECONNREFUSED 127.0.0.1:18789, run:

tail -80 ~/Library/Logs/openclaw/gateway.log
tail -80 ~/.openclaw/logs/gateway-restart.log
silver mothBOT
# wicked ruin

Paste those tails. The key thing I’m looking for now is the first real gateway startup error after loading configuration…. The session-file lock problem may already be cleared; we just need the repaired LaunchAgent to actually finish starting.

wicked ruin