{"record":{"id":"6d6f39837b181950","repo":"docker/cli","slug":"w-s","errorCode":null,"errorMessage":"%w\n\n%s","messagePattern":"%w\n\n%s","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/docker/builder.go","lineNumber":44,"sourceCode":"\tbuildkitDisabledWarning = `DEPRECATED: The legacy builder is deprecated and will be removed in a future release.\n            BuildKit is currently disabled; enable it by removing the DOCKER_BUILDKIT=0\n            environment-variable.`\n\n\tbuildxMissingError = `ERROR: BuildKit is enabled but the buildx component is missing or broken.\n       Install the buildx component to build images with BuildKit:\n       https://docs.docker.com/go/buildx/`\n\n\tbakeMissingError = `ERROR: docker bake requires the buildx component but it is missing or broken.\n       Install the buildx component to use bake:\n       https://docs.docker.com/go/buildx/`\n)\n\nfunc newBuilderError(errorMsg string, pluginLoadErr error) error {\n\tif errdefs.IsNotFound(pluginLoadErr) {\n\t\treturn errors.New(errorMsg)\n\t}\n\tif pluginLoadErr != nil {\n\t\treturn fmt.Errorf(\"%w\\n\\n%s\", pluginLoadErr, errorMsg)\n\t}\n\treturn errors.New(errorMsg)\n}\n\n//nolint:gocyclo\nfunc processBuilder(dockerCli command.Cli, cmd *cobra.Command, args, osargs []string) ([]string, []string, []string, error) {\n\tvar buildKitDisabled, useBuilder, useAlias bool\n\tvar envs []string\n\n\t// check DOCKER_BUILDKIT env var is not empty\n\t// if it is assume we want to use the builder component\n\tif v := os.Getenv(\"DOCKER_BUILDKIT\"); v != \"\" {\n\t\tenabled, err := strconv.ParseBool(v)\n\t\tif err != nil {\n\t\t\treturn args, osargs, nil, fmt.Errorf(\"DOCKER_BUILDKIT environment variable expects boolean value: %w\", err)\n\t\t}\n\t\tif !enabled {\n\t\t\tbuildKitDisabled = true","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cmd/docker/builder.go#L26-L62","documentation":"Returned by newBuilderError() when loading the builder plugin (buildx) produced an error that is NOT a 'not found' error (errdefs.IsNotFound is false). It wraps the plugin load error (%w) and appends a human-readable message (%s — buildxMissingError/bakeMissingError) explaining the fix. This indicates buildx exists but is broken, not merely absent.","triggerScenarios":"Running `docker build`/`docker bake` with DOCKER_BUILDKIT=1 (or a builder alias) where the buildx plugin binary is present but fails to load — corrupt binary, version mismatch, missing shared library, permission denied on the plugin executable, or the plugin returned a malformed manifest.","commonSituations":"Partial/failed buildx installation; OS upgrade breaking dynamic library dependencies of the plugin; mixing plugin versions with the CLI; corrupted plugin binary on disk.","solutions":["Reinstall/repair the buildx plugin: `docker buildx install` or download a matching version from the official release.","Check the wrapped %w error for the concrete load failure (exec format, permission, manifest parse).","Verify the plugin binary is executable and matches your platform (`file $(which docker-buildx)`).","As a temporary workaround, set DOCKER_BUILDKIT=0 to use the legacy builder (note the deprecation warning)."],"exampleFix":"// before\n$ DOCKER_BUILDKIT=1 docker build .\nERROR: BuildKit is enabled but the buildx component is missing or broken.\n<wrapped load error>\n\n// after — reinstall buildx matching this CLI version\n$ docker buildx install\n$ docker build .","handlingStrategy":"fallback","validationCode":"// Check buildx plugin health before relying on it\nfunc buildxHealthy() error {\n    out, err := exec.Command(\"docker\", \"buildx\", \"version\").CombinedOutput()\n    if err != nil { return fmt.Errorf(\"buildx plugin broken: %s\", out) }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"// Fall back to the legacy builder if buildx is broken and the user opted in\nif err := buildxHealthy(); err != nil {\n    if os.Getenv(\"DOCKER_BUILDKIT_FALLBACK\") == \"1\" {\n        os.Setenv(\"DOCKER_BUILDKIT\", \"0\") // legacy builder (deprecated)\n    }\n}","preventionTips":["Install buildx with `docker buildx install` and keep it version-aligned with the CLI.","Pin buildx in CI to a release matching the docker CLI version.","Watch the wrapped %w for the concrete plugin load failure."],"tags":["docker","build","buildx","plugin","buildkit"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}