{"id":"e35661f357cbe283","repo":"docker/cli","slug":"unknown-type-q-must-be-one-of-s","errorCode":null,"errorMessage":"unknown type: %q: must be one of \"%s\"","messagePattern":"unknown type: %q: must be one of \"(.+?)\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/system/inspect.go","lineNumber":95,"sourceCode":"\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\nfunc runInspect(ctx context.Context, dockerCli command.Cli, opts inspectOptions) error {\n\tvar elementSearcher inspect.GetRefFunc\n\tswitch opts.objectType {\n\tcase \"\", typeConfig, typeContainer, typeImage, typeNetwork, typeNode,\n\t\ttypePlugin, typeSecret, typeService, typeTask, typeVolume:\n\t\telementSearcher = inspectAll(ctx, dockerCli, opts.size, opts.objectType)\n\tdefault:\n\t\treturn fmt.Errorf(`unknown type: %q: must be one of \"%s\"`, opts.objectType, strings.Join(allTypes, `\", \"`))\n\t}\n\treturn inspect.Inspect(dockerCli.Out(), opts.ids, opts.format, elementSearcher)\n}\n\nfunc inspectContainers(ctx context.Context, dockerCli command.Cli, getSize bool) inspect.GetRefFunc {\n\treturn func(ref string) (any, []byte, error) {\n\t\tres, err := dockerCli.Client().ContainerInspect(ctx, ref, client.ContainerInspectOptions{Size: getSize})\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\treturn res.Container, res.Raw, err\n\t}\n}\n\nfunc inspectImages(ctx context.Context, dockerCli command.Cli) inspect.GetRefFunc {\n\treturn func(ref string) (any, []byte, error) {\n\t\tvar buf bytes.Buffer\n\t\tresp, err := dockerCli.Client().ImageInspect(ctx, ref, client.ImageInspectWithRawResponse(&buf))","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/system/inspect.go#L77-L113","documentation":"Error \"unknown type: %q: must be one of \"%s\"\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/system/inspect.go:95 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}