Skip to content

[Bug]: Gateway crashes with EBUSY errors when .openclaw is synced via cloud storage #39446

@nanli2000cn

Description

@nanli2000cn

Bug type

Crash (process/app exits or hangs)

Summary

OpenClaw Gateway crashes with unhandled EBUSY, EACCES, or EPERM errors when the .openclaw configuration directory is synced across devices using cloud storage services (Baidusyncdist, OneDrive, Dropbox, Google Drive).

Steps to reproduce

  1. Configure cloud sync service (e.g., Baidu Netdisk, OneDrive) to sync ~/.openclaw directory across multiple devices
  2. Start OpenClaw Gateway on Device A: openclaw gateway start
  3. Send messages or perform actions that trigger file writes (session logs, config updates, cron state)
  4. Cloud sync service locks files temporarily during upload/download
  5. OpenClaw attempts to write to locked files

Expected behavior

Gateway should handle file lock errors gracefully:

  • Retry the operation after a short delay
  • Log a warning if retries fail
  • Continue running without crashing

Actual behavior

Gateway crashes immediately with unhandled exception:

Error: EBUSY: resource busy or locked, open '/Users/xxx/.openclaw/agents/main/sessions/xxx.jsonl'
    at Object.openSync (node:fs:...)
    at Object.writeFileSync (node:fs:...)

The Gateway process exits completely, requiring manual restart.

OpenClaw version

2026.3.2

Operating system

macOS 14.x (Sonoma), Windows 11, Ubuntu 24.04 (any OS with cloud sync)

Install method

No response

Logs, screenshots, and evidence

[2026-03-06 07:51:23] Writing session update...
Error: EBUSY: resource busy or locked, open '/Users/xxx/.openclaw/agents/main/sessions/telegram_7840327506.jsonl'
    at Object.openSync (node:fs:601:3)
    at Object.writeFileSync (node:fs:2349:35)
    at SessionStore.append (/path/to/openclaw/dist/session-store.js:...)
    at AgentRunner.saveMessage (/path/to/openclaw/dist/agent-runner.js:...)

Process exited with code 1

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbug:crashProcess/app exits unexpectedly or hangs

    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