{"record":{"id":"2cdab549d69f419d","repo":"hashicorp/vagrant","slug":"a-docker-command-executed-by-vagrant-didn-t-comple","errorCode":null,"errorMessage":"A Docker command executed by Vagrant didn't complete successfully!\nThe command run along with the output from the command is shown\nbelow.\n\nCommand: %{command}\n\nStderr: %{stderr}\n\nStdout: %{stdout}","messagePattern":"A Docker command executed by Vagrant didn't complete successfully!\nThe command run along with the output from the command is shown\nbelow\\.\n\nCommand: %(.+?)\n\nStderr: %(.+?)\n\nStdout: %(.+?)","errorType":"exception","errorClass":"VagrantPlugins::DockerProvider::Errors::ExecuteError","httpStatus":null,"severity":"error","filePath":"plugins/providers/docker/executor/local.rb","lineNumber":27,"sourceCode":"    module Executor\n      # The Local executor executes a Docker client that is running\n      # locally.\n      class Local\n        def execute(*cmd, **opts, &block)\n          # Append in the options for subprocess\n          cmd << { notify: [:stdout, :stderr] }\n\n          interrupted  = false\n          int_callback = ->{ interrupted = true }\n          result = ::Vagrant::Util::Busy.busy(int_callback) do\n            ::Vagrant::Util::Subprocess.execute(*cmd, &block)\n          end\n\n          result.stderr.gsub!(\"\\r\\n\", \"\\n\")\n          result.stdout.gsub!(\"\\r\\n\", \"\\n\")\n\n          if result.exit_code != 0 && !interrupted\n            raise Errors::ExecuteError,\n              command: cmd.inspect,\n              stderr: result.stderr,\n              stdout: result.stdout\n          end\n\n          if opts\n            if opts[:with_stderr]\n              return result.stdout + \" \" + result.stderr\n            else\n              return result.stdout\n            end\n          end\n        end\n\n        def windows?\n          ::Vagrant::Util::Platform.windows? || ::Vagrant::Util::Platform.wsl?\n        end\n      end","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/providers/docker/executor/local.rb#L9-L45","documentation":"The Docker provider's local executor runs the docker CLI via Vagrant::Util::Subprocess wrapped in Busy (so Ctrl-C is fenced). Any non-zero exit that is not the result of an interruption raises ExecuteError with the full command array, stderr, and stdout - it is the generic wrapper for 'the docker CLI failed'.","triggerScenarios":"Any native docker CLI failure during a Vagrant docker-provider run: daemon unreachable ('Cannot connect to the Docker daemon'), image pull/registry auth failures, 'port is already allocated', container name conflicts, no space left on device.","commonSituations":"Docker Desktop or the daemon not started; user not in the docker group (permission denied on /var/run/docker.sock); image tag typos; port collisions with other containers.","solutions":["Read the Stderr: section - it carries the docker CLI's own message","Check the daemon with `docker info`; start Docker Desktop or `sudo systemctl start docker`","For socket permission denied: `sudo usermod -aG docker $USER` then log out and back in","Fix the named conflict (free the port, correct the tag, `docker login`) and re-run"],"exampleFix":"# before: daemon down\n$ vagrant up --provider=docker\n# ExecuteError: Cannot connect to the Docker daemon...\n\n# after\n$ sudo systemctl start docker   # or launch Docker Desktop\n$ vagrant up --provider=docker","handlingStrategy":"try-catch","validationCode":"docker info >/dev/null 2>&1 || { echo 'start the docker daemon first'; exit 1; }\nvagrant up","typeGuard":null,"tryCatchPattern":"begin\n  driver.execute(*cmd)\nrescue VagrantPlugins::DockerProvider::Errors::ExecuteError => e\n  stderr = e.extra_data[:stderr]\n  if stderr.include?('Cannot connect to the Docker daemon')\n    start_docker_and_retry\n  else\n    raise\n  end\nend","preventionTips":["Preflight `docker info` in scripts that drive Vagrant's docker provider","Keep the invoking user in the docker group to avoid socket permission failures","Free required ports before ups; name containers deterministically"],"tags":["vagrant","docker","cli","process","exit-code"],"backgroundTag":"nonzero-exit-code","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}