{"record":{"id":"2dc9649950a7a081","repo":"docker/cli","slug":"docker-unknown-command-docker-s-n-nrun-docker","errorCode":null,"errorMessage":"docker: unknown command: docker %s\\n\\nRun 'docker --help' for more information","messagePattern":"docker: unknown command: docker (.+?)\\\\n\\\\nRun 'docker --help' for more information","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli-plugins/manager/cobra.go","lineNumber":55,"sourceCode":"\t\t\t}\n\t\t\trootCmd.AddCommand(&cobra.Command{\n\t\t\t\tUse:                p.Name,\n\t\t\t\tShort:              p.ShortDescription,\n\t\t\t\tHidden:             p.Hidden,\n\t\t\t\tRun:                func(_ *cobra.Command, _ []string) {},\n\t\t\t\tAnnotations:        annotations,\n\t\t\t\tDisableFlagParsing: true,\n\t\t\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\t\t\tflags := rootCmd.PersistentFlags()\n\t\t\t\t\tflags.SetOutput(nil)\n\t\t\t\t\tif err := flags.Parse(args); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tif flags.Changed(\"help\") {\n\t\t\t\t\t\tcmd.HelpFunc()(rootCmd, args)\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\t\t\t\t\treturn fmt.Errorf(\"docker: unknown command: docker %s\\n\\nRun 'docker --help' for more information\", cmd.Name())\n\t\t\t\t},\n\t\t\t\tValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\t\t\t\t// Delegate completion to plugin\n\t\t\t\t\tcargs := []string{p.Path, cobra.ShellCompRequestCmd, p.Name} //nolint:prealloc // no need to over-complicate things.\n\t\t\t\t\tcargs = append(cargs, args...)\n\t\t\t\t\tcargs = append(cargs, toComplete)\n\t\t\t\t\torigArgs := os.Args\n\t\t\t\t\tos.Args = cargs\n\t\t\t\t\tdefer func() {\n\t\t\t\t\t\tos.Args = origArgs\n\t\t\t\t\t}()\n\t\t\t\t\trunCommand, runErr := PluginRunCommand(dockerCLI, p.Name, cmd)\n\t\t\t\t\tif runErr != nil {\n\t\t\t\t\t\treturn nil, cobra.ShellCompDirectiveError\n\t\t\t\t\t}\n\t\t\t\t\trunErr = runCommand.Run()\n\t\t\t\t\tif runErr == nil {\n\t\t\t\t\t\tos.Exit(0) // plugin already rendered complete data","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli-plugins/manager/cobra.go#L37-L73","documentation":"Returned by a cobra stub command registered for an invalid plugin (a plugin binary that failed validation). When DisableFlagParsing is on and the user runs the stub, the RunE returns this formatted 'unknown command' error pointing at docker --help. It is only produced for plugins whose metadata/prefix validation failed, not for genuinely unknown CLI commands.","triggerScenarios":"Running a command backed by a plugin stub whose Err is set (invalid metadata, schema, vendor, or name conflict), e.g. docker <badplugin> ...","commonSituations":"A plugin binary on PATH that is misconfigured (missing vendor, wrong schema version, wrong prefix) such that the manager registers it as an invalid stub instead of a working command.","solutions":["Run docker --help to confirm the intended command name and spelling.","Inspect the plugin with docker info or check its metadata JSON for vendor/schema/prefix issues.","Rename the plugin binary to start with the docker- prefix and fix its metadata.","Remove the broken plugin from PATH if it is no longer needed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run docker --help to confirm command names before use.","Keep plugin binaries correctly prefixed (docker-) and with valid metadata so they register as real commands.","Remove broken plugins from PATH."],"tags":["cli-plugins","command-resolution","plugins"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}