{"id":"e1f231e003b1e0ea","repo":"docker/cli","slug":"s-is-only-supported-on-a-docker-daemon-runnin","errorCode":null,"errorMessage":"\"--%s\" is only supported on a Docker daemon running on %s, but the Docker daemon is running on %s","messagePattern":"\"--(.+?)\" is only supported on a Docker daemon running on (.+?), but the Docker daemon is running on (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/docker/docker.go","lineNumber":692,"sourceCode":"\n\tcmd.Flags().VisitAll(func(f *pflag.Flag) {\n\t\tif !f.Changed || len(f.Annotations) == 0 {\n\t\t\treturn\n\t\t}\n\t\t// Important: in the code below, calls to \"details.CurrentVersion()\" and\n\t\t// \"details.ServerInfo()\" are deliberately executed inline to make them\n\t\t// be executed \"lazily\". This is to prevent making a connection with the\n\t\t// daemon to perform a \"ping\" (even for flags that do not require a\n\t\t// daemon connection).\n\t\t//\n\t\t// See commit b39739123b845f872549e91be184cc583f5b387c for details.\n\n\t\tif _, ok := f.Annotations[\"version\"]; ok && !isVersionSupported(f, details.CurrentVersion()) {\n\t\t\terrs = append(errs, fmt.Errorf(`\"--%s\" requires API version %s, but the Docker daemon API version is %s`, f.Name, getFlagAnnotation(f, \"version\"), details.CurrentVersion()))\n\t\t\treturn\n\t\t}\n\t\tif _, ok := f.Annotations[\"ostype\"]; ok && !isOSTypeSupported(f, details.ServerInfo().OSType) {\n\t\t\terrs = append(errs, fmt.Errorf(\n\t\t\t\t`\"--%s\" is only supported on a Docker daemon running on %s, but the Docker daemon is running on %s`,\n\t\t\t\tf.Name,\n\t\t\t\tgetFlagAnnotation(f, \"ostype\"), details.ServerInfo().OSType),\n\t\t\t)\n\t\t\treturn\n\t\t}\n\t\tif _, ok := f.Annotations[\"experimental\"]; ok && !details.ServerInfo().HasExperimental {\n\t\t\terrs = append(errs, fmt.Errorf(`\"--%s\" is only supported on a Docker daemon with experimental features enabled`, f.Name))\n\t\t}\n\t\t// buildkit-specific flags are noop when buildkit is not enabled, so we do not add an error in that case\n\t})\n\treturn errors.Join(errs...)\n}\n\n// Check recursively so that, e.g., `docker stack ls` returns the same output as `docker stack`\nfunc areSubcommandsSupported(cmd *cobra.Command, details versionDetails) error {\n\t// Check recursively so that, e.g., `docker stack ls` returns the same output as `docker stack`\n\tfor curr := cmd; curr != nil; curr = curr.Parent() {","sourceCodeStart":674,"sourceCodeEnd":710,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cmd/docker/docker.go#L674-L710","documentation":"Error \"\"--%s\" is only supported on a Docker daemon running on %s, but the Docker daemon is running on %s\" thrown in docker/cli.","triggerScenarios":"Thrown at cmd/docker/docker.go:692 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}