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
When docker runs inside the provider's host VM, commands execute over SSH via Executor::Vagrant with streamed stdout/stderr. A non-zero exit code of the command on the guest raises ExecuteError carrying the command, stderr, and stdout captured from inside the host VM.
Source
Thrown at plugins/providers/docker/executor/vagrant.rb:62
index += start_fence.length
stdout = stdout[index..-1]
stdout.chomp!
# We're now fenced, send all the data through
if block
block.call(:stdout, stdout) if stdout != ""
block.call(:stderr, stderr) if stderr != ""
end
end
else
# If we're already fenced, just send the data through.
block.call(type, data) if block && fenced
end
end
if code != 0
raise Errors::ExecuteError,
command: cmd,
stderr: stderr.chomp,
stdout: stdout.chomp
end
stdout.chomp
end
def windows?
false
end
protected
def ssh_run(cmd)
@host_machine.action(
:ssh_run,
ssh_run_command: cmd,View on GitHub (pinned to 35f3160f4a)
Solutions
- Read the Stderr: section for the in-VM docker message
- SSH into the host VM and verify the daemon: run `docker info` there (or use the provider's docker-env helpers)
- Reload the host VM to restart its docker daemon, then retry
- Fix the underlying failure (auth, ports, disk space) and re-run
Defensive patterns
Strategy: try-catch
Validate before calling
# preflight inside the host VM (adjust path to your host VM environment) cd host-vm && vagrant ssh -c 'docker info >/dev/null' || vagrant reload
Try / catch
begin
executor.execute(*cmd)
rescue VagrantPlugins::DockerProvider::Errors::ExecuteError => e
stderr = e.extra_data[:stderr]
if stderr.include?('Cannot connect to the Docker daemon')
reload_host_vm_and_retry # daemon inside the host VM is down
else
raise
end
end Prevention
- Health-check docker inside the host VM before container workflows
- Pass proxy/registry credentials into the host VM environment, not just the host
- Reload the host VM after host suspends/resumes instead of assuming its daemon survived
When it happens
Trigger: Docker-in-host-VM setups (e.g. macOS/Windows without a local daemon) where the docker CLI fails inside the host VM: its daemon stopped, registry auth missing there, or a port already in use inside the VM.
Common situations: Host VM docker daemon stopped after a suspend/resume; host VM low on disk or memory; proxy/auth environment variables not set inside the VM.
Related errors
- The Docker provider was able to bring up the host VM success
- A Docker command executed by Vagrant didn't complete success
- The configured host VM Vagrantfile could not be found. Pleas
- Warning: When using a remote Docker host, forwarded ports wi
- Multiple URLs for a box can't be specified when adding versi
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/b3dfb52a9bca269b.
Report an issue: GitHub.