{"record":{"id":"ced04d3330890c9d","repo":"docker/cli","slug":"failed-to-assemble-manifestdescriptor-w","errorCode":null,"errorMessage":"failed to assemble ManifestDescriptor: %w","messagePattern":"failed to assemble ManifestDescriptor: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/manifest/inspect.go","lineNumber":122,"sourceCode":"\t}\n\tjsonBytes, err := json.MarshalIndent(manifest, \"\", \"\\t\")\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, _ = dockerCli.Out().Write(append(jsonBytes, '\\n'))\n\treturn nil\n}\n\nfunc printManifestList(dockerCli command.Cli, namedRef reference.Named, list []types.ImageManifest, opts inspectOptions) error {\n\tif !opts.verbose {\n\t\ttargetRepo := reference.TrimNamed(namedRef)\n\n\t\tmanifests := make([]manifestlist.ManifestDescriptor, 0, len(list))\n\t\t// More than one response. This is a manifest list.\n\t\tfor _, img := range list {\n\t\t\tmfd, err := buildManifestDescriptor(targetRepo, img)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to assemble ManifestDescriptor: %w\", err)\n\t\t\t}\n\t\t\tmanifests = append(manifests, mfd)\n\t\t}\n\t\tdeserializedML, err := manifestlist.FromDescriptors(manifests)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tjsonBytes, err := deserializedML.MarshalJSON()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, _ = fmt.Fprintln(dockerCli.Out(), string(jsonBytes))\n\t\treturn nil\n\t}\n\tjsonBytes, err := json.MarshalIndent(list, \"\", \"\\t\")\n\tif err != nil {\n\t\treturn err\n\t}","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli/command/manifest/inspect.go#L104-L140","documentation":"Returned by `printManifestList` (inspect.go:120-123) in the non-verbose path when `buildManifestDescriptor(targetRepo, img)` fails for any entry in the local manifest list. buildManifestDescriptor (push.go:143-168) fails on a registry-hostname mismatch between a source image and the target, or when the manifest digest fails validation.","triggerScenarios":"Running `docker manifest inspect <list>` (non-verbose) where a constituent image's registry hostname differs from the list's hostname, or where a manifest entry carries a malformed digest.","commonSituations":"A manifest list created with sources from a different registry than the target, corrupted local manifest cache, or a manifest entry with an empty/invalid digest.","solutions":["Run `docker manifest inspect -v <list>` (verbose) which bypasses buildManifestDescriptor and reveals the offending entry.","Re-create the manifest list ensuring all sources share the target registry hostname.","Clear the local manifest store and re-create the list if the digest is corrupted.","Annotate or re-add the offending image to refresh its descriptor."],"exampleFix":"# before\ndocker manifest inspect mylist      # fails on registry mismatch in a member\n# after\ndocker manifest inspect -v mylist     # verbose path reveals the member; fix the source registry","handlingStrategy":"validation","validationCode":"// pre-check each member's registry hostname and digest before printing non-verbose\nfor _, img := range list {\n    if reference.Domain(reference.TrimNamed(img.Ref)) != reference.Domain(reference.TrimNamed(target)) {\n        return fmt.Errorf(\"member %s registry differs from target; inspect -v to bypass\", img.Ref)\n    }\n    if err := img.Descriptor.Digest.Validate(); err != nil {\n        return fmt.Errorf(\"member %s has invalid digest: %w\", img.Ref, err)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := printManifestList(cli, ref, list, opts); err != nil {\n    if strings.Contains(err.Error(), \"failed to assemble ManifestDescriptor\") {\n        // retry verbose path which skips descriptor assembly\n        return printManifestList(cli, ref, list, inspectOptions{verbose: true})\n    }\n    return err\n}","preventionTips":["Use `docker manifest inspect -v` when members span registries.","Keep all members on the same registry as the target.","Rebuild the local list if digests are suspect."],"tags":["manifest","inspect","descriptor","digest","registry","docker-cli"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}