{"id":"3a1e7fe819dd998c","repo":"docker/cli","slug":"type-is-empty-must-be-one-of-s","errorCode":null,"errorMessage":"type is empty: must be one of \"%s\"","messagePattern":"type is empty: must be one of \"(.+?)\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/system/inspect.go","lineNumber":69,"sourceCode":"type inspectOptions struct {\n\tformat     string\n\tobjectType objectType\n\tsize       bool\n\tids        []string\n}\n\n// newInspectCommand creates a new cobra.Command for `docker inspect`\nfunc newInspectCommand(dockerCLI command.Cli) *cobra.Command {\n\tvar opts inspectOptions\n\n\tcmd := &cobra.Command{\n\t\tUse:   \"inspect [OPTIONS] NAME|ID [NAME|ID...]\",\n\t\tShort: \"Return low-level information on Docker objects\",\n\t\tArgs:  cli.RequiresMinArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\topts.ids = args\n\t\t\tif cmd.Flags().Changed(\"type\") && opts.objectType == \"\" {\n\t\t\t\treturn fmt.Errorf(`type is empty: must be one of \"%s\"`, strings.Join(allTypes, `\", \"`))\n\t\t\t}\n\t\t\treturn runInspect(cmd.Context(), dockerCLI, opts)\n\t\t},\n\t\t// TODO(thaJeztah): should we consider adding completion for common object-types? (images, containers?)\n\t\tValidArgsFunction:     completeObjectNames(dockerCLI),\n\t\tDisableFlagsInUseLine: true,\n\t}\n\n\tflags := cmd.Flags()\n\tflags.StringVarP(&opts.format, \"format\", \"f\", \"\", flagsHelper.InspectFormatHelp)\n\tflags.StringVar(&opts.objectType, \"type\", \"\", \"Only inspect objects of the given type\")\n\tflags.BoolVarP(&opts.size, \"size\", \"s\", false, \"Display total file sizes if the type is container\")\n\n\t_ = cmd.RegisterFlagCompletionFunc(\"type\", completion.FromList(allTypes...))\n\n\treturn cmd\n}\n","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/system/inspect.go#L51-L87","documentation":"Error \"type is empty: must be one of \"%s\"\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/system/inspect.go:69 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}