{"record":{"id":"07651c3fb8ab5803","repo":"MemPalace/mempalace","slug":"paginate-ids-offset-based-pagination-failed-and","errorCode":null,"errorMessage":"_paginate_ids: offset-based pagination failed and the no-offset fallback cannot advance past the first {page} results ({len(ids)} collected, collection reports {total if total is not None else 'an unreadable'} total). Refusing to return a silently truncated ID list -- investigate the collection, or use a repair mode that does not depend on offset paging (e.g. --mode from-sqlite).","messagePattern":"_paginate_ids: offset-based pagination failed and the no-offset fallback cannot advance past the first (.+?) results \\((.+?) collected, collection reports (.+?) total\\)\\. Refusing to return a silently truncated ID list -- investigate the collection, or use a repair mode that does not depend on offset paging \\(e\\.g\\. --mode from-sqlite\\)\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"mempalace/repair.py","lineNumber":258,"sourceCode":"                # HNSW-preflight-sweep work).\n                #\n                # ``col.count()`` is collection-wide and takes no ``where``\n                # argument, so it is only authoritative when this call is\n                # UNFILTERED. With a ``where`` filter, a global count > the\n                # collected rows does NOT prove the filtered set is truncated\n                # (the extra rows may belong to other wings), so we cannot use\n                # it as proof and treat filtered completeness as unknown\n                # rather than raising a false-positive truncation error.\n                # This raise is intentionally OUTSIDE the narrow try/except\n                # above so it propagates instead of being swallowed as a\n                # get()-failure.\n                if where is None and len(ids) >= page and len(r[\"ids\"] or []) >= page:\n                    try:\n                        total = col.count()\n                    except Exception:\n                        total = None\n                    if total is None or total > len(ids):\n                        raise RuntimeError(\n                            f\"_paginate_ids: offset-based pagination failed \"\n                            f\"and the no-offset fallback cannot advance past \"\n                            f\"the first {page} results ({len(ids)} collected, \"\n                            f\"collection reports \"\n                            f\"{total if total is not None else 'an unreadable'} \"\n                            f\"total). Refusing to return a silently truncated \"\n                            f\"ID list -- investigate the collection, or use a \"\n                            f\"repair mode that does not depend on offset \"\n                            f\"paging (e.g. --mode from-sqlite).\"\n                        )\n                break\n            ids.extend(new_ids)\n            offset += len(new_ids)\n            continue\n        n = len(r[\"ids\"]) if r[\"ids\"] else 0\n        if n == 0:\n            break\n        ids.extend(r[\"ids\"])","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/repair.py#L240-L276","documentation":"Error \"_paginate_ids: offset-based pagination failed and the no-offset fallback cannot advance past the first {page} results ({len(ids)} collected, collection reports {total if total is not None else 'an unreadable'} total). Refusing to return a silently truncated ID list -- investigate the collection, or use a repair mode that does not depend on offset paging (e.g. --mode from-sqlite).\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/repair.py:258 when the library encounters an invalid state.","commonSituations":"Offset pagination stalled at the first page; continuing would silently drop ids.","solutions":["Investigate the collection, or use --mode from-sqlite which does not depend on offset paging"],"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"}