macOS: daemon becomes unreachable after its lock files in /tmp are deleted and recreated
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- c, macos
- Domain
- backend, infrastructure
Research direction
Start by tracing how the daemon chooses its runtime directory and creates or checks lock files, then inspect the client path that handles a free lock when the socket is already occupied. The report reproduces the failure on macOS and suggests moving the default runtime directory outside /tmp or detecting the live socket. Done means new clients can reach the existing daemon after /tmp cleanup, or the default directory avoids that cleanup.
Written by the indexing model from the issue text.
Description
Version: 0.10.8 (npm, macOS, Apple Silicon)
What happens
After the account daemon has been running for a few days, every new client fails with:
codebase-memory-mcp: CBM daemon could not start within 30000 ms
Clients that connected earlier keep working. The old daemon is still running and still listens on its socket.
Cause (observed)
The daemon keeps its locks in /private/tmp/cbm-daemon-<uid>/. In my case:
- The daemon started on day 0 and holds locks on the original lock files (inodes
457353xx). - About 4.5 days later, the lock files exist with new inodes (
487612xx). The socket file is still the original one. - A new client locks the new files, finds them free (
version_cohort.claimed_unheld), concludes no daemon runs and tries to start one. That fails because the old daemon still owns the socket, so the client times out.
I have not confirmed what deleted the lock files. macOS cleans /tmp of files that have not been accessed for a while, and the empty lock files are never read, so they qualify.
Workaround
Set CBM_RUNTIME_DIR to a folder outside /tmp, for example ~/.cache/codebase-memory-mcp/run, and restart the daemon.
Suggested fix
- On macOS, put the default runtime folder outside
/tmp, for example underCBM_CACHE_DIRor~/Library/Caches. - Or let a client detect this state: the lock is free, but the socket answers. The client could then connect instead of starting a second daemon, or tell the old daemon to restart.
- Dominant language
- C
- Stars
- 45.8k
- Forks
- 3.8k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 108
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DeusData/codebase-memory-mcp
-
bug ux/behavior
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
DeusData/codebase-memory-mcp#3191 ·
Maintainers usually reply within 1 day
-
documentation enhancement parsing/quality ux/behavior
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
DeusData/codebase-memory-mcp#3131 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
hook-augment: the five-row cap keeps the first five search_graph rows, so variables and modules displace function definitions (v0.12.1)Possibly taken A pull request linked to this issue is open or already merged. Openbug editor/integration parsing/quality ux/behavior
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
DeusData/codebase-memory-mcp#3062 · 2 comments ·
Maintainers usually reply within 1 day
-
bug documentation editor/integration parsing/quality
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
DeusData/codebase-memory-mcp#3050 · 1 comment ·
Maintainers usually reply within 1 day
-
editor/integration parsing/quality
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DeusData/codebase-memory-mcp#2286 ·
Maintainers usually reply within 1 day
All issues in DeusData/codebase-memory-mcp
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA/open-gpu-kernel-modules#1635 ·
Maintainers usually reply within 1 day
-
iOS: the "Edit controls" button never hides, even with a controller connected, and covers the gameOpengame: 010065A014024000 ios
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
seedds/nxnative#3714 · 1 comment ·
Maintainers usually reply within 2 days