openclaw - 💡(How to fix) Fix [Bug]: openclaw logs --follow keeps disconnecting, making live log monitoring unusable [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#74583Fetched 2026-04-30 06:22:40
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
3
Participants
Timeline (top)
cross-referenced ×2

Hi OpenClaw team 👋

Since one of the last 1-2 updates, openclaw logs --follow no longer works reliably for watching the gateway log over a longer period of time.

It now disconnects repeatedly with a gateway error. Because of that, it is currently not really possible to keep the log open and monitor what is happening live. I have to restart the command again and again.

Error Message

gateway connect failed: Error: gateway closed (1000): Gateway not reachable. Is it running and accessible? Gateway target: ws://127.0.0.1:18789 Source: local loopback Config: /root/.openclaw/openclaw.json Bind: loopback Hint: run openclaw doctor.

Root Cause

It now disconnects repeatedly with a gateway error. Because of that, it is currently not really possible to keep the log open and monitor what is happening live. I have to restart the command again and again.

Code Example

openclaw logs --follow

---

gateway connect failed: Error: gateway closed (1000):
Gateway not reachable. Is it running and accessible?
Gateway target: ws://127.0.0.1:18789
Source: local loopback
Config: /root/.openclaw/openclaw.json
Bind: loopback
Hint: run `openclaw doctor`.

---

Log tail truncated (increase --max-bytes).

---

Runtime: running
Connectivity probe: ok
Listening: 127.0.0.1:18789
Capability: admin-capable

---

The `openclaw version` command is unavailable because `plugins.allow` excludes "version".
RAW_BUFFERClick to expand / collapse

Summary

Hi OpenClaw team 👋

Since one of the last 1-2 updates, openclaw logs --follow no longer works reliably for watching the gateway log over a longer period of time.

It now disconnects repeatedly with a gateway error. Because of that, it is currently not really possible to keep the log open and monitor what is happening live. I have to restart the command again and again.

What happens

When I run:

openclaw logs --follow

it often exits with:

gateway connect failed: Error: gateway closed (1000):
Gateway not reachable. Is it running and accessible?
Gateway target: ws://127.0.0.1:18789
Source: local loopback
Config: /root/.openclaw/openclaw.json
Bind: loopback
Hint: run `openclaw doctor`.

Sometimes before that I also see:

Log tail truncated (increase --max-bytes).

Why this is confusing

Right after openclaw logs --follow says the gateway is not reachable, openclaw gateway status says the gateway is actually running and reachable:

Runtime: running
Connectivity probe: ok
Listening: 127.0.0.1:18789
Capability: admin-capable

So it looks like the gateway itself is still alive, but the logs --follow command loses the connection or gives up too easily.

Expected behavior

openclaw logs --follow should keep running and continue following the log, so it can be used for live monitoring.

If the log grows too quickly or the websocket has a short hiccup, it would be helpful if the command could recover or retry instead of exiting completely.

Actual behavior

openclaw logs --follow exits repeatedly. This makes it impossible to keep the log open for continuous debugging or monitoring.

Environment

  • OpenClaw: 2026.4.26 (be8c246)
  • OS: Ubuntu / Linux
  • Install method: npm
  • Gateway bind: loopback
  • Gateway target: ws://127.0.0.1:18789
  • Gateway port: 18789
  • Service: systemd user service

Additional notes

openclaw version currently cannot be used on this setup because the version CLI plugin is excluded by plugins.allow:

The `openclaw version` command is unavailable because `plugins.allow` excludes "version".

That may be unrelated, but I wanted to include it in case the CLI plugin loading / allowlist behavior is relevant.

Related issues / PRs

This seems related to, but not fully covered by:

  • #74252 — fixes misleading reset/rotation behavior when the log grows quickly
  • #56475 — proposes reusing/persisting the websocket for logs --follow
  • #74078 — reports gateway unreachable symptoms on 2026.4.26
  • #73467 — reports gateway stalls / timeouts on 2026.4.26

Thanks for looking into this 🙏

extent analysis

TL;DR

The openclaw logs --follow command may need adjustments to its connection retry mechanism or log handling to prevent disconnections and exits due to gateway errors or log growth.

Guidance

  • Investigate the --max-bytes parameter to increase the log tail size, potentially reducing truncation issues.
  • Review the gateway configuration and openclaw.json file for any settings that might affect connection persistence or retry behavior.
  • Consider implementing a retry mechanism or a script to automatically restart the openclaw logs --follow command upon disconnection.
  • Examine the related issues (#74252, #56475, #74078, #73467) for potential insights into similar problems and their resolutions.

Example

No specific code example is provided due to the lack of direct code references in the issue, but a potential approach could involve scripting a retry loop for the openclaw logs --follow command.

Notes

The exact cause of the disconnections is unclear, and the relationship between the gateway status and the logs --follow command's behavior needs further investigation. The exclusion of the version CLI plugin might not be directly relevant but could indicate configuration or plugin loading issues.

Recommendation

Apply a workaround, such as scripting a retry mechanism for the openclaw logs --follow command, as the root cause and a definitive fix are not immediately clear from the provided information.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

openclaw logs --follow should keep running and continue following the log, so it can be used for live monitoring.

If the log grows too quickly or the websocket has a short hiccup, it would be helpful if the command could recover or retry instead of exiting completely.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: openclaw logs --follow keeps disconnecting, making live log monitoring unusable [1 participants]