{"record":{"id":"26fcfe15c9ec0040","repo":"docker/cli","slug":"error-parsing-current-image-reference-w","errorCode":null,"errorMessage":"error parsing current image reference: %w","messagePattern":"error parsing current image reference: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/plugin/upgrade.go","lineNumber":66,"sourceCode":"\t}\n\n\tif res.Plugin.Enabled {\n\t\treturn errors.New(\"the plugin must be disabled before upgrading\")\n\t}\n\n\topts.localName = res.Plugin.Name\n\tif opts.remote == \"\" {\n\t\topts.remote = res.Plugin.PluginReference\n\t}\n\tremote, err := reference.ParseNormalizedNamed(opts.remote)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error parsing remote upgrade image reference: %w\", err)\n\t}\n\tremote = reference.TagNameOnly(remote)\n\n\told, err := reference.ParseNormalizedNamed(res.Plugin.PluginReference)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error parsing current image reference: %w\", err)\n\t}\n\told = reference.TagNameOnly(old)\n\n\t_, _ = fmt.Fprintf(dockerCLI.Out(), \"Upgrading plugin %s from %s to %s\\n\", res.Plugin.Name, reference.FamiliarString(old), reference.FamiliarString(remote))\n\tif !opts.skipRemoteCheck && remote.String() != old.String() {\n\t\tr, err := prompt.Confirm(ctx, dockerCLI.In(), dockerCLI.Out(), \"Plugin images do not match, are you sure?\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !r {\n\t\t\treturn cancelledErr{errors.New(\"plugin upgrade has been cancelled\")}\n\t\t}\n\t}\n\n\toptions, err := buildPullConfig(dockerCLI, opts)\n\tif err != nil {\n\t\treturn err\n\t}","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli/command/plugin/upgrade.go#L48-L84","documentation":"Returned by runUpgrade (plugin/upgrade.go:66) wrapping the error from reference.ParseNormalizedNamed on the EXISTING plugin's stored PluginReference. Unlike [369] this is not user-supplied input; it is the reference persisted in the local plugin's metadata. A parse failure here indicates the plugin's stored reference is malformed or in an unexpected form.","triggerScenarios":"A locally installed plugin whose PluginReference cannot be parsed by the current reference library — e.g. installed by an older Docker version using a now-invalid format, or a reference with an unusual scheme. Triggered on any `docker plugin upgrade` of such a plugin when the remote is parsed successfully first.","commonSituations":"Version skew between the CLI and the daemon/plugin metadata, plugins installed long ago with legacy reference formats, or a manually corrupted plugin config.","solutions":["Upgrade the Docker CLI/daemon to a matching version that understands the stored reference.","Remove and reinstall the plugin from a known-good reference (`docker plugin rm` then `docker plugin install`).","Use `--skip-remote-check` only if the remote differs and you can supply a fresh remote; otherwise reinstall."],"exampleFix":"// before: plugin has unparseable stored PluginReference\ndocker plugin upgrade oldplugin\n// after\ndocker plugin rm -f oldplugin\ndocker plugin install oldplugin registry.example.com/oldplugin:latest","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// On unparseable stored reference, fall back to reinstall from a known-good ref.\nerr := runUpgrade(ctx, cli, opts)\nif err != nil && strings.Contains(err.Error(), \"error parsing current image reference\") {\n    _ = cli.Client().PluginRemove(ctx, name, types.PluginRemoveOptions{Force: true})\n    return runInstall(ctx, cli, pluginOptions{remote: knownGoodRef})\n}","preventionTips":["Keep daemon and CLI versions in sync to avoid reference-format drift.","Reinstall legacy plugins from current references when formats change.","Document the original install reference so upgrades have a valid fallback."],"tags":["plugin","upgrade","reference","data-integrity","docker-cli"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}