openclaw - 💡(How to fix) Fix Stale .tmp orphans in ~/.openclaw/devices/ corrupt atomic file reads

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…

Error Message

Observed Error

"error": "JsonFileReadError",

Root Cause

Zero-byte orphan files like:

~/.openclaw/devices/paired.json.<uuid>.tmp
~/.openclaw/devices/pending.json.<uuid>.tmp

persist in the devices directory for months (observed example from 2026-02-23 still present on 2026-05-20). The atomic-file reader's mtime/inode guard detects these stale temp files during directory scans and rejects the read as corrupt.

Code Example

~/.openclaw/devices/paired.json.<uuid>.tmp
~/.openclaw/devices/pending.json.<uuid>.tmp

---

{
  "error": "JsonFileReadError",
  "filePath": "~/.openclaw/devices/paired.json",
  "cause": "File changed during read"
}
RAW_BUFFERClick to expand / collapse

Symptom

JsonFileReadError with message 'File changed during read' when gateway attempts to scan ~/.openclaw/devices/paired.json.

Root Cause

Zero-byte orphan files like:

~/.openclaw/devices/paired.json.<uuid>.tmp
~/.openclaw/devices/pending.json.<uuid>.tmp

persist in the devices directory for months (observed example from 2026-02-23 still present on 2026-05-20). The atomic-file reader's mtime/inode guard detects these stale temp files during directory scans and rejects the read as corrupt.

Environment

  • Gateway: 2026.5.18 (50a2481)
  • OS: Linux Mint 21.3
  • Node: 24.15.0

Observed Error

{
  "error": "JsonFileReadError",
  "filePath": "~/.openclaw/devices/paired.json",
  "cause": "File changed during read"
}

Suggested Fix

  • Add a startup-time cleanup hook that removes .tmp orphans older than 1 hour (or configurable TTL).
  • Or: scope directory scans to only canonical JSON files, skipping anything matching .*\.tmp$ pattern.

Impact

openclaw devices list times out at 10s because the gateway cannot respond to the device store query.

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…

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 Stale .tmp orphans in ~/.openclaw/devices/ corrupt atomic file reads