diff --git a/docs/guide_rag.md b/docs/guide_rag.md index 600a0381..b07329b7 100644 --- a/docs/guide_rag.md +++ b/docs/guide_rag.md @@ -524,6 +524,29 @@ caller (`_init_vector_store_result()`) sees the error in the `.errors` list and can recreate the collection. This is the canonical "SDK boundary catches, convert to ErrorInfo" pattern in action. +### Troubleshooting: `'NoneType' object has no attribute 'get'` in `rag_status` + +If `rag_status` shows `error: 'NoneType' object has no attribute 'get'`, +the cause is `RAGEngine.get_all_indexed_paths()` (line ~331) iterating +over `res["metadatas"]` and calling `m.get("path")` where `m` is `None` +(documents stored without metadata in chromadb). + +**Fix:** the `m is not None and m.get("path")` guard is in place as of +the `rag_test_failures_20260615` track. If you see this error after +that track, it's a regression — check `src/rag_engine.py:331`. + +A secondary related bug was the dim check (`if not embeddings`) +raising `ValueError: The truth value of an array with more than one +element is ambiguous. Use a.any() or a.all()` on non-empty numpy +arrays, which then surfaced as a downstream `NoneType.get` when +`__init__` set `self.collection = None`. That fix is the +`embeddings is None` check at `src/rag_engine.py:150`. + +If the error is `error: Database error: error returned from database: +(code: 1) no such table: tenants`, the chromadb SQLite database is +in a corrupted state. Wipe the project's `.slop_cache/chroma_*` +directories and restart. + ### See Also (in-doc) - [`conductor/code_styleguides/error_handling.md`](../conductor/code_styleguides/error_handling.md) — canonical styleguide (5 patterns, data model, decision tree, anti-patterns)