docker/cli ยท error
cannot supply extra formatting options to the pretty templat
Error message
cannot supply extra formatting options to the pretty template
What it means
Raised by `docker node inspect` when the --format value starts with 'pretty' but is not exactly 'pretty'. The pretty output is a fixed human-readable template, so appending Go-template directives to it is unsupported and rejected before any API call.
Source
Thrown at cli/command/node/inspect.go:65
apiClient := dockerCLI.Client()
if opts.pretty {
opts.format = "pretty"
}
getRef := func(ref string) (any, []byte, error) {
nodeRef, err := Reference(ctx, apiClient, ref)
if err != nil {
return nil, nil, err
}
res, err := apiClient.NodeInspect(ctx, nodeRef, client.NodeInspectOptions{})
return res.Node, res.Raw, err
}
// check if the user is trying to apply a template to the pretty format, which
// is not supported
if strings.HasPrefix(opts.format, "pretty") && opts.format != "pretty" {
return errors.New("cannot supply extra formatting options to the pretty template")
}
nodeCtx := formatter.Context{
Output: dockerCLI.Out(),
Format: newFormat(opts.format, false),
}
if err := inspectFormatWrite(nodeCtx, opts.nodeIds, getRef); err != nil {
return cli.StatusError{StatusCode: 1, Status: err.Error()}
}
return nil
}
View on GitHub (pinned to e9452d6e78)
Solutions
- Use --format pretty (or the --pretty flag) alone for the human-readable view
- Use a pure Go template for custom output, e.g. --format '{{.ID}} {{.Status.State}}'
- Drop --format entirely to get raw JSON and post-process with jq
Example fix
# before
docker node inspect --format 'pretty {{.ID}}' node1
# after
docker node inspect --format '{{.ID}}' node1 # or: --format pretty When it happens
Trigger: `docker node inspect --format 'pretty{{.ID}}' mynode` or any --format string with the 'pretty' prefix plus extra text; combining --pretty semantics with a custom template.
Common situations: Users trying to tweak the pretty output with template fields; scripts concatenating format fragments onto 'pretty'; confusion between --pretty flag and --format template.
Related errors
- node ID not found in /info
- role was already set to the requested value
- cannot supply extra formatting options to the pretty templat
- cannot supply extra formatting options to the pretty templat
- --format is incompatible with human friendly format
AI-assisted analysis of docker/cli@e9452d6e78 (2026-08-01).
Data as JSON: /data/errors/7bb4174e5bcb3e89.json.
Report an issue: GitHub.