Orphaned socket with no .sock.identity sidecar wedges every client permanently; no daemon log, misleading 30s timeout
Summary
If the rendezvous socket in /tmp/cbm-daemon-<uid> is left behind without its .sock.identity sidecar, every client is permanently wedged. No daemon ever starts again, the client returns CBM daemon could not start within 30000 ms, and cbm-daemon.log gets nothing at all — not even a daemon.start_failed. It never self-heals. Mine sat broken for five days across a dozen sessions before I dug into it.
This is a cousin of #1828 (same misleading timeout, same silent-drop-by-the-MCP-host outcome) but a completely different cause — /tmp had plenty of space here.
Environment
- codebase-memory-mcp 0.10.8 (official release binary,
~/.local/bin/codebase-memory-mcp) - macOS, Darwin 25.6.0, uid 501, rendezvous dir
/private/tmp/cbm-daemon-501 - Host: Claude Code, CBM registered as a local stdio server
/tmphad ~800G free the entire time, so this isn't #1828
Repro
Deterministic, takes about 30 seconds:
# 1. bring a daemon up and keep a client attached
( sleep 40 | codebase-memory-mcp >/dev/null 2>&1 & ) ; sleep 10
# 2. kill it hard so it can't clean up
kill -9 $(pgrep -f cbm-daemon-internal | head -1)
# 3. drop only the identity sidecar, leave .sock and .anc
rm -f /tmp/cbm-daemon-$(id -u)/cbm-*.sock.identity
# 4. any client now
codebase-memory-mcp <<< '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"t","version":"1"}}}'
Result:
codebase-memory-mcp: CBM daemon could not start within 30000 ms
{"jsonrpc":"2.0","id":null,"error":{"code":-32001,"message":"CBM daemon could not start within 30000 ms"}}
rm the orphaned .sock and .anc and it comes back instantly.
Worth noting for contrast: step 3 is load-bearing. If you skip it and leave .sock, .anc and .sock.identity in place after the kill -9, 0.10.8 recovers fine on the next client. So the reclaim path works — it just has no answer for a socket it can't identify.
How I actually hit it (no rm involved)
A daemon from an older build died without cleanup on Sep 2, leaving cbm-<hash>.sock and cbm-<hash>.anc with no .sock.identity — that build predates the sidecar. After the binary moved to 0.10.8, every new client was wedged against those two files, permanently.
daemon-conflicts.ndjson shows the client noticing something is off, then doing nothing about it, hundreds of times:
{"event":"daemon.version_conflict","reason":"build","active_version":"pre-cohort/unknown","active_build":"0000000000000000000000000000000000000000000000000000000000000000","requested_version":"0.10.8","requested_build":"996bad5f..."}
active_build is all zeros because there's no live daemon to ask — it's inferring "pre-cohort" purely from the absence of the sidecar, and then treating a corpse as an incumbent it has to defer to forever.
Index workers hit the same wall from the other side:
CBM index worker could not start: a pre-coordination or unverified CBM generation is active
What I think should change
- Reclaim an unidentifiable socket instead of deferring to it. A
.sockwith no.sock.identitycan't belong to a running cohort-aware daemon. Try to connect; if the connect fails, unlink it and bind. Right now "I can't identify it" is treated as "it might be alive", and that state is absorbing — nothing ever leaves it. - Log something.
cbm-daemon.loghas zero lines for every one of these failures. #1828 at least gotdaemon.ipc.listen_failed. A silent failure with an empty log is the reason this cost me five days instead of five minutes. - Fix the error message, twice over. It names no cause and no path, and it's not even a timeout — the call returns in 2 seconds, then reports
30000 ms. Something likecannot claim /tmp/cbm-daemon-501/cbm-<hash>.sock: orphaned socket with no identity sidecar (remove it to recover)would have ended this immediately. - Consider a self-check on upgrade. Any pre-sidecar artifact is unusable by a cohort-aware binary by definition, so it can be swept on first run of a new build rather than poisoning things indefinitely.
This issue should be closed i think, cuz the fix commit has been merged into the main branch. @Tomauskasz @DeusData
Fix commit: https://github.com/DeusData/codebase-memory-mcp/commit/8e70590d
I can confirm that updating to v0.11.0 resolved this issue for me.
Thank you so much @phaedrus1992 for this report. The deterministic repro and the daemon-conflicts.ndjson excerpt made it easy to confirm, and we're sorry it cost you five days.
This is fixed by 8e70590d (from #1760, thanks to @mvanhorn), which shipped in v0.11.0. When a crash leaves cbm-<key>.sock and its hard-linked cbm-<key>.anc but no .sock.identity record, activation now proves under the startup lock that the two names are the same owner-private socket inode with exactly two links, and that no live daemon holds the lifetime reservation. Then it removes them and starts a fresh daemon. We deliberately did not make it "unlink anything we can't identify": an endpoint that doesn't match that exact shape is still preserved, so cbm never deletes a socket it can't prove is its own and dead.
We re-ran your sequence on current main and the next client comes up in about 3 seconds; with the fix reverted it gives exactly your "could not start within 30000 ms". Thanks also to @Alizestl for pointing to the commit and @AaronAsAChimp for confirming on v0.11.0.
Your point about the misleading timeout text and the empty daemon log on other refusal paths is well taken, and we're tracking that separately. Closing as fixed in v0.11.0 (8e70590d).