{"id":"a94505d0835cae82","repo":"docker/cli","slug":"unable-to-determine-basename-of-plugin-candidate","errorCode":null,"errorMessage":"unable to determine basename of plugin candidate %q","messagePattern":"unable to determine basename of plugin candidate %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli-plugins/manager/plugin.go","lineNumber":71,"sourceCode":"\tMetadata() ([]byte, error)\n}\n\n// newPlugin determines if the given candidate is valid and returns a\n// Plugin.  If the candidate fails one of the tests then `Plugin.Err`\n// is set, and is always a `pluginError`, but the `Plugin` is still\n// returned with no error. An error is only returned due to a\n// non-recoverable error.\nfunc newPlugin(c pluginCandidate, cmds []*cobra.Command) (Plugin, error) {\n\tpath := c.Path()\n\tif path == \"\" {\n\t\treturn Plugin{}, errors.New(\"plugin candidate path cannot be empty\")\n\t}\n\n\t// The candidate listing process should have skipped anything\n\t// which would fail here, so there are all real errors.\n\tfullname := filepath.Base(path)\n\tif fullname == \".\" {\n\t\treturn Plugin{}, fmt.Errorf(\"unable to determine basename of plugin candidate %q\", path)\n\t}\n\tvar err error\n\tif fullname, err = trimExeSuffix(fullname); err != nil {\n\t\treturn Plugin{}, fmt.Errorf(\"plugin candidate %q: %w\", path, err)\n\t}\n\tif !strings.HasPrefix(fullname, metadata.NamePrefix) {\n\t\treturn Plugin{}, fmt.Errorf(\"plugin candidate %q: does not have %q prefix\", path, metadata.NamePrefix)\n\t}\n\n\tp := Plugin{\n\t\tName: strings.TrimPrefix(fullname, metadata.NamePrefix),\n\t\tPath: path,\n\t}\n\n\t// Now apply the candidate tests, so these update p.Err.\n\tif !isValidPluginName(p.Name) {\n\t\tp.Err = newPluginError(\"plugin candidate %q did not match %q\", p.Name, pluginNameFormat)\n\t\treturn p, nil","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli-plugins/manager/plugin.go#L53-L89","documentation":"Error \"unable to determine basename of plugin candidate %q\" thrown in docker/cli.","triggerScenarios":"Thrown at cli-plugins/manager/plugin.go:71 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}