{"record":{"id":"e61be5735a81cf1b","repo":"MemPalace/mempalace","slug":"label-length-len-value-does-not-match-ids-len","errorCode":null,"errorMessage":"{label} length {len(value)} does not match ids length {n}","messagePattern":"(.+?) length (.+?) does not match ids length (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mempalace/backends/base.py","lineNumber":569,"sourceCode":"        metadatas: Optional[list[dict]] = None,\n        embeddings: Optional[list[list[float]]] = None,\n    ) -> None:\n        \"\"\"Default non-atomic update: get + merge + upsert.\n\n        Backends advertising ``supports_update`` MUST override with an atomic\n        single-round-trip implementation.\n        \"\"\"\n        if documents is None and metadatas is None and embeddings is None:\n            raise ValueError(\"update requires at least one of documents, metadatas, embeddings\")\n\n        n = len(ids)\n        for label, value in (\n            (\"documents\", documents),\n            (\"metadatas\", metadatas),\n            (\"embeddings\", embeddings),\n        ):\n            if value is not None and len(value) != n:\n                raise ValueError(f\"{label} length {len(value)} does not match ids length {n}\")\n\n        existing = self.get(ids=ids, include=[\"documents\", \"metadatas\"])\n        by_id = {\n            rid: (existing.documents[i], existing.metadatas[i])\n            for i, rid in enumerate(existing.ids)\n        }\n        merged_docs: list[str] = []\n        merged_metas: list[dict] = []\n        for i, rid in enumerate(ids):\n            prev_doc, prev_meta = by_id.get(rid, (\"\", {}))\n            merged_docs.append(documents[i] if documents is not None else prev_doc)\n            new_meta = dict(prev_meta or {})\n            if metadatas is not None:\n                new_meta.update(metadatas[i] or {})\n            merged_metas.append(new_meta)\n        self.upsert(\n            documents=merged_docs,\n            ids=list(ids),","sourceCodeStart":551,"sourceCodeEnd":587,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/backends/base.py#L551-L587","documentation":"A plain FileNotFoundError from _read_sidecar_seq_ids: repair_max_seq_id(from_sidecar=...) was given a sidecar SQLite database path that does not exist as a file. The sidecar is the source of truth for restoring segment seq_ids, so the operation cannot proceed without it.","triggerScenarios":"Calling repair_max_seq_id() with from_sidecar pointing at a nonexistent or misspelled path (typo, wrong segment directory, relative path resolved from the wrong cwd).","commonSituations":"Passing a relative sidecar path while running from a different working directory; pointing at a sidecar from the wrong chromadb segment folder; the file was deleted during earlier cleanup.","solutions":["Check the path exists: sidecars live inside the palace's segment directories — locate with a find for the exact filename.","Use an absolute path to the sidecar file.","Verify you are pointing at the sidecar belonging to the affected segment, not another palace copy."],"exampleFix":"from pathlib import Path\nsidecar = Path(sidecar).expanduser().resolve()\nif not sidecar.is_file():\n    raise SystemExit(f'no sidecar at {sidecar}')\nrepair_max_seq_id(palace_path, from_sidecar=str(sidecar))","handlingStrategy":"validation","validationCode":"from pathlib import Path\np = Path(sidecar_path).expanduser().resolve()\nif not p.is_file():\n    sidecars = list(Path(palace_path).rglob('*max_seq_id*'))\n    raise SystemExit(f'not a file: {p}; candidates: {sidecars}')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass absolute, expanduser-resolved sidecar paths.","Locate the sidecar with rglob from the palace root rather than typing the segment path by hand."],"tags":["file-not-found","chromadb","sidecar","path"],"backgroundTag":null,"analyzedSha":"06cb6987f02610784fefbad4b2bd5d026d164ba6","analyzedAt":"2026-08-15T03:03:36.213Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}