{"record":{"id":"080ff48c927ddff9","repo":"docker/cli","slug":"annotate-error-parsing-name-for-manifest-s-w","errorCode":null,"errorMessage":"annotate: error parsing name for manifest %s: %w","messagePattern":"annotate: error parsing name for manifest (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/manifest/annotate.go","lineNumber":132,"sourceCode":"\tflags := cmd.Flags()\n\n\tflags.StringVar(&opts.os, \"os\", \"\", \"Set operating system\")\n\tflags.StringVar(&opts.arch, \"arch\", \"\", \"Set architecture\")\n\tflags.StringVar(&opts.osVersion, \"os-version\", \"\", \"Set operating system version\")\n\tflags.StringSliceVar(&opts.osFeatures, \"os-features\", []string{}, \"Set operating system feature\")\n\tflags.StringVar(&opts.variant, \"variant\", \"\", \"Set architecture variant\")\n\n\treturn cmd\n}\n\nfunc runManifestAnnotate(dockerCLI command.Cli, opts annotateOptions) error {\n\ttargetRef, err := normalizeReference(opts.target)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"annotate: error parsing name for manifest list %s: %w\", opts.target, err)\n\t}\n\timgRef, err := normalizeReference(opts.image)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"annotate: error parsing name for manifest %s: %w\", opts.image, err)\n\t}\n\n\tmanifestStore := newManifestStore(dockerCLI)\n\timageManifest, err := manifestStore.Get(targetRef, imgRef)\n\tswitch {\n\tcase errdefs.IsNotFound(err):\n\t\treturn fmt.Errorf(\"manifest for image %s does not exist in %s\", opts.image, opts.target)\n\tcase err != nil:\n\t\treturn err\n\t}\n\n\t// Update the mf\n\tif imageManifest.Descriptor.Platform == nil {\n\t\timageManifest.Descriptor.Platform = new(ocispec.Platform)\n\t}\n\tif opts.os != \"\" {\n\t\timageManifest.Descriptor.Platform.OS = opts.os\n\t}","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli/command/manifest/annotate.go#L114-L150","documentation":"Returned by `runManifestAnnotate` (annotate.go:130-133) when `normalizeReference(opts.image)` fails on the second positional argument (MANIFEST). Same parsing rules as the target: the source image must be a syntactically valid Docker reference. The %w wraps the distribution/reference parse error.","triggerScenarios":"Running `docker manifest annotate mylist 'bad:image:name:extra'` — too many colon-separated components, illegal characters, or an unparseable digest suffix.","commonSituations":"Pasting an image name with a trailing tag + digest simultaneously, illegal characters, or a malformed digest.","solutions":["Use either a tag OR a digest, not both malformed together: `repo:tag` or `repo@sha256:...`.","Validate the image name parses with a simple `docker pull --dry-run` style check or `docker manifest inspect <name>`.","Quote the argument and remove shell-special characters.","Ensure the repository component uses lowercase alphanumerics and allowed separators."],"exampleFix":"# before\ndocker manifest annotate mylist 'My-Image:V1@bad'\n# after\ndocker manifest annotate mylist myregistry.com/myimage:1.0","handlingStrategy":"validation","validationCode":"if _, err := reference.ParseNormalizedNamed(imageName); err != nil {\n    return fmt.Errorf(\"MANIFEST name %q is not a valid reference: %w\", imageName, err)\n}","typeGuard":null,"tryCatchPattern":"if err := runManifestAnnotate(cli, opts); err != nil {\n    if strings.HasPrefix(err.Error(), \"annotate: error parsing name for manifest \") {\n        return fmt.Errorf(\"second argument must be a valid repository[:tag|@digest]; got %q\", opts.image)\n    }\n    return err\n}","preventionTips":["Use either tag or digest form, not both malformed.","Validate with reference.ParseNormalizedNamed in your wrapper code.","Keep repository components lowercase."],"tags":["manifest","annotate","reference","validation","docker-cli"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}