docs(rag): add troubleshooting section for NoneType.get error
Documents the two bugs fixed in the rag_test_failures_20260615 track:
1. get_all_indexed_paths: m.get('path') failing on None metadata
2. _validate_collection_dim_result: 'if not embeddings' raising
ValueError on non-empty numpy arrays
Also documents the 'no such table: tenants' chromadb corruption
symptom (wipe .slop_cache/chroma_* to recover).
Plus: 'rag_status' shows 'error: ' prefix is the failure indicator;
the actual error message is the part after the prefix.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user