codebase-memory-mcp icon indicating copy to clipboard operation
codebase-memory-mcp copied to clipboard

never finishes indexing large python project

Open th3fallen opened this issue 5 months ago • 15 comments

Version

0.8.1

Platform

macOS (Apple Silicon)

Install channel

GitHub release archive / install.sh / install.ps1

Binary variant

ui

What happened, and what did you expect?

indexing never completes for large pthon project.

Reproduction

add new project to be indexed. cpu goes nuts for a while. then nothing.

Logs

"lines":["level=info msg=parallel.extract.progress done=158690 total=182751","level=info msg=parallel.extract.progress done=158710 total=182751","level=info msg=parallel.extract.progress done=158700 total=182751","level=info msg=parallel.extract.progress done=158720 total=182751","level=info msg=parallel.extract.progress done=158730 total=182751","level=info msg=parallel.extract.progress done=158740 total=182751","level=info msg=parallel.extract.progress done=158760 total=182751","level=info msg=parallel.extract.progress done=158750 total=182751","level=info msg=parallel.extract.progress done=158770 total=182751","level=info msg=parallel.extract.progress done=158780 total=182751","level=info msg=parallel.extract.progress done=158790 total=182751","level=info msg=parallel.extract.progress done=158800 total=182751","level=info msg=parallel.extract.progress done=158810 total=182751","level=info msg=parallel.extract.progress done=158820 total=182751","level=info msg=parallel.extract.progress done=158830 total=182751","level=info msg=parallel.extract.progress done=158840 total=182751","level=info msg=parallel.extract.progress done=158850 total=182751","level=info msg=parallel.extract.progress done=158860 total=182751","level=info msg=parallel.extract.progress done=158880 total=182751","level=info msg=parallel.extract.progress done=158870 total=182751","level=info msg=parallel.extract.progress done=158890 total=182751","level=info msg=parallel.extract.progress done=158900 total=182751","level=info msg=parallel.extract.progress done=158910 total=182751","level=info msg=parallel.extract.progress done=158920 total=182751","level=info msg=parallel.extract.progress done=158940 total=182751","level=info msg=parallel.extract.progress done=158930 total=182751","level=info msg=parallel.extract.progress done=158960 total=182751","level=info msg=parallel.extract.progress done=158950 total=182751","level=info msg=parallel.extract.progress done=158970 total=182751","level=info msg=parallel.extract.progress done=158980 total=182751","level=info msg=parallel.extract.progress done=159010 total=182751","level=info msg=parallel.extract.progress done=158990 total=182751","level=info msg=parallel.extract.progress done=159000 total=182751","level=info msg=parallel.extract.progress done=159020 total=182751","level=info msg=parallel.extract.progress done=159030 total=182751","level=info msg=parallel.extract.progress done=159040 total=182751","level=info msg=parallel.extract.progress done=159060 total=182751","level=info msg=parallel.extract.progress done=159050 total=182751","level=info msg=parallel.extract.progress done=159070 total=182751","level=info msg=parallel.extract.progress done=159080 total=182751","level=info msg=parallel.extract.progress done=159090 total=182751","level=info msg=parallel.extract.progress done=159100 total=182751","level=info msg=parallel.extract.progress done=159110 total=182751","level=info msg=parallel.extract.progress done=159120 total=182751","level=info msg=parallel.extract.progress done=159130 total=182751","level=info msg=parallel.extract.progress done=159140 total=182751","level=info msg=parallel.extract.progress done=159150 total=182751","level=info msg=parallel.extract.progress done=159160 total=182751","level=info msg=parallel.extract.progress done=159170 total=182751","level=info msg=parallel.extract.progress done=159180 total=182751","level=info msg=parallel.extract.progress done=159190 total=182751","level=info msg=parallel.extract.progress done=159200 total=182751","level=info msg=parallel.extract.progress done=159210 total=182751","level=info msg=parallel.extract.progress done=159230 total=182751","level=info msg=parallel.extract.progress done=159250 total=182751","level=info msg=parallel.extract.progress done=159240 total=182751","level=info msg=parallel.extract.progress done=159220 total=182751","level=info msg=parallel.extract.progress done=159260 total=182751","level=info msg=parallel.extract.progress done=159270 total=182751","level=info msg=parallel.extract.progress done=159280 total=182751","level=info msg=parallel.extract.progress done=159300 total=182751","level=info msg=parallel.extract.progress done=159290 total=182751","level=info msg=parallel.extract.progress done=159310 total=182751","level=info msg=parallel.extract.progress done=159320 total=182751","level=info msg=parallel.extract.progress done=159330 total=182751","level=info msg=parallel.extract.progress done=159340 total=182751","level=info msg=parallel.extract.progress done=159350 total=182751","level=info msg=parallel.extract.progress done=159360 total=182751","level=info msg=parallel.extract.progress done=159370 total=182751","level=info msg=parallel.extract.progress done=159380 total=182751","level=info msg=parallel.extract.progress done=159390 total=182751","level=info msg=parallel.extract.progress done=159400 total=182751","level=info msg=parallel.extract.progress done=159410 total=182751","level=info msg=parallel.extract.progress done=159430 total=182751","level=info msg=parallel.extract.progress done=159420 total=182751","level=info msg=parallel.extract.progress done=159440 total=182751","level=info msg=parallel.extract.progress done=159450 total=182751","level=info msg=parallel.extract.progress done=159460 total=182751","level=info msg=parallel.extract.progress done=159470 total=182751","level=info msg=parallel.extract.progress done=159490 total=182751","level=info msg=parallel.extract.progress done=159480 total=182751","level=info msg=parallel.extract.progress done=159500 total=182751","level=info msg=parallel.extract.progress done=159510 total=182751","level=info msg=parallel.extract.progress done=159520 total=182751","level=info msg=parallel.extract.progress done=159530 total=182751","level=info msg=parallel.extract.progress done=159540 total=182751","level=info msg=parallel.extract.progress done=159550 total=182751","level=info msg=parallel.extract.progress done=159560 total=182751","level=info msg=parallel.extract.progress done=159570 total=182751","level=info msg=parallel.extract.progress done=159590 total=182751","level=info msg=parallel.extract.progress done=159580 total=182751","level=info msg=parallel.extract.progress done=159600 total=182751","level=info msg=parallel.extract.progress done=159610 total=182751","level=info msg=parallel.extract.progress done=159620 total=182751","level=info msg=parallel.extract.progress done=159630 total=182751","level=info msg=parallel.extract.progress done=159640 total=182751","level=info msg=parallel.extract.progress done=159650 total=182751","level=info msg=parallel.extract.progress done=159670 total=182751","level=info msg=parallel.extract.progress done=159660 total=182751","level=info msg=ui.index.done path=/Users/clark/Sites/redacted/redacted-main rc=ok"],"total":500}

Project scale (if relevant)

182751

Confirmations

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

th3fallen avatar Jun 19 '26 15:06 th3fallen

Hey, sorry for the inconvenience. Will come back to you ASAP

DeusData avatar Jun 20 '26 18:06 DeusData

Hey @DeusData this seems interesting problem since nobody is currently working on it is it fine if i go and try to reproduce the error and if able to identify the cause work on a fix?

sahil-mangla avatar Jun 21 '26 15:06 sahil-mangla

Hey @sahil-mangla, sure try it out. Community contributions are always very welcome :)

DeusData avatar Jun 21 '26 15:06 DeusData

I investigated the UI completion path and couldn’t find an obvious logic error. I’m now attempting to reproduce the issue locally and instrument /api/index-status to determine whether this is a frontend polling issue or a backend state-transition issue.

sahil-mangla avatar Jun 21 '26 17:06 sahil-mangla

I investigated the indexing completion path and attempted to reproduce the issue locally on macOS (Apple Silicon).

Tested repositories:

  • psf/requests
  • pallets/flask
  • tiangolo/fastapi
  • django/django
  • home-assistant/core
  • pytorch/pytorch

For all repositories:

  • ui.index.done was logged successfully.
  • /api/index-status eventually returned "done".
  • The frontend polling logic called onDone().
  • The indexing spinner disappeared correctly.

I also traced the completion flow through index_thread_fn, handle_index_status, and IndexProgress and did not find an obvious logic error.

At this point I have not been able to reproduce the issue locally. The original report involved approximately 182k files, which is significantly larger than the repositories I tested. My next step is to attempt reproduction using either a very large monorepo or a synthetic repository with >150k files to determine whether the problem only manifests at extreme scales.

sahil-mangla avatar Jun 21 '26 18:06 sahil-mangla

@sahil-mangla great, thanks for your report and attempts :)

DeusData avatar Jun 21 '26 19:06 DeusData

@DeusData happy to help :) do check out the PR, the logic behind it is mentioned there.

sahil-mangla avatar Jun 21 '26 19:06 sahil-mangla

The logs actually show ui.index.done ... rc=ok at the very end, meaning the backend indexing process finishes successfully, but the UI fails to update and gets stuck on the progress state.

Given the large file count (182,751), it's likely indexing the virtual environment (.venv/venv). Adding them to the ignore list mitigates the load, but there is definitely a UI/UX bug where the frontend doesn't reflect the completed backend status.

amirhd4 avatar Jun 22 '26 08:06 amirhd4

Thanks for the report — and thanks to @amirhd4 for digging into the log.

Looking at your log, the indexer backend does finish (ui.index.done rc=ok) but the UI never reflects it. We want to reproduce this as a regression test. A few quick things would let us nail it:

Instructions for your coding agent:

# 1. Capture the full server log from startup through the stall
codebase-memory-mcp --ui=true 2>&1 | tee /tmp/cbm-524.log &
# Trigger indexing via the UI, then after it stalls (5+ minutes with no change):

# 2. Check whether the process is still alive
pgrep -la codebase-memory-mcp

# 3. Show the last 40 log lines (especially anything after ui.index.done)
tail -40 /tmp/cbm-524.log

# 4. Is .venv / node_modules being indexed?
cat /path/to/project/.cbmignore 2>/dev/null || echo "no .cbmignore"
ls -d /path/to/project/.venv /path/to/project/venv \
       /path/to/project/env 2>/dev/null

# 5. Final node/edge count from the log
grep -E 'nodes=|edges=|pipeline.done' /tmp/cbm-524.log | tail -5

The core question is: after ui.index.done rc=ok appears, is the process still alive and what is its CPU/memory? If .venv is in scope (182 k files is a strong signal), adding it to .cbmignore is an immediate workaround — but the UI not clearing a completed state is a real bug we want to fix regardless.

Thank you!

DeusData avatar Jun 26 '26 08:06 DeusData

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.

github-actions[bot] avatar Jun 26 '26 08:06 github-actions[bot]

This issue has been waiting on more information for 21 days (a version, exact steps, or a public repro), so it's now marked stale. It will be closed in 14 days if there's no update — just add a comment to keep it open. We're happy to pick it back up the moment we can reproduce it.

github-actions[bot] avatar Jul 30 '26 03:07 github-actions[bot]

Thank you for the report, and a big thank-you to @sahil-mangla and @amirhd4 for digging in! Your log showed the backend finishing (ui.index.done rc=ok) while the UI stayed stuck. That UI indexing path has since been rebuilt: since v0.10.0 it goes through the daemon's shared index job registry instead of a separate forked process. .venv, venv and site-packages are also skipped by default, which should shrink a 182k-file Python tree a lot. Could you retest on v0.11.0 and tell us whether indexing completes and shows as done? If it doesn't, the last 40 lines of the daemon log would be the key piece.

DeusData avatar Sep 25 '26 23:09 DeusData

This issue has been waiting on more information for 21 days (a version, exact steps, or a public repro), so it's now marked stale. It will not be closed automatically — a maintainer reviews stale issues by hand. Adding a comment with the details clears the label and puts it straight back in the queue. We're happy to pick it back up the moment we can reproduce it.

github-actions[bot] avatar Oct 17 '26 02:10 github-actions[bot]

Thank you for the indexing/UI report. If you have already tried a newer release, could you share its version and whether the UI now reflects completion? Please do not repeat a costly large-repository run solely for this follow-up.

DeusData avatar Oct 25 '26 17:10 DeusData

This issue has been waiting on more information for 21 days (a version, exact steps, or a public repro), so it's now marked stale. It will not be closed automatically — a maintainer reviews stale issues by hand. Adding a comment with the details clears the label and puts it straight back in the queue. We're happy to pick it back up the moment we can reproduce it.

github-actions[bot] avatar Nov 18 '26 02:11 github-actions[bot]