Skip to content

Indexing completes but DB is empty (all zeros) — macOS arm64 v0.6.0 #260

@natgitinit

Description

@natgitinit

index_repository runs the full pipeline to completion (structure, extract, resolve, route_match) but the resulting .db file contains only zero bytes. No data is persisted. Queries against the project return "project not found or not indexed" even though list_projects shows it exists.

On first attempt the process ended with a segfault after the route_match pass. On second attempt (after clearing both the project DB and _config.db), it exited cleanly (exit code 0) but the DB was still all zeros.

Environment

  • Version: 0.6.0 (standard binary)
  • Platform: macOS Darwin 24.6.0, Apple Silicon (arm64), 16GB RAM
  • Binary: Mach-O 64-bit executable arm64 (169MB)
  • Installation: ~/.local/bin/codebase-memory-mcp via install command
  • Repository: Ruby on Rails app, ~3,267 files

### Reproduction

Clear cache

rm -f ~/.cache/codebase-memory-mcp/_config.db
rm -f ~/.cache/codebase-memory-mcp/Users-*.db

Index

codebase-memory-mcp cli index_repository '{"repo_path":"/path/to/repo","mode":"fast"}'

Check result

file ~/.cache/codebase-memory-mcp/*.db

=> "data" (not SQLite or any recognizable format)

xxd ~/.cache/codebase-memory-mcp/Users-*.db | head -5

=> all zeros

codebase-memory-mcp cli list_projects '{}'

=> shows project with nodes: 0, edges: 0, size_bytes: 13369344

codebase-memory-mcp cli search_graph '{"project":"Users-...","query":"anything"}'

=> "error": "project not found or not indexed"

Pipeline output (successful extraction, no persistence)

The pipeline completes all passes successfully:

pipeline.discover files=3267
pass.done pass=structure nodes=3824 edges=3781
parallel.extract.done nodes=20063 errors=1
parallel.registry.done entries=15070 defines=20063 imports=2
parallel.resolve.done calls=50685 usages=4023 semantic=0
pass.done pass=k8s kustomize=0 manifests=10
pass.done pass=tests tests=0
pass.route_nodes created=105
pass.route_match infra_matched=3

Memory usage was modest — rss_mb=325 peak_mb=341 out of the budget_mb=8192.

Behavior on first run (segfault)

The first attempt produced a segfault immediately after the route_match pass:

level=info msg=pass.route_match infra_matched=3
level=info msg=pass.timing pass=route_match elapsed_ms=82
[1] 77898 segmentation fault codebase-memory-mcp cli index_repository ...

Behavior on second run (clean exit, empty DB)

After clearing both _config.db and the project DB, re-running produced exit code 0 — no segfault — but the DB file was still 13MB of zeros.

Also affects MCP protocol

When called as an MCP server (via Claude Code), index_repository causes the server connection to drop. list_projects and index_status also crash the server, likely because they try to read the corrupted DB.

Expected behavior

The .db file should contain the indexed graph data (20,063 nodes, 50,685 calls) and be queryable via search_graph, trace_path, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions