You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Log rotation fails on Windows when another process holds the log file #653
Loguru log rotation fails with PermissionError: [WinError 32] when another basic-memory
process has the log file open. Typically happens when running a CLI command while the MCP
server is already running — both write to ~/.basic-memory/basic-memory.log.
Steps To Reproduce
Start the MCP server (e.g., via Claude Desktop)
Run any CLI command (e.g., bm project info)
If basic-memory.log exceeds the 10 MB rotation threshold, rotation triggers
Expected Behavior
Log rotation should succeed or fail silently when another process holds the file.
Actual Behavior
Every log message produces a loguru error, flooding stderr:
PermissionError: [WinError 32] ... cannot access the file because it is being used
by another process: '...basic-memory.log' -> '...basic-memory.2026-01-07_..._821959.log'
The command itself still completes but the output is hard to read.
Environment
OS: Windows 11
Python: 3.13.9
Basic Memory: 0.19.1
Installation: uv tool
Additional Context
The log sink in utils.py uses rotation="10 MB" with no Windows-specific handling. Loguru
uses os.rename internally, which Windows blocks if another process has the file open.
Possible Solution
We could use per-process log files to avoid the contention, or suppress the rotation error
so it doesn't repeat on every message. Not sure what the best approach is for loguru
specifically.
Activity
Fix SQLite and Windows semantic regressions