{"id":"1d6696bec77e3bbc","repo":"docker/cli","slug":"cannot-supply-extra-formatting-options-to-the-pret-1d6696","errorCode":null,"errorMessage":"cannot supply extra formatting options to the pretty template","messagePattern":"cannot supply extra formatting options to the pretty template","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/secret/inspect.go","lineNumber":59,"sourceCode":"\treturn cmd\n}\n\nfunc runSecretInspect(ctx context.Context, dockerCLI command.Cli, opts inspectOptions) error {\n\tapiClient := dockerCLI.Client()\n\n\tif opts.pretty {\n\t\topts.format = \"pretty\"\n\t}\n\n\tgetRef := func(id string) (any, []byte, error) {\n\t\tres, err := apiClient.SecretInspect(ctx, id, client.SecretInspectOptions{})\n\t\treturn res.Secret, res.Raw, err\n\t}\n\n\t// check if the user is trying to apply a template to the pretty format, which\n\t// is not supported\n\tif strings.HasPrefix(opts.format, \"pretty\") && opts.format != \"pretty\" {\n\t\treturn errors.New(\"cannot supply extra formatting options to the pretty template\")\n\t}\n\n\tsecretCtx := formatter.Context{\n\t\tOutput: dockerCLI.Out(),\n\t\tFormat: newFormat(opts.format, false),\n\t}\n\n\tif err := inspectFormatWrite(secretCtx, opts.names, getRef); err != nil {\n\t\treturn cli.StatusError{StatusCode: 1, Status: err.Error()}\n\t}\n\treturn nil\n}\n","sourceCodeStart":41,"sourceCodeEnd":72,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/secret/inspect.go#L41-L72","documentation":"Raised by `docker secret inspect` when the --format value starts with \"pretty\" but is not exactly \"pretty\" (e.g. `--format 'pretty {{.ID}}'`). The pretty renderer is a fixed built-in human-readable template; it cannot be combined with additional Go-template directives, so the CLI rejects the mixed format up front.","triggerScenarios":"`docker secret inspect --format 'pretty{{...}}' name`, or any --format string with the literal prefix \"pretty\" followed by extra characters; also combining a configured pretty default with appended template text.","commonSituations":"Users trying to tweak the pretty output by appending template fields, copy-pasted commands that concatenate 'pretty' with a template, or scripts that build the format string and accidentally prepend 'pretty'.","solutions":["Use exactly `--format pretty` (or the --pretty flag) for human-readable output.","For custom output, drop 'pretty' and supply a pure Go template: `--format '{{.Spec.Name}}: {{.ID}}'`.","Get JSON with the default format and post-process with jq if you need selective fields."],"exampleFix":"# before\ndocker secret inspect --format 'pretty {{.ID}}' mysecret\n# after\ndocker secret inspect --format '{{.ID}}' mysecret   # or: --pretty","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["docker-cli","secrets","formatting","go-template","cli-flags"],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}