Skip to content

reindex --embeddings reports success (exit 0) when every entity fails to embed #1237

Closed

Description

@phernandez

Finding (Milvus tire-kick session, #1235)

bm reindex --embeddings against a manifest owned by another external index fails for
every entity — correctly, via SemanticVectorIndexExtensionError ("Cannot mutate vector
manifests owned by external indexes ['milvus']... Restore the owning adapter and retry.")
— but the CLI:

  • prints only Embeddings complete: 0 entities embedded, 0 skipped, 226 errors
  • then prints Reindex complete!
  • and exits 0.

The instructive guard message lands only in basic-memory.log as per-entity WARNINGs. A
user who flipped the adapter has no visible explanation and no failing exit code; total
failure reads as success. The same surface applies to any systematic per-entity embed
failure (e.g. unreachable Milvus during reindex).

Proposal

When embed errors > 0: show a representative error message (first distinct error) in the
CLI output, and exit non-zero when errors == attempted (total failure). Partial failures
can stay exit 0 with the sample error shown.

Activity

  1. claude commented on Aug 11, 2026

    @claude
    Contributor

    Claude finished @phernandez's task in 55s —— View job


    Triage

    Type: Bug

    Priority: Medium — no data loss and note content is unaffected (this is a derived/index-state reporting bug per this repo's consistency model), but it produces a false-success signal: exit 0 and a "complete" message even when 100% of entities failed to embed. That's a real problem for anything scripting bm reindex --embeddings (CI, cron, automation) since there's no non-zero exit to gate on, and the actionable error (SemanticVectorIndexExtensionError) is buried in basic-memory.log instead of the CLI output.

    Component: CLI (bm reindex --embeddings) / search indexing — src/basic_memory/cli/commands/db.py around the Embeddings complete: ... errors print (~line 457) and Reindex complete! (~line 474). Not cloud-specific; the same reporting gap would hit any backend that fails per-entity embedding (unreachable Milvus, adapter misconfiguration, etc.), local or cloud.

    Complexity: Simple–Medium. Verified the code path: stats["errors"] is printed but never inspected — no branch surfaces a sample error message or maps to a non-zero exit. Confirmed against source directly. Likely needs search_service.reindex_vectors (or the stats it returns) to carry a representative error message/exception, plus a CLI-side check for errors == attempted → non-zero exit, errors > 0 → print the sample error.

    Checked for duplicates — not a dupe of #1184 (that was a silent no-op, 0 attempted/0 errors on an unsynced project); this is 0 embedded of 226 attempted, all erroring, still reported as success. Related in theme to #1236 from the same tire-kick session but distinct.

    Labels applied: bug. No cloud-specific component label needed.

  2. added
    enhancementNew feature or request
    and removed
    bugSomething isn't working
    on Aug 11, 2026
  3. phernandez commented on Aug 11, 2026

    @phernandez
    MemberAuthor

    Triaged as a UX/output issue: the fix direction is richer reindex reporting rather than just error propagation — show what was actually indexed (per vector-index ownership counts, embedded/skipped/errors) and surface a representative error message in the CLI when errors occur, with a non-zero exit reserved for total failure. The per-entity guard messages currently visible only in basic-memory.log should be summarized in the command output.

  4. added this to the v0.23 milestone on Aug 11, 2026
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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions