{"record":{"id":"9e5258114579ee08","repo":"hashicorp/vagrant","slug":"vagrant-received-unknown-output-from-docker-build","errorCode":null,"errorMessage":"Vagrant received unknown output from `docker build` while building a container: %{result}","messagePattern":"Vagrant received unknown output from `docker build` while building a container: %(.+?)","errorType":"exception","errorClass":"VagrantPlugins::DockerProvider::Errors::BuildError","httpStatus":null,"severity":"error","filePath":"plugins/providers/docker/driver.rb","lineNumber":52,"sourceCode":"        if !matches\n          # Check for output of docker using containerd backend store\n          matches = result.scan(/exporting manifest list .+:([^\\s]+)/i).last\n        end\n        if !matches\n          if podman?\n            # Check for podman format when it is emulating docker CLI.\n            # Podman outputs the full hash of the container on\n            # the last line after a successful build.\n            match = result.split.select { |str| str.match?(/^[0-9a-z]{64}/) }.last\n            return match[0..7] unless match.nil?\n          else\n            matches = result.scan(/Successfully built (.+)$/i).last\n          end\n\n          if !matches\n            # This will cause a stack trace in Vagrant, but it is a bug\n            # if this happens anyways.\n            raise Errors::BuildError, result: result\n          end\n        end\n\n        # Return the matched group `id`\n        matches[0].strip\n      end\n\n      # Check if podman emulating docker CLI is enabled.\n      #\n      # @return [Bool]\n      def podman?\n        execute('docker', '--version').include?(\"podman\")\n      end\n\n      def create(params, **opts, &block)\n        image   = params.fetch(:image)\n        links   = params.fetch(:links)\n        ports   = Array(params[:ports])","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/providers/docker/driver.rb#L34-L70","documentation":"After running `docker build`, the Docker driver parses stdout to extract the image ID: a trailing 'Successfully built <id>' line, or - when podman emulates the docker CLI - the last 64-hex-char token. When the output matches neither pattern, BuildError is raised with the raw result; the code comment notes that reaching this guard at all indicates output Vagrant does not expect.","triggerScenarios":"Build output that omits 'Successfully built' - BuildKit-style output (DOCKER_BUILDKIT=1, 'writing image sha256:...'), newer docker CLI formats, podman emulation edge cases, or a build whose failure text never matched the success regex.","commonSituations":"BuildKit enabled by default on modern Docker; podman/docker aliases; build failures whose real error text only appears inside the %{result} payload.","solutions":["Read the result text in the error - the actual build failure (failing Dockerfile step, missing context) is printed there","Disable BuildKit for Vagrant builds: DOCKER_BUILDKIT=0 vagrant up (export it in your shell or CI)","Update Vagrant - newer releases teach the parser BuildKit and podman output formats","Iterate outside Vagrant: re-run the docker build command shown in the error directly until the Dockerfile is good"],"exampleFix":"# before\nexport DOCKER_BUILDKIT=1\nvagrant up   # BuildError: unparseable build output\n\n# after\nexport DOCKER_BUILDKIT=0\nvagrant up","handlingStrategy":"try-catch","validationCode":"# smoke-test the build path before letting Vagrant parse its output\nDOCKER_BUILDKIT=0 docker build -q -t probe . >/dev/null && vagrant up","typeGuard":null,"tryCatchPattern":"begin\n  image_id = driver.build(build_dir)\nrescue VagrantPlugins::DockerProvider::Errors::BuildError => e\n  # the raw output is in e.extra_data[:result]; show it, do not retry the same parse\n  abort \"docker build output not understood: #{e.extra_data[:result]}\"\nend","preventionTips":["Export DOCKER_BUILDKIT=0 in environments running older Vagrant","Keep Dockerfiles simple enough that real failures produce clean error output","Update Vagrant alongside docker CLI upgrades"],"tags":["vagrant","docker","build","buildkit","podman"],"backgroundTag":"unrecognized-command-output","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}