hashicorp/vagrant · error · Vagrant::Errors::DownloaderError
An error occurred while downloading the remote file. The err
Error message
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
%{message} What it means
Raised by Vagrant::Util::Downloader when curl exits non-zero and the parsed stderr code is not 416 (416 = requested range already satisfied, treated as success). The %{message} carries the curl exit code plus the parsed `curl: (code) error` line, or raw stderr when unparsable, so the exact curl objection is visible.
Source
Thrown at lib/vagrant/util/downloader.rb:227
# If the download was interrupted, then raise a specific error
raise Errors::DownloaderInterrupted if interrupted
# If it didn't exit successfully, we need to parse the data and
# show an error message.
if result.exit_code != 0
@logger.warn("Downloader exit code: #{result.exit_code}")
check = result.stderr.match(/\n*curl:\s+\((?<code>\d+)\)\s*(?<error>.*)$/)
if check && check[:code] == "416"
# All good actually. 416 means there is no more bytes to download
@logger.warn("Downloader got a 416, but is likely fine. Continuing on...")
else
if !check
err_msg = result.stderr
else
err_msg = check[:error]
end
raise Errors::DownloaderError,
code: result.exit_code,
message: err_msg
end
end
result
end
# Returns the various cURL and subprocess options.
#
# @return [Array<Array, Hash>]
def options
# Build the list of parameters to execute with cURL
options = [
"--fail",
"--location",
"--max-redirs", "10", "--verbose",
"--user-agent", USER_AGENT,View on GitHub (pinned to 35f3160f4a)
Solutions
- Read %{message} and map the curl code: 6=DNS, 7=connect, 22=HTTP 4xx/5xx (fix the URL), 35/60=TLS/CA, 5=proxy resolution
- Reproduce outside Vagrant: `curl -fIL <box_url>` to confirm the failure mode
- Fix the source: update the renamed/removed box URL or regenerate the expired signed link
- For TLS/proxy issues, install the full CA bundle in the environment running vagrant and set correct http_proxy/https_proxy/no_proxy
Example fix
# before config.vm.box_url = "https://vagrantcloud.com/myuser/old-box-name" # after (box was renamed upstream) config.vm.box_url = "https://vagrantcloud.com/myuser/new-box-name"
Defensive patterns
Strategy: retry
Validate before calling
require 'uri'
begin
u = URI.parse(url)
raise unless u.is_a?(URI::HTTP) || u.is_a?(URI::FTP)
rescue
abort "bad box_url: #{url}"
end
# reachability probe before handing off to Vagrant
system('curl', '-fsIL', url, out: File::NULL) or abort 'URL not reachable' Try / catch
begin
downloader.download!
rescue Vagrant::Errors::DownloaderError => e
fatal = e.message.include?('(22)') # HTTP 4xx/5xx — retry will not help
retry unless fatal
abort e.message
end Prevention
- Pin box URLs to versioned, stable paths
- Probe URLs with curl -I in CI before vagrant runs
- Keep CA bundles current behind TLS-intercepting proxies
- Never blind-retry 404s — fix the source first
When it happens
Trigger: `vagrant box add` / box_download where the URL returns 404/403, DNS fails (code 6), connection refused (7), TLS verification fails (35/60), a proxy blocks the transfer via http_proxy/https_proxy, or a signed URL expired — any curl failure except a clean 416.
Common situations: Stale box_url in a Vagrantfile after the box was renamed or removed from Vagrant Cloud; corporate TLS-intercepting proxies with missing CA bundles; self-hosted artifact servers with expired tokens; typo'd URLs.
Related errors
- There was an error while downloading the metadata for this b
- The download was interrupted by an external signal. It did n
- An error occurred while uploading the file. The error messag
- There was a problem while downloading the metadata for your
- The checksum of the downloaded box did not match the expecte
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/f330018c54e92cb2.
Report an issue: GitHub.