{"record":{"id":"b732ca1e34ab0192","repo":"kopia/kopia","slug":"repeated-entries-field","errorCode":null,"errorMessage":"repeated Entries field","messagePattern":"repeated Entries field","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"repo/manifest/serialized.go","lineNumber":104,"sourceCode":"\treturn res, expectDelimToken(dec, objectClose)\n}\n\nfunc parseFields(dec *json.Decoder, res *manifest) error {\n\tvar seen bool\n\n\tfor dec.More() {\n\t\tl, err := stringToken(dec)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Only have `entries` field right now. Skip other fields.\n\t\tif !strings.EqualFold(\"entries\", l) {\n\t\t\tcontinue\n\t\t}\n\n\t\tif seen {\n\t\t\treturn errors.New(\"repeated Entries field\")\n\t\t}\n\n\t\tseen = true\n\n\t\tif err := decodeArray(dec, &res.Entries); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// decodeArray decodes an array of *manifestEntry and returns them in output. If\n// an error occurs output may contain intermediate state.\n//\n// This can be made into a generic function pretty easily if it's needed in\n// other places.\nfunc decodeArray(dec *json.Decoder, output *[]*manifestEntry) error {","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/repo/manifest/serialized.go#L86-L122","documentation":"When decoding a serialized manifest array, parseFields only understands the 'entries' field and rejects any manifest object that contains it more than once. \"repeated Entries field\" means the input stream is structurally malformed (duplicated field) and cannot be safely decoded.","triggerScenarios":"Decoding a manifest content blob whose JSON contains two 'entries' fields — i.e. corrupted, hand-edited, or wrongly merged manifest data fed to decodeManifestArray.","commonSituations":"Repository blob corruption (storage-level damage or partial writes); manually edited or concatenated manifest files; bugs in tools that rewrite manifest contents.","solutions":["Locate the corrupt manifest content and restore it from a backup or unaffected storage copy.","Run repository verification/repair (e.g. kopia repository verify / blob list reconciliation) to find damaged contents.","Do not hand-edit manifest blobs; regenerate the affected manifests if possible."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := decodeManifestArray(dec, &res); err != nil {\n    if strings.Contains(err.Error(), \"repeated Entries field\") {\n        // flag content as corrupted, trigger restore/verify\n    }\n    return err\n}","preventionTips":["Never hand-edit manifest blobs.","Run periodic repository verification to catch corrupted contents early.","Keep storage-level backups of manifest contents."],"tags":["go","manifest","corruption","decoding"],"backgroundTag":"schema-validation-failed","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"}