Bug Description
In a local Docker deployment using Postgres (not SQLite), Basic Memory works for MCP requests and agent-driven edits, but local filesystem watcher/sync does not work reliably.
Manual markdown edits on disk are not picked up automatically, and enabling sync_changes causes crashes. I currently have to keep sync_changes: false to keep the setup usable.
Steps To Reproduce
- Run Basic Memory
0.21.5 locally in Docker with a Postgres backend (postgresql+asyncpg), with the project mounted at /app/data/main.
- Start MCP with:
basic-memory mcp --transport streamable-http --host 0.0.0.0 --port 8000 --path /mcp
- Enable
sync_changes in config.
- Make manual edits to markdown files in the mounted project directory.
- Observe watcher instability / crashes instead of reliable sync.
Expected Behavior
Manual markdown edits on disk should be detected and synced automatically when sync_changes is enabled in a local Postgres-backed deployment.
Actual Behavior
What works:
- MCP initializes and serves requests
bm project info main --json works
- agent-driven edits work
What does not work:
- manual edits to markdown files on disk are not picked up automatically
- enabling
sync_changes causes crashes
- I had to keep
sync_changes: false to keep the setup stable
Crash signature I saw:
IndexError: pop from an empty deque
Trace lands in:
/app/.venv/lib/python3.13/site-packages/anyio/_backends/_asyncio.py
/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/asyncio/base_events.py:_run_once
I also saw:
ASGI callable returned without completing response.
Relevant log snippet:
ERROR: ASGI callable returned without completing response.
File "/app/.venv/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 2358, in run
self._run_once()
File "/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/asyncio/base_events.py", line 2046, in _run_once
IndexError: pop from an empty deque
There were also repeated shutdown/restart sequences around the crash:
INFO: Shutting down
INFO: Waiting for application shutdown.
INFO: Application shutdown complete.
INFO: Finished server process [1]
Environment
- OS: Ubuntu 24.04.4 LTS
- Python version: 3.13.13
- Basic Memory version: 0.21.5
- Installation method: Docker (
ghcr.io/basicmachines-co/basic-memory:latest)
- Claude Desktop version (if applicable): N/A
Additional Context
MCP command:
basic-memory mcp --transport streamable-http --host 0.0.0.0 --port 8000 --path /mcp
Docker setup:
basic-memory container runs MCP over streamable-http
basic-memory-db is a separate postgres:16-alpine container
./data is mounted to /app/data
./config is mounted to /home/appuser/.basic-memory
Current config that stays mostly stable:
{
"database_backend": "postgres",
"sync_changes": false,
"skip_initialization_sync": true,
"sync_delay": 1000
}
One thing I noticed: bm project info main --json shows a SQLite-style system.database_path like:
"database_path": "/home/appuser/.basic-memory/memory.db",
"database_size": "0.00 MB"
even though this deployment is definitely using Postgres. That may just be a reporting issue, but I wanted to mention it.
Possible Solution
I don’t have a real fix yet, but my guess is this may be in the watcher / MCP server lifecycle / async shutdown path for the local Docker + Postgres + streamable-http combination, rather than in the core MCP request path itself.
The SQLite-looking database_path in bm project info may be unrelated and just a misleading status/reporting field.
Bug Description
In a local Docker deployment using Postgres (not SQLite), Basic Memory works for MCP requests and agent-driven edits, but local filesystem watcher/sync does not work reliably.
Manual markdown edits on disk are not picked up automatically, and enabling
sync_changescauses crashes. I currently have to keepsync_changes: falseto keep the setup usable.Steps To Reproduce
0.21.5locally in Docker with a Postgres backend (postgresql+asyncpg), with the project mounted at/app/data/main.basic-memory mcp --transport streamable-http --host 0.0.0.0 --port 8000 --path /mcpsync_changesin config.Expected Behavior
Manual markdown edits on disk should be detected and synced automatically when
sync_changesis enabled in a local Postgres-backed deployment.Actual Behavior
What works:
bm project info main --jsonworksWhat does not work:
sync_changescauses crashessync_changes: falseto keep the setup stableCrash signature I saw:
Trace lands in:
I also saw:
Relevant log snippet:
There were also repeated shutdown/restart sequences around the crash:
Environment
ghcr.io/basicmachines-co/basic-memory:latest)Additional Context
MCP command:
Docker setup:
basic-memorycontainer runs MCP overstreamable-httpbasic-memory-dbis a separatepostgres:16-alpinecontainer./datais mounted to/app/data./configis mounted to/home/appuser/.basic-memoryCurrent config that stays mostly stable:
One thing I noticed:
bm project info main --jsonshows a SQLite-stylesystem.database_pathlike:even though this deployment is definitely using Postgres. That may just be a reporting issue, but I wanted to mention it.
Possible Solution
I don’t have a real fix yet, but my guess is this may be in the watcher / MCP server lifecycle / async shutdown path for the local Docker + Postgres +
streamable-httpcombination, rather than in the core MCP request path itself.The SQLite-looking
database_pathinbm project infomay be unrelated and just a misleading status/reporting field.