{"record":{"id":"15d624626c89286c","repo":"docker/cli","slug":"invalid-manifest-file-v-image-manifest-digest-mi","errorCode":null,"errorMessage":"invalid manifest file %v: image manifest digest mismatch (%v != %v)","messagePattern":"invalid manifest file (.+?): image manifest digest mismatch \\((.+?) != (.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/manifest/store/store.go","lineNumber":76,"sourceCode":"\n\t\t// Deprecated Fields, replaced by Descriptor\n\t\tDigest   digest.Digest\n\t\tPlatform *manifestlist.PlatformSpec\n\t}\n\n\tif err := json.Unmarshal(bytes, &manifestInfo); err != nil {\n\t\treturn types.ImageManifest{}, err\n\t}\n\n\t// Compatibility with image manifests created before\n\t// descriptor, newer versions omit Digest and Platform\n\tif manifestInfo.Digest != \"\" {\n\t\tmediaType, raw, err := manifestInfo.Payload()\n\t\tif err != nil {\n\t\t\treturn types.ImageManifest{}, err\n\t\t}\n\t\tif dgst := digest.FromBytes(raw); dgst != manifestInfo.Digest {\n\t\t\treturn types.ImageManifest{}, fmt.Errorf(\"invalid manifest file %v: image manifest digest mismatch (%v != %v)\", filename, manifestInfo.Digest, dgst)\n\t\t}\n\t\tmanifestInfo.ImageManifest.Descriptor = ocispec.Descriptor{\n\t\t\tDigest:    manifestInfo.Digest,\n\t\t\tSize:      int64(len(raw)),\n\t\t\tMediaType: mediaType,\n\t\t\tPlatform:  types.OCIPlatform(manifestInfo.Platform),\n\t\t}\n\t}\n\n\treturn manifestInfo.ImageManifest, nil\n}\n\n// GetList returns all the local manifests for a transaction\nfunc (s *fsStore) GetList(listRef reference.Reference) ([]types.ImageManifest, error) {\n\tfilenames, err := s.listManifests(listRef.String())\n\tswitch {\n\tcase err != nil:\n\t\treturn nil, err","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli/manifest/store/store.go#L58-L94","documentation":"Returned by fsStore.getFromFilename (manifest/store/store.go:76) during the backward-compatibility path for manifests serialized with the deprecated Digest field. It recomputes the digest of the payload and compares it to the stored Digest; a mismatch means the on-disk manifest file is corrupt or was tampered with. The format prints filename, stored digest, and recomputed digest.","triggerScenarios":"Calling store.Get or store.GetList on a manifest list whose cached JSON file on disk (under ~/.docker/manifests/) contains the legacy `Digest` field but the recomputed digest of the manifest payload no longer equals it. This happens if the file was hand-edited, partially overwritten, truncated by a crash, or migrated incorrectly between docker versions.","commonSituations":"Editing ~/.docker/manifests files by hand, disk corruption, a killed `docker manifest`/`docker buildx` process that left a half-written file, or a cross-platform copy that altered line endings so the payload bytes differ from the hashed bytes.","solutions":["Delete the stale manifest cache entry: `rm -rf ~/.docker/manifests/<encoded-list-ref>` then re-run the manifest command to re-fetch.","If you maintain the file manually, re-serialize with the correct Descriptor and remove the legacy Digest/Platform fields so the compat path is skipped.","Run `docker manifest rm <list-ref>` (which calls Store.Remove) to clear the transaction and retry.","Verify disk integrity (fsck) if files keep becoming corrupt."],"exampleFix":"// before: reading a possibly-corrupt cached manifest\nim, err := s.Get(listRef, manifestRef)\n\n// after: on mismatch, purge the cache and fall through to re-fetch\nif err != nil {\n    if strings.Contains(err.Error(), \"digest mismatch\") {\n        _ = s.Remove(listRef)\n        im, err = s.Get(listRef, manifestRef)\n    }\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// On digest mismatch, purge the stale cache entry and re-fetch\nim, err := s.Get(listRef, manifestRef)\nif err != nil && strings.Contains(err.Error(), \"digest mismatch\") {\n    _ = s.Remove(listRef)\n    im, err = s.Get(listRef, manifestRef)\n}\nif err != nil { return err }","preventionTips":["Never hand-edit files under ~/.docker/manifests.","Use docker manifest rm to clear stale entries.","Let docker re-fetch from the registry rather than restoring manifest cache from backups."],"tags":["manifest","filesystem","data-integrity","docker-cache"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}