{"record":{"id":"dde2e4022acd56d7","repo":"docker/cli","slug":"annotate-error-parsing-name-for-manifest-list-s","errorCode":null,"errorMessage":"annotate: error parsing name for manifest list %s: %w","messagePattern":"annotate: error parsing name for manifest list (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/manifest/annotate.go","lineNumber":128,"sourceCode":"\t\t},\n\t\tDisableFlagsInUseLine: true,\n\t}\n\n\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)","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli/command/manifest/annotate.go#L110-L146","documentation":"Returned by `runManifestAnnotate` (annotate.go:126-129) when `normalizeReference(opts.target)` fails on the first positional argument (MANIFEST_LIST). normalizeReference calls `reference.ParseNormalizedNamed`, so the target name must be a valid Docker reference (repository[:tag|@digest]). The %w wraps the distribution/reference parse error.","triggerScenarios":"Running `docker manifest annotate 'UPPERCASE Bad!' img` (uppercase invalid), a name with illegal characters, an empty name, or a name longer than the reference limit.","commonSituations":"Typos, shell unquoted special characters, copy-paste of a registry URL instead of a repository name, or trailing slash misuse.","solutions":["Pass a valid repository reference optionally with a tag: `registry/repo:tag`.","Quote the argument to avoid shell mangling of special characters.","Run `docker manifest create` first with the same name to confirm it parses.","Avoid uppercase characters and disallowed symbols in repository names."],"exampleFix":"# before\ndocker manifest annotate 'My List!' img\n# after\ndocker manifest annotate myregistry.com/mylist:1.0 img","handlingStrategy":"validation","validationCode":"import \"github.com/distribution/reference\"\nif _, err := reference.ParseNormalizedNamed(targetName); err != nil {\n    return fmt.Errorf(\"MANIFEST_LIST name %q is not a valid reference: %w\", targetName, err)\n}","typeGuard":null,"tryCatchPattern":"if err := runManifestAnnotate(cli, opts); err != nil {\n    if strings.HasPrefix(err.Error(), \"annotate: error parsing name for manifest list\") {\n        return fmt.Errorf(\"first argument must be a valid repository[:tag]; got %q\", opts.target)\n    }\n    return err\n}","preventionTips":["Validate reference names with distribution/reference before invoking the command.","Quote arguments; avoid shell metacharacters.","Reuse the exact name used in `docker manifest create`."],"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"}