{"record":{"id":"2289988f3e8281c2","repo":"MemPalace/mempalace","slug":"paginate-ids-both-offset-based-pagination-and-th","errorCode":null,"errorMessage":"_paginate_ids: both offset-based pagination and the no-offset fallback failed after collecting {len(ids)} ids. 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). Underlying error: {fallback_exc}","messagePattern":"_paginate_ids: both offset-based pagination and the no-offset fallback failed after collecting (.+?) ids\\. 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\\)\\. Underlying error: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"mempalace/repair.py","lineNumber":218,"sourceCode":"    ids = []\n    page = 1000\n    offset = 0\n    while True:\n        try:\n            r = col.get(where=where, include=[], limit=page, offset=offset)\n        except Exception:\n            try:\n                r = col.get(where=where, include=[], limit=page)\n            except Exception as fallback_exc:\n                # Both the offset request AND the no-offset fallback failed.\n                # Whatever is in ``ids`` so far is a partial (or empty) prefix\n                # of the collection, not a complete listing. Returning it\n                # would make scan_palace/rebuild act on a truncated palace as\n                # though it were whole (or, on the first page, print \"Nothing\n                # to scan.\" for a palace we never actually read). The whole\n                # point of this path is to fail loudly rather than silently\n                # truncate, so raise instead of breaking.\n                raise RuntimeError(\n                    f\"_paginate_ids: both offset-based pagination and the \"\n                    f\"no-offset fallback failed after collecting {len(ids)} \"\n                    f\"ids. Refusing to return a silently truncated ID list -- \"\n                    f\"investigate the collection, or use a repair mode that \"\n                    f\"does not depend on offset paging (e.g. --mode \"\n                    f\"from-sqlite). Underlying error: {fallback_exc}\"\n                ) from fallback_exc\n            new_ids = [i for i in r[\"ids\"] if i not in set(ids)]\n            if not new_ids:\n                # Offset is broken and the no-offset fallback always\n                # re-fetches the same first `page` results, so it can never\n                # advance past that boundary. Landing exactly on that\n                # boundary (len(ids) >= page) is ambiguous from the fetched\n                # page alone: it could mean \"collection has exactly `page`\n                # ids, genuinely complete\" or \"collection has more and we\n                # are truncating\" -- those two states are indistinguishable\n                # without an authoritative count. Disambiguate against the\n                # collection's own count() (same pattern already used by","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/repair.py#L200-L236","documentation":"Error \"_paginate_ids: both offset-based pagination and the no-offset fallback failed after collecting {len(ids)} ids. 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). Underlying error: {fallback_exc}\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/repair.py:218 when the library encounters an invalid state.","commonSituations":"Both offset pagination and the no-offset fallback failed; returning would silently truncate the id list.","solutions":["Investigate the collection, or use a repair mode that does not depend on offset paging (e.g. --mode from-sqlite)"],"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"}