{"record":{"id":"5cc1bea8364cdf33","repo":"docker/compose","slug":"failed-to-get-version-of-buildx","errorCode":null,"errorMessage":"failed to get version of buildx","messagePattern":"failed to get version of buildx","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/compose/build_bake.go","lineNumber":438,"sourceCode":"\t\tresults[image] = s.canonicalBuiltDigest(ctx, image, service.Platform, built.Digest)\n\t\ts.events.On(builtEvent(image))\n\t}\n\n\treturn results, nil\n}\n\nfunc (s *composeService) getBuildxPlugin() (*manager.Plugin, error) {\n\tbuildx, err := manager.GetPlugin(\"buildx\", s.dockerCli, &cobra.Command{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif buildx.Err != nil {\n\t\treturn nil, buildx.Err\n\t}\n\n\tif buildx.Version == \"\" {\n\t\treturn nil, fmt.Errorf(\"failed to get version of buildx\")\n\t}\n\n\tif versions.LessThan(buildx.Version[1:], buildxMinVersion) {\n\t\treturn nil, fmt.Errorf(\"compose build requires buildx %s or later\", buildxMinVersion)\n\t}\n\n\treturn buildx, nil\n}\n\n// makeConsole wraps the provided writer to match [containerd.File] interface if it is of type *streams.Out.\n// buildkit's NewDisplay doesn't actually require a [io.Reader], it only uses the [containerd.Console] type to\n// benefits from ANSI capabilities, but only does writes.\nfunc makeConsole(out io.Writer) io.Writer {\n\tif s, ok := out.(*streams.Out); ok {\n\t\treturn &_console{s}\n\t}\n\treturn out\n}","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/docker/compose/blob/ddc4b044b62e9f715212ea4143fa830fac76382f/pkg/compose/build_bake.go#L420-L456","documentation":"Before using the bake path, compose locates the buildx CLI plugin via manager.GetPlugin and requires a non-empty version string. manager.GetPlugin resolves the plugin by running 'docker buildx version' (or reading plugin metadata); if the plugin exists but its version could not be determined (empty output, unparseable output, or a plugin shim that reports nothing), this bare error is returned. The sibling branch above returns buildx.Err when plugin discovery itself failed.","triggerScenarios":"A buildx plugin binary on PATH that does not respond to the version query (broken install, wrapper script, empty output); plugin installation interrupted leaving a non-functional binary; custom DOCKER_CLI_PLUGIN_EXTRA_DIRS shims masking the real buildx.","commonSituations":"Manually installed or aliased buildx binaries that are corrupted; plugin directories with wrong permissions; partial docker-compose/buildx container images; CI images where buildx was curl-ed in incompletely.","solutions":["Verify the plugin responds: docker buildx version — if it errors or prints nothing, reinstall buildx","Reinstall: remove the broken plugin binary under ~/.docker/cli-plugins (or /usr/local/lib/docker/cli-plugins) and install the latest release","Check plugin binary permissions (must be executable) and that no shim/wrapper shadows it","Ensure DOCKER_CLI_PLUGIN_EXTRA_DIRS does not point at stale copies"],"exampleFix":"# before\n$ docker buildx version\n(no output / error)\n# after\n$ rm ~/.docker/cli-plugins/docker-buildx\n$ curl -sSL https://github.com/docker/buildx/releases/latest/download/buildx-v0.17.0.linux-amd64 -o ~/.docker/cli-plugins/docker-buildx\n$ chmod +x ~/.docker/cli-plugins/docker-buildx\n$ docker buildx version\n","handlingStrategy":"validation","validationCode":"// Before builds that need bake, verify the plugin reports a version:\nout, err := exec.Command(\"docker\", \"buildx\", \"version\").Output()\nif err != nil || len(strings.TrimSpace(string(out))) == 0 {\n\treturn fmt.Errorf(\"buildx plugin missing or broken; reinstall it before building\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Include a 'docker buildx version' smoke step in CI before compose builds","Install buildx via official release artifacts, not ad-hoc copies","Audit DOCKER_CLI_PLUGIN_EXTRA_DIRS for stale plugin shadows"],"tags":["buildx","plugin","version","installation"],"backgroundTag":null,"analyzedSha":"ddc4b044b62e9f715212ea4143fa830fac76382f","analyzedAt":"2026-08-15T13:31:42.319Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}