hermes - 💡(How to fix) Fix `[Bug] Memory tool fails with "Errno 36 Resource deadlock avoided" on Windows`

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

Error during OpenAI-compatible API call: [Errno 36] Resource deadlock avoided

This error occurs every time the memory tool is invoked (add, replace, or remove actions). The error appears to be a socket-level deadlock (EDEADLK) at the OS layer, not an API authentication or content issue.

Root Cause

Possible root causes:

  1. Concurrency lock conflict — Memory storage uses system-level file locks; repeated locking by same thread triggers EDEADLK
  2. Async/Sync mixing — Memory write uses blocking I/O inside async event loop
  3. HTTP connection pool exhaustion — High-frequency API calls exhaust the pool
  4. Dependency bug — Possible issue in httpx/anyio/OpenAI SDK on Windows

Fix Action

Workaround

Edit C:\Users\<user>\AppData\Local\hermes\memories_backup\MEMORY.md directly with Python/os module.

Code Example

Error during OpenAI-compatible API call: [Errno 36] Resource deadlock avoided

---

memory(action="add", target="memory", content="test")
RAW_BUFFERClick to expand / collapse

[Bug] Memory tool fails with "Errno 36 Resource deadlock avoided" on Windows

Environment

  • OS: Windows 11
  • Hermes Agent version: v0.14.0 (2026.5.16)
  • Python: 3.12.12
  • Provider: Xiaomi MiMo (mimo-v2.5) via OpenAI-compatible endpoint
  • Memory config: Built-in (no external provider), memory_enabled: true

Error

Error during OpenAI-compatible API call: [Errno 36] Resource deadlock avoided

This error occurs every time the memory tool is invoked (add, replace, or remove actions). The error appears to be a socket-level deadlock (EDEADLK) at the OS layer, not an API authentication or content issue.

Steps to Reproduce

  1. Start Hermes Agent on Windows (native, not WSL)
  2. In any session, call the memory tool:
    memory(action="add", target="memory", content="test")
  3. Error occurs immediately

Expected Behavior

Memory tool should write to persistent memory without errors.

Actual Behavior

  • Memory tool fails with deadlock error on every attempt
  • Gateway restart does not fix the issue
  • Deleting memories_backup/MEMORY.md.lock does not fix the issue
  • Updating MEMORY.md file directly works (workaround)

Analysis

Possible root causes:

  1. Concurrency lock conflict — Memory storage uses system-level file locks; repeated locking by same thread triggers EDEADLK
  2. Async/Sync mixing — Memory write uses blocking I/O inside async event loop
  3. HTTP connection pool exhaustion — High-frequency API calls exhaust the pool
  4. Dependency bug — Possible issue in httpx/anyio/OpenAI SDK on Windows

Workaround

Edit C:\Users\<user>\AppData\Local\hermes\memories_backup\MEMORY.md directly with Python/os module.

Labels

bug, windows, memory

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

hermes - 💡(How to fix) Fix `[Bug] Memory tool fails with "Errno 36 Resource deadlock avoided" on Windows`