docker/cli ยท error
the --%s flag requires that a --%s flag and/or --%s flag be
Error message
the --%s flag requires that a --%s flag and/or --%s flag be provided as well
What it means
Error "the --%s flag requires that a --%s flag and/or --%s flag be provided as well" thrown in docker/cli.
Source
Thrown at cli/command/swarm/ca.go:82
}
if !opts.rotate {
for _, f := range []string{flagCACert, flagCAKey, flagCertExpiry, flagExternalCA} {
if flags.Changed(f) {
return fmt.Errorf("`--%s` flag requires the `--rotate` flag to update the CA", f)
}
}
return displayTrustRoot(dockerCLI.Out(), res)
}
if flags.Changed(flagExternalCA) && len(opts.externalCA.Value()) > 0 && !flags.Changed(flagCACert) {
return fmt.Errorf(
"rotating to an external CA requires the `--%s` flag to specify the external CA's cert - "+
"to add an external CA with the current root CA certificate, use the `update` command instead", flagCACert)
}
if flags.Changed(flagCACert) && len(opts.externalCA.Value()) == 0 && !flags.Changed(flagCAKey) {
return fmt.Errorf("the --%s flag requires that a --%s flag and/or --%s flag be provided as well",
flagCACert, flagCAKey, flagExternalCA)
}
updateSwarmSpec(&res.Swarm.Spec, flags, opts)
if _, err := apiClient.SwarmUpdate(ctx, client.SwarmUpdateOptions{
Version: res.Swarm.Version,
Spec: res.Swarm.Spec,
}); err != nil {
return err
}
if opts.detach {
return nil
}
return attach(ctx, dockerCLI, opts)
}
func updateSwarmSpec(spec *swarm.Spec, flags *pflag.FlagSet, opts caOptions) {View on GitHub (pinned to e9452d6e78)
When it happens
Trigger: Thrown at cli/command/swarm/ca.go:82 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of docker/cli@e9452d6e78 (2026-08-01).
Data as JSON: /data/errors/304b417f8dad5b14.json.
Report an issue: GitHub.