{"record":{"id":"58d87b7c83350d09","repo":"thedotmack/claude-mem","slug":"deep-probe-failed-at-query-stage","errorCode":null,"errorMessage":"Deep probe failed at query stage","messagePattern":"Deep probe failed at query stage","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/services/sync/ChromaMcpManager.ts","lineNumber":924,"sourceCode":"    }\n\n    const queryStartedAt = Date.now();\n    try {\n      await this.callTool('chroma_query_documents', {\n        collection_name: 'cm__claude-mem',\n        query_texts: ['ping'],\n        n_results: 1\n      });\n      const queryLatencyMs = Date.now() - queryStartedAt;\n      return { ok: true, stage: 'done', collections, queryLatencyMs };\n    } catch (error) {\n      const queryLatencyMs = Date.now() - queryStartedAt;\n      const rawMessage = error instanceof Error ? error.message : String(error);\n      const isMissingOrEmpty = /not exist|missing|empty|no such/i.test(rawMessage);\n      const errorMessage = isMissingOrEmpty\n        ? `collection cm__claude-mem missing or empty (${rawMessage})`\n        : rawMessage;\n      logger.warn('CHROMA_MCP', 'Deep probe failed at query stage', {\n        error: rawMessage,\n        queryLatencyMs\n      });\n      return {\n        ok: false,\n        stage: 'query',\n        error: errorMessage,\n        collections,\n        queryLatencyMs\n      };\n    }\n  }\n\n  /**\n   * Singleton enforcement helper (#2313): tree-kill the currently tracked\n   * chroma-mcp subprocess and reset all state so the next spawn starts clean.\n   *\n   * Why this is the singleton invariant: every code path that intends to","sourceCodeStart":906,"sourceCodeEnd":942,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/8bc631a71a487424b866756e43a6efa4574cc66b/src/services/sync/ChromaMcpManager.ts#L906-L942","documentation":"Final probe stage: a real query against collection cm__claude-mem failed after listing succeeded. Errors matching /not exist|missing|empty|no such/i are normalized to 'collection missing or empty' — the expected first-run state before any documents sync. Any other error is a genuine query failure: embedding backend problems, timeouts, or collection corruption.","triggerScenarios":"Fresh install where cm__claude-mem was never created (benign); embedding function unavailable or dimensionality mismatched after a model change; chroma query timeout measured via queryLatencyMs; corrupted collection metadata.","commonSituations":"First run before initial sync; chroma rebuilt with a different embedding model; slow disks causing query timeouts.","solutions":["If the normalized error says missing/empty on a fresh install, ignore it — the first sync creates the collection","Otherwise inspect error plus queryLatencyMs: high latency points to resource pressure","Trigger a sync/backfill so the collection is created, then re-probe","For embedding-mismatch errors, back up and rebuild the chroma collection from source data"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const probe = await chromaManager.probeSemanticSearch();\nif (!probe.ok && probe.stage === 'query') {\n  if (/missing or empty/.test(probe.error ?? '')) {\n    // first run before initial sync — expected, no action\n  } else {\n    // real query failure: inspect error and queryLatencyMs\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat 'collection missing or empty' on fresh installs as the normal pre-sync state","After changing embedding models, rebuild the collection to avoid dimension mismatches","Track queryLatencyMs over time to catch resource pressure before it becomes failure"],"tags":["chroma","probe","semantic-query","first-run"],"backgroundTag":"vector-query-failed","analyzedSha":"8bc631a71a487424b866756e43a6efa4574cc66b","analyzedAt":"2026-08-20T23:58:13.836Z","contentChangedAt":"2026-08-20T23:58:13.836Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}