Skip to content

Index repository failed #2088

Open
Open

Description

@satyrcon

Version

codebase-memory-mcp 0.10.8

Platform

Windows (x64)

Install channel

GitHub release archive / install.sh / install.ps1

Binary variant

standard

What happened, and what did you expect?

On Windows 10 (19045), index_repository fails with:

index worker ended with exit_nonzero (exit=1, signal=0); inspect log: .../logs/.worker-log-aXXXXX

The failure is probabilistic and scales with the amount of work: repositories of a few hundred files index fine, ~450 files fail most of the time, ~900 files almost never succeed, and a 16.5k-file repository failed 48 out of 48 attempts (including 40 consecutive automated retries in mode: "fast").

Every process the tool starts — daemon, CLI client, and index worker alike — logs this at startup, which looks like the root cause:

level=warn msg=mem.allocator.preloading_completed still_preloading=false
  detail=allocator_was_still_preloading,_so_arena_creation_and_purging_were_disabled;_process_init_completed_explicitly

If arena creation really is disabled for the lifetime of the process, the worker can only ever live inside its initial arena, which would explain both the randomness and the correlation with workload size.

There are no entries in the Windows Application event log for these exits, so this is a controlled exit(1) from an internal guard, not an access violation.

Environment

  |   -- | -- OS | Windows 10 Pro 22H2, build 10.0.19045.2846, x64 CPU / RAM | Intel i5-11400 (12 threads) / 32 GB Node / npm | v20.19.6 / 10.8.2 Package | codebase-memory-mcp 0.10.8 (also tested 0.10.6) Install | npm install -g codebase-memory-mcp → codebase-memory-mcp install Repository | private; mixed .NET Framework 4.6.2 / .NET 9 solution + Angular UI. 16,509 tracked files: 7,258 .cs, 1,846 .ts, 1,521 .sql, 762 .html, 697 .scss. Max path length 115 chars.


Measured failure rates

Each row is repeated runs of the same target. Synthetic targets are flat directories of .cs files copied out of the same project, so content is held constant and only file count varies.

Target | Files | 0.10.8 | 0.10.6 -- | -- | -- | -- TKService.Models | 36 | ok | — RESTService | 92 | ok (repeatedly) | — synthetic t150 | 150 | 1/1 ok | — synthetic t300 | 300 | 1/1 ok | — synthetic t450 | 450 | 1 of 7 | 3 of 3 synthetic t600 | 600 | 1 of 2 | — TDServer.ClientsModel/Models | 892 | 1 of 13 | 0 of 1 whole repository | 16,509 | 0 of 48 | 0 of 1

0.10.6 looked noticeably more stable than 0.10.8 in the 450-file band (3/3 vs 1/7), which suggests a regression somewhere between the two native runtimes — but 0.10.6 still cannot index the full repository.

What the logs show

The worker log ends immediately after initialization, before any pipeline stage is recorded:

{"level":"control","event":"index.worker.start","version":"0.10.8","build":"b4b403b1...","pid":"344208","repo_path":"C:/.../clients-git", ...}
level=warn msg=mem.allocator.preloading_completed still_preloading=false detail=allocator_was_still_preloading,_so_arena_creation_and_purging_were_disabled;_process_init_completed_explicitly
level=info msg=mem.allocator.owned classes=all
level=info msg=mem.budget.worker_cap cap_bytes=2989006899
level=info msg=mem.init budget_mb=2850 total_ram_mb=32577 source=daemon_worker_cap
warning: passing raw JSON to 'cli index_repository' is deprecated ...

That truncation appears to be log buffering rather than an early crash: on a run that succeeded, the same log contained the full pass-by-pass trace and ended with index.worker.fast_exit action=_Exit. So the buffer is flushed on the normal _Exit path but lost when the worker aborts — which is exactly the case where the log matters. Making the worker log line-flushed (or flushed on the abort path) would make this class of failure diagnosable.

Corresponding daemon-side lines:

level=warn msg=mcp.request protocol=jsonrpc method=tools/call tool=index_repository status=error duration_ms=2027
level=info msg=index.supervisor.reap outcome=killed exit_code=1 signal=0
level=warn msg=index.supervisor.worker_cancelled outcome=killed log=.../.worker-log-a93792

Ruled out

I checked these before filing, all with the same result:

  • Not the MCP transport. Identical failure through Claude Code's native MCP client, through a hand-written stdio JSON-RPC driver, and through cli index_repository.
  • Not the mode. full, moderate, fast behave the same.
  • Not memory budget. CBM_MEM_BUDGET_MB at 512 / 2048 / 4096 / 16384 / 28000 — no effect on the outcome. One success at 4096 on the 892-file target did not reproduce (0 of 4 immediately after).
  • Not thread count. CBM_WORKERS=1, CBM_WORKERS=2, CBM_INDEX_SINGLE_THREAD=1 — no effect.
  • Not source retention. CBM_RETAIN_TOTAL_MB=128, CBM_RETAIN_PER_FILE_MB=4 — no effect.
  • Not a timeout. CBM_INDEX_WORKER_TIMEOUT_S=3600 (set on the daemon process) — no effect.
  • Not node_modules / ignored dirs. Subprojects containing no node_modules fail at the same file counts.
  • Not path length or non-ASCII paths. Longest path is 115 chars; a Cyrillic-named file was indexed successfully in a passing run.
  • Not folder redirection. %LOCALAPPDATA% is a real local directory on C:, not a reparse point, despite the machine being domain-joined with HOMEDRIVE=Z:.
  • Not process sandboxing. Same behaviour with the calling shell's sandbox disabled.
  • Not repo size in bytes alone. Trimming non-code files would only cut the set from 16,509 to 13,363, still far above the ~500-file band where failures start.

Secondary issues found along the way

  1. The real error is hidden at the default log level. cli index_repository exits 1 and prints nothing; index worker ended with exit_nonzero (...) only surfaces with CBM_LOG_LEVEL=debug. That message should be printed unconditionally.

  2. Worker log is lost precisely on failure. See above — buffered output is dropped when the worker aborts.

  3. Deprecation warning fires when flags are used. Running cli index_repository --repo-path ... --name ... still logs warning: passing raw JSON to 'cli index_repository' is deprecated ... use flags, presumably because the client converts flags to JSON internally before dispatch. Confusing when you are already on the recommended path.

  4. codebase-memory-mcp install fails to register some hooks on first run. On a clean install:

    error: agent_config agent=Claude Code op=hook_register path=C:/Users/<user>/.claude/settings.json (target: regular file, 1742 bytes)
    error: agent_config agent=Claude Code op=hook_register path=C:/Users/<user>/.claude/settings.json (target: regular file, 2615 bytes)
    error: one or more agent configurations failed
    

    The reported file size differs between the two errors, which looks like a read-modify-write race between successive hook registrations against the same settings.json. Re-running install completed the remaining hooks and produced no duplicates, so it is recoverable — but the first run exits non-zero with a partially configured agent.

Happy to help

I can rerun any instrumented build or diagnostic command on this machine — the failure reproduces within seconds, and a build with a line-flushed worker log would probably pinpoint it immediately.

Reproduction

codebase-memory-mcp cli index_repository --repo-path "C:/path/to/repo" --name myrepo

Note: at the default log level the CLI prints nothing at all and just exits 1. The actual message (index worker ended with exit_nonzero) only appears with CBM_LOG_LEVEL=debug. See "Secondary issues" below.

Measured failure rates

Each row is repeated runs of the same target. Synthetic targets are flat directories of .cs files copied out of the same project, so content is held constant and only file count varies.

Target | Files | 0.10.8 | 0.10.6 -- | -- | -- | -- TKService.Models | 36 | ok | — RESTService | 92 | ok (repeatedly) | — synthetic t150 | 150 | 1/1 ok | — synthetic t300 | 300 | 1/1 ok | — synthetic t450 | 450 | 1 of 7 | 3 of 3 synthetic t600 | 600 | 1 of 2 | — TDServer.ClientsModel/Models | 892 | 1 of 13 | 0 of 1 whole repository | 16,509 | 0 of 48 | 0 of 1

0.10.6 looked noticeably more stable than 0.10.8 in the 450-file band (3/3 vs 1/7), which suggests a regression somewhere between the two native runtimes — but 0.10.6 still cannot index the full repository.

Logs


Diagnostics trajectory (memory / performance / leak issues)


Project scale (if relevant)

No response

Confirmations

  • I searched existing issues and this is not a duplicate.
  • My reproduction uses shareable code (a dummy snippet or a public OSS repository), not proprietary code.

Activity

  1. added
    priority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.
    and removed
    ux/behaviorDisplay bugs, docs, adoption UX
    on Sep 9, 2026
  2. DeusData commented on Sep 25, 2026

    @DeusData
    Owner

    Hi @satyrcon, thank you for one of the most thorough reports we've had: failure rates by file count, the version comparison and the long list of ruled-out causes saved us a lot of time.

    Here's what your logs tell us. The daemon line index.supervisor.reap outcome=killed exit_code=1 followed by worker_cancelled means the daemon itself stopped the worker through its Windows job object. That forced termination is why the worker log stops right after init. It isn't buffering: the worker's stderr is unbuffered from its first write. The mem.allocator.preloading_completed warning is harmless; every process logs it, including your successful runs. Together with duration_ms=2027, the pattern looks like the index job being cancelled about 2 s in. Small repos finish before that point and large ones never do, which would explain why failures grow with file count.

    Since 0.10.8 we've shipped a lot of Windows worker-supervision work in v0.11.0 (worker memory budgets and diagnostics, session scoping for the worker, handling of abandoned requests). One more Windows worker fix is on main for the next patch release. Could you please:

    1. Retry on v0.11.0 with the same 450-file and 892-file targets and tell us the success rate.
    2. If it still fails, run one CLI attempt with CBM_LOG_LEVEL=debug and paste: the exact error line the CLI prints, the daemon log lines from index.supervisor.spawn through index.supervisor.reap, and any session/disconnect/cancel lines around them. Please don't include the full worker log from your private repo.
    3. Tell us which MCP client or driver timeout applies. With your hand-written stdio driver, does it close the connection or send notifications/cancelled before the result arrives?

    The settings.json hook-registration error you found on first install is tracked in #2044, so we'll follow that part up there. Thanks again for offering to run instrumented builds; we may take you up on that once we see the v0.11.0 result.

  3. added
    awaiting-reporterWaiting on the reporter for info/repro; stale bot will warn then close
    on Oct 19, 2026
  4. github-actions commented on Oct 20, 2026

    @github-actions

    Thanks for the report! To move this forward we need a bit more so we can reproduce it ourselves:

    • the codebase-memory-mcp --version you're on
    • the exact steps or command you ran
    • a public repo (or a small dummy snippet) that shows the problem — please don't paste proprietary code

    Once that's here we'll pick it straight back up. Heads-up: issues left awaiting-reporter are automatically closed after a few weeks of silence, but a comment reopens the door anytime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting-reporterWaiting on the reporter for info/repro; stale bot will warn then closebugSomething isn't workingeditor/integrationEditor compatibility and CLI integrationpriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.stability/performanceServer crashes, OOM, hangs, high CPU/memorywindowsWindows-specific issues

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions