{"record":{"id":"ae8c55ec35199550","repo":"microsoft/FASTER","slug":"invalid-version","errorCode":null,"errorMessage":"Invalid version","messagePattern":"Invalid version","errorType":"exception","errorClass":"FasterException","httpStatus":null,"severity":"error","filePath":"cs/src/core/Index/Common/Contexts.cs","lineNumber":814,"sourceCode":"            table_size = long.Parse(value);\n\n            value = reader.ReadLine();\n            num_ht_bytes = ulong.Parse(value);\n\n            value = reader.ReadLine();\n            num_ofb_bytes = ulong.Parse(value);\n\n            value = reader.ReadLine();\n            num_buckets = int.Parse(value);\n\n            value = reader.ReadLine();\n            startLogicalAddress = long.Parse(value);\n\n            value = reader.ReadLine();\n            finalLogicalAddress = long.Parse(value);\n\n            if (cversion != CheckpointVersion)\n                throw new FasterException(\"Invalid version\");\n\n            if (checksum != Checksum())\n                throw new FasterException(\"Invalid checksum for checkpoint\");\n        }\n\n        public void Recover(Guid guid, ICheckpointManager checkpointManager)\n        {\n            this.token = guid;\n            var metadata = checkpointManager.GetIndexCheckpointMetadata(guid);\n            if (metadata == null)\n                throw new FasterException(\"Invalid index commit metadata for ID \" + guid.ToString());\n            using (StreamReader s = new(new MemoryStream(metadata)))\n                Initialize(s);\n        }\n\n        public readonly byte[] ToByteArray()\n        {\n            using (MemoryStream ms = new())","sourceCodeStart":796,"sourceCodeEnd":832,"githubUrl":"https://github.com/microsoft/FASTER/blob/321d872eabda6a0345c8bd76419f89723ed864ae/cs/src/core/Index/Common/Contexts.cs#L796-L832","documentation":"FasterKV throws this during index checkpoint recovery when the checkpoint's stored CheckpointVersion does not match the CheckpointVersion this build of the library expects. It guards against loading a checkpoint file written by an incompatible (older or newer) version of the engine. Recovery is aborted before any state is deserialized.","triggerScenarios":"Calling Recover/RecoverIndexCheckpoint (directly or via a recovery/token-based open) with a checkpoint whose metadata file was written by a different FASTER version, or with a checkpoint metadata stream whose 'cversion' line was altered or truncated.","commonSituations":"Upgrading the FASTER library (or the .NET runtime assembly version) and then trying to open an index checkpoint created by the previous version; copying checkpoint files across deployments built from different source trees; hand-editing or partially-written checkpoint metadata.","solutions":["Recreate the checkpoint using the current library version (take a fresh checkpoint under the deployed binary)","Restore the original binary version that produced the checkpoint, recover the data, re-checkpoint, then upgrade","Verify the checkpoint metadata file is complete and not corrupted or hand-edited (first lines must include the checkpoint version)"],"exampleFix":"// before: opening old checkpoint with upgraded library\nfasterKV.Recover(checkpointToken);\n// after: migrate by re-checkpointing with the old version first\n// (run with old lib): await fasterKV.TakeFullCheckpointAsync();\n// (run with new lib): rebuild from logs or re-checkpoint, then:\nfasterKV.Recover(newToken);","handlingStrategy":"validation","validationCode":"// Before recovering, ensure the checkpoint came from the same library version\n// Store your application/library version alongside tokens:\nif (savedLibraryVersion != typeof(FasterKV<,>).Assembly.GetName().Version)\n    throw new InvalidOperationException(\"Checkpoint was written by an incompatible FASTER version; re-checkpoint before upgrading\");","typeGuard":null,"tryCatchPattern":"try { fasterKV.Recover(token); }\ncatch (FasterException ex) when (ex.Message == \"Invalid version\")\n{\n    // fall back to rebuilding from log or restoring compatible binary\n}","preventionTips":["Record the FASTER library version with every checkpoint token you persist","Always test checkpoint/recovery round-trips before and after library upgrades","Never hand-edit checkpoint metadata files","Keep full checkpoints (not just incremental) in the retention window"],"tags":["checkpoint","recovery","version-mismatch","faster"],"backgroundTag":"incompatible-source-type","analyzedSha":"321d872eabda6a0345c8bd76419f89723ed864ae","analyzedAt":"2026-09-15T22:18:00.693Z","contentChangedAt":"2026-09-15T22:18:00.693Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}