Skip to content

index_repository crashes at dump phase — all modes affected #1379

Description

@xx235300

Version

codebase-memory-mcp 0.9.0

Platform

macOS (Apple Silicon)

Install channel

GitHub release archive / install.sh / install.ps1

Binary variant

standard

What happened, and what did you expect?

Bug Report: index_repository crashes at dump phase — all modes affected

Repository: DeusData/codebase-memory-mcp


Environment

Item Value
OS macOS 15.6.1 (24G90), Apple Silicon (arm64)
Version codebase-memory-mcp 0.9.0
Shell zsh
Disk space 124 GiB available
Cache dir ~/.cache/codebase-memory-mcp/ (only _config.db, no logs/ subdirectory)

Expected Behavior

Index completes successfully and list_projects shows the indexed project.

Actual Behavior

All pipeline phases run to completion successfully, then crash at the final dump phase:

level=info  msg=pass.complexity functions=220
level=info  msg=pass.timing pass=complexity elapsed_ms=0
level=error msg=pipeline.err phase=dump

Final output:

{
  "project": "test-project",
  "status": "error",
  "hint": "Pipeline failed. Check repo_path exists and contains source files. Try mode='fast' for a quicker diagnostic run."
}

Worker exits with code 1:

level=info  msg=index.supervisor.reap outcome=exit_nonzero exit_code=1 signal=0
level=warn  msg=index.supervisor.worker_failed outcome=exit_nonzero exit_code=1 ...

After failure, list_projects returns {"projects":[],...} — no partial index is retained.

Pipeline Statistics (all successful before dump crash)

Phase Result
structure 122 nodes, 121 edges
parallel_extract 750 nodes, 0 errors (118 files)
registry_build 254 entries, 750 defines, 409 imports
parallel_resolve 699 calls, 8 usages
complexity 220 functions
dump crash

Additional Observations

  • The referenced worker log file (~/.cache/codebase-memory-mcp/logs/.worker-*.log) does not exist. The logs/ directory is never created, suggesting the dump crash happens before any log file is opened.
  • All three modes (full, moderate, fast) fail identically at dump.
  • --persistence true and --persistence false both fail identically.
  • The project used for testing contains 116 source files (HTML, JS, CSS, Markdown), but the failure is believed to be path-independent — it occurs before any on-disk state is written.
  • codebase-memory-mcp update confirms 0.9.0 is latest.

Suggested Investigation

The dump phase appears to be the serialization/persistence step. Possible causes:

  1. Missing target directory: if dump tries to write to ~/.cache/codebase-memory-mcp/ or a project subdirectory that doesn't exist and fails to create it silently.
  2. Nil pointer / unhandled edge case: the pipeline produces valid data (750 nodes) but the serializer encounters a nil or unexpected value.
  3. File permission error swallowed: on macOS, sandboxing or permission restrictions may prevent writing to the cache path without surfacing a clear error message.

A panic stack trace or more verbose dump-phase logging would help narrow this down significantly.

Reproduction

Reproduction

# Step 1: index any project
codebase-memory-mcp cli index_repository \
  --repo-path "/path/to/any/project" \
  --mode fast \
  --name test-project

# Step 2: verify — always empty
codebase-memory-mcp cli list_projects
# Output: {"projects":[]}

All pipeline phases complete (750 nodes extracted, 220 functions), but list_projects never shows the project. Reproduced with all three modes (full, moderate, fast) and both --persistence true / false.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstability/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