{"record":{"id":"bbe7d94b907dd348","repo":"kopia/kopia","slug":"unable-to-decrypt-local-index","errorCode":null,"errorMessage":"unable to decrypt local index","messagePattern":"unable to decrypt local index","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"repo/content/committed_read_manager.go","lineNumber":205,"sourceCode":"\t}\n\n\tpostamble.localIndexOffset -= uint32(offset) //nolint:gosec\n\n\t//nolint:gosec\n\tif uint64(postamble.localIndexOffset+postamble.localIndexLength) > uint64(payload.Length()) {\n\t\t// invalid offset/length\n\t\treturn errors.Errorf(\"unable to find valid local index in file %v - invalid offset/length\", packFile)\n\t}\n\n\tvar encryptedLocalIndexBytes gather.WriteBuffer\n\tdefer encryptedLocalIndexBytes.Close()\n\n\tif err := payload.AppendSectionTo(&encryptedLocalIndexBytes, int(postamble.localIndexOffset), int(postamble.localIndexLength)); err != nil {\n\t\t// should never happen\n\t\treturn errors.Wrap(err, \"error appending to local index bytes\")\n\t}\n\n\treturn errors.Wrap(\n\t\tsm.decryptAndVerify(encryptedLocalIndexBytes.Bytes(), postamble.localIndexIV, output),\n\t\t\"unable to decrypt local index\")\n}\n\n// +checklocks:sm.indexesLock\nfunc (sm *SharedManager) loadPackIndexesLocked(ctx context.Context) error {\n\tctx0 := contentlog.WithParams(ctx,\n\t\tlogparam.String(\"span:loadindex\", contentlog.RandomSpanID()))\n\n\tnextSleepTime := 100 * time.Millisecond //nolint:mnd\n\n\tfor i := range indexLoadAttempts {\n\t\tctx := contentlog.WithParams(ctx0,\n\t\t\tlogparam.Int(\"loadAttempt\", i))\n\n\t\tibm, err0 := sm.indexBlobManager(ctx)\n\t\tif err0 != nil {\n\t\t\treturn err0","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/repo/content/committed_read_manager.go#L187-L223","documentation":"Wrapper in attemptReadPackFileLocalIndex: decrypting the extracted local-index section failed (wrong key, corrupt ciphertext, or tampered pack), so the optimized local-index read cannot produce usable index data.","triggerScenarios":"Thrown at repo/content/committed_read_manager.go:205 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the repository password is correct for this repository.","Check storage integrity; restore affected blobs from backup if corrupt."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"82495e54b584c1ef6073c9e1be048f57f8aef078","analyzedAt":"2026-09-07T20:35:21.689Z","contentChangedAt":"2026-09-07T20:35:21.689Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}