{"record":{"id":"5bcee1d8595f64ed","repo":"MemPalace/mempalace","slug":"sidecar-database-not-found-sidecar-path","errorCode":null,"errorMessage":"Sidecar database not found: {sidecar_path}","messagePattern":"Sidecar database not found: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"mempalace/repair.py","lineNumber":2237,"sourceCode":"        (segment_id,),\n    ).fetchone()\n    if row is None or row[0] is None:\n        return 0\n    val = row[0]\n    if isinstance(val, (bytes, bytearray)):\n        return int.from_bytes(val, \"big\")\n    return int(val)\n\n\ndef _read_sidecar_seq_ids(sidecar_path: str) -> dict[str, int]:\n    \"\"\"Load ``{segment_id: seq_id}`` from a sidecar DB's ``max_seq_id`` table.\n\n    Rejects sidecar files whose ``max_seq_id.seq_id`` is itself BLOB-typed\n    — a sidecar that old predates chromadb's type normalisation and is not\n    a trustworthy restoration source.\n    \"\"\"\n    if not os.path.isfile(sidecar_path):\n        raise FileNotFoundError(f\"Sidecar database not found: {sidecar_path}\")\n    out: dict[str, int] = {}\n    with sqlite3.connect(sidecar_path) as conn:\n        rows = conn.execute(\"SELECT segment_id, seq_id, typeof(seq_id) FROM max_seq_id\").fetchall()\n    for segment_id, seq_id, kind in rows:\n        if kind == \"blob\":\n            raise ValueError(\n                f\"Sidecar has BLOB-typed seq_id for {segment_id}; refusing to use it. \"\n                \"Pass a sidecar that was already migrated to INTEGER rows.\"\n            )\n        out[str(segment_id)] = int(seq_id)\n    return out\n\n\ndef repair_max_seq_id(\n    palace_path: str,\n    *,\n    segment: Optional[str] = None,\n    from_sidecar: Optional[str] = None,","sourceCodeStart":2219,"sourceCodeEnd":2255,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/repair.py#L2219-L2255","documentation":"Error \"Sidecar database not found: {sidecar_path}\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/repair.py:2237 when the library encounters an invalid state.","commonSituations":"Sidecar database file for the segment was not found.","solutions":["Provide the correct sidecar path for the segment"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06cb6987f02610784fefbad4b2bd5d026d164ba6","analyzedAt":"2026-08-15T03:03:36.213Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}