{"record":{"id":"f65d119dc7944850","repo":"docker/cli","slug":"invalid-name-s","errorCode":null,"errorMessage":"invalid name: %s","messagePattern":"invalid name: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/plugin/install.go","lineNumber":87,"sourceCode":"\t\tRegistryAuth:          encodedAuth,\n\t\tRemoteRef:             ref.String(),\n\t\tDisabled:              opts.disable,\n\t\tAcceptAllPermissions:  opts.grantPerms,\n\t\tAcceptPermissionsFunc: acceptPrivileges(dockerCLI, opts.remote),\n\t\tPrivilegeFunc:         nil,\n\t\tArgs:                  opts.args,\n\t}, nil\n}\n\nfunc runInstall(ctx context.Context, dockerCLI command.Cli, opts pluginOptions) error {\n\tvar localName string\n\tif opts.localName != \"\" {\n\t\taref, err := reference.ParseNormalizedNamed(opts.localName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, ok := aref.(reference.Canonical); ok {\n\t\t\treturn fmt.Errorf(\"invalid name: %s\", opts.localName)\n\t\t}\n\t\tlocalName = reference.FamiliarString(reference.TagNameOnly(aref))\n\t}\n\n\toptions, err := buildPullConfig(dockerCLI, opts)\n\tif err != nil {\n\t\treturn err\n\t}\n\tresponseBody, err := dockerCLI.Client().PluginInstall(ctx, localName, options)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\t_ = responseBody.Close()\n\t}()\n\tif err := jsonstream.Display(ctx, responseBody, dockerCLI.Out()); err != nil {\n\t\treturn err\n\t}","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli/command/plugin/install.go#L69-L105","documentation":"Returned by runInstall (plugin/install.go:87) when the --alias value parses as a reference.Canonical reference, i.e. it contains a digest (`@sha256:...`). Plugin local names must not be digest-pinned, so after reference.ParseNormalizedNamed succeeds the code checks the Canonical interface and rejects it. A non-digest name that fails to parse returns the parser's own error instead.","triggerScenarios":"Running `docker plugin install --alias myplugin@sha256:abcd1234... origin:tag`. The alias is meant to be a friendly local tag, not a content-addressed digest.","commonSituations":"Confusing the plugin alias with an image digest, pasting a full digest reference as the alias, or scripting that concatenates `name@digest`.","solutions":["Use a plain name (optionally with a tag) for --alias, e.g. `myplugin:latest`.","If you need a digest, install by digest on the remote side, not the alias.","Omit --alias entirely to let the plugin install under its remote name."],"exampleFix":"// before\ndocker plugin install --alias myplugin@sha256:abc123 origin:latest\n// after\ndocker plugin install --alias myplugin origin:latest","handlingStrategy":"type-guard","validationCode":"// Reject digest-style aliases up front.\nfunc validateAlias(alias string) error {\n    ref, err := reference.ParseNormalizedNamed(alias)\n    if err != nil { return err }\n    if _, ok := ref.(reference.Canonical); ok {\n        return fmt.Errorf(\"alias must not contain a digest: %s\", alias)\n    }\n    return nil\n}","typeGuard":"// isTaggableAlias reports whether alias is a non-digest named reference.\nfunc isTaggableAlias(alias string) bool {\n    ref, err := reference.ParseNormalizedNamed(alias)\n    if err != nil { return false }\n    _, ok := ref.(reference.Canonical)\n    return !ok\n}","tryCatchPattern":null,"preventionTips":["Use plain names or name:tag for aliases.","Never paste a digest into --alias.","Omit --alias unless you need a local rename."],"tags":["plugin","reference","naming","docker-cli"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}