hashicorp/vagrant · error · VagrantPlugins::DockerProvider::Errors::ExecuteError
A Docker command executed by Vagrant didn't complete success
Error message
A Docker command executed by Vagrant didn't complete successfully!
The command run along with the output from the command is shown
below.
Command: %{command}
Stderr: %{stderr}
Stdout: %{stdout} What it means
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'.
Source
Thrown at plugins/providers/docker/executor/local.rb:27
module Executor
# The Local executor executes a Docker client that is running
# locally.
class Local
def execute(*cmd, **opts, &block)
# Append in the options for subprocess
cmd << { notify: [:stdout, :stderr] }
interrupted = false
int_callback = ->{ interrupted = true }
result = ::Vagrant::Util::Busy.busy(int_callback) do
::Vagrant::Util::Subprocess.execute(*cmd, &block)
end
result.stderr.gsub!("\r\n", "\n")
result.stdout.gsub!("\r\n", "\n")
if result.exit_code != 0 && !interrupted
raise Errors::ExecuteError,
command: cmd.inspect,
stderr: result.stderr,
stdout: result.stdout
end
if opts
if opts[:with_stderr]
return result.stdout + " " + result.stderr
else
return result.stdout
end
end
end
def windows?
::Vagrant::Util::Platform.windows? || ::Vagrant::Util::Platform.wsl?
end
endView on GitHub (pinned to 35f3160f4a)
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
Example fix
# before: daemon down $ vagrant up --provider=docker # ExecuteError: Cannot connect to the Docker daemon... # after $ sudo systemctl start docker # or launch Docker Desktop $ vagrant up --provider=docker
Defensive patterns
Strategy: try-catch
Validate before calling
docker info >/dev/null 2>&1 || { echo 'start the docker daemon first'; exit 1; }
vagrant up Try / catch
begin
driver.execute(*cmd)
rescue VagrantPlugins::DockerProvider::Errors::ExecuteError => e
stderr = e.extra_data[:stderr]
if stderr.include?('Cannot connect to the Docker daemon')
start_docker_and_retry
else
raise
end
end Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- A Docker command executed by Vagrant didn't complete success
- Multiple URLs for a box can't be specified when adding versi
- You requested to remove the box '%{name}' version '%{version
- The box you're attempting to add already exists. Remove it b
- This command was not invoked properly. The help for this com
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/2cdab549d69f419d.
Report an issue: GitHub.