{"record":{"id":"9e6f1d44588a69e9","repo":"hashicorp/nomad","slug":"failed-to-get-source-last-index-w","errorCode":null,"errorMessage":"failed to get source last index: %w","messagePattern":"failed to get source last index: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"helper/raftutil/migrate.go","lineNumber":259,"sourceCode":"\n// verifyMigration performs sanity checks on the migrated data.\n// src and dst should implement both LogStore and StableStore interfaces.\nfunc verifyMigration(src interface {\n\traft.LogStore\n\traft.StableStore\n}, dst interface {\n\traft.LogStore\n\traft.StableStore\n}) error {\n\t// Verify log index ranges match.\n\tsrcFirst, err := src.FirstIndex()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get source first index: %w\", err)\n\t}\n\n\tsrcLast, err := src.LastIndex()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get source last index: %w\", err)\n\t}\n\n\tdstFirst, err := dst.FirstIndex()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get destination first index: %w\", err)\n\t}\n\n\tdstLast, err := dst.LastIndex()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get destination last index: %w\", err)\n\t}\n\n\tif srcFirst != dstFirst {\n\t\treturn fmt.Errorf(\"first index mismatch: source=%d, destination=%d\", srcFirst, dstFirst)\n\t}\n\n\tif srcLast != dstLast {\n\t\treturn fmt.Errorf(\"last index mismatch: source=%d, destination=%d\", srcLast, dstLast)","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/helper/raftutil/migrate.go#L241-L277","documentation":"Fires in verifyMigration when querying LastIndex on the source raft log store returns an error; the migration's index-range comparison cannot proceed because the source range is unreadable.","triggerScenarios":"Thrown at helper/raftutil/migrate.go:259 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the source BoltDB store for corruption or lock contention","Re-run the migration after fixing the underlying storage issue","Fall back to the pre-migration BoltDB backup if verification keeps failing"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}