hashicorp/vagrant · error · VagrantPlugins::CloudCommand::Errors::ServerUnreachable
The Vagrant Cloud server is not currently accepting connecti
Error message
The Vagrant Cloud server is not currently accepting connections. Please check your network connection and try again later.
What it means
Vagrant::Errors::ServerUnreachable is raised when a Vagrant Cloud request dies with a Ruby SocketError — DNS resolution or TCP connection to the API host failed before any HTTP exchange. The message includes the configured server URL (Vagrant.server_url, i.e. VAGRANT_SERVER_URL or the default https://vagrantcloud.com).
Source
Thrown at plugins/commands/cloud/client/client.rb:222
if two_factor_default_delivery_method != APP
request_code two_factor_default_delivery_method
end
raise Errors::TwoFactorRequired
end
begin
errors = parsed_response["errors"].join("\n")
raise Errors::ServerError, errors: errors
rescue JSON::ParserError; end
@logger.debug("Got an unexpected error:")
@logger.debug(e.inspect)
raise Errors::Unexpected, error: e.inspect
rescue SocketError
@logger.info("Socket error")
raise Errors::ServerUnreachable, url: Vagrant.server_url.to_s
end
def token_path
@env.data_dir.join("vagrant_login_token")
end
def store_two_factor_information(two_factor)
@two_factor_default_delivery_method =
two_factor['default_delivery_method']
@two_factor_delivery_methods =
two_factor['delivery_methods']
@env.ui.warn "2FA is enabled for your account."
if two_factor_default_delivery_method == APP
@env.ui.info "Enter the code from your authenticator."
else
@env.ui.info "Default method is " \View on GitHub (pinned to 35f3160f4a)
Solutions
- Verify basic connectivity: `curl -v https://vagrantcloud.com` (or your VAGRANT_SERVER_URL)
- Check DNS: `getent hosts vagrantcloud.com`; fix the resolver or VPN split-DNS if it fails
- Unset or correct the override: `env | grep VAGRANT` then `unset VAGRANT_SERVER_URL`
- If a proxy is required, export HTTP_PROXY/HTTPS_PROXY so Excon can reach the API
Example fix
# before (typo'd override in the environment) export VAGRANT_SERVER_URL=https://vagrantclod.com vagrant cloud search ubuntu # after unset VAGRANT_SERVER_URL vagrant cloud search ubuntu
Defensive patterns
Strategy: retry
Validate before calling
# Preflight reachability before starting a cloud-dependent job
require "socket"
require "uri"
host = URI.parse(ENV["VAGRANT_SERVER_URL"] || "https://vagrantcloud.com").host
begin
Socket.tcp(host, 443, connect_timeout: 5)
rescue SocketError, Errno::ECONNREFUSED, Errno::ETIMEDOUT => e
abort "cannot reach #{host}:443 (#{e.class}) — fix DNS/network first"
end Try / catch
retries = 0 begin client.whoami(token) rescue Vagrant::Errors::ServerUnreachable => e retries += 1 retry if retries <= 3 && sleep(2**retries) # transient DNS/network blips raise end
Prevention
- Run the TCP/DNS preflight above at the start of CI jobs that need Vagrant Cloud
- Audit VAGRANT_SERVER_URL in all environments — most cases are a typo'd override
- Configure HTTPS_PROXY explicitly on locked-down networks instead of hoping egress works
When it happens
Trigger: The machine is offline; DNS fails to resolve the API host; a firewall, VPN, or deny-by-default egress policy blocks the connection; VAGRANT_SERVER_URL is set to an unreachable or misspelled host. Any networked cloud subcommand (auth login, search, publish, box show, ...) triggers it.
Common situations: Offline or airplane development; CI runners without network access; typo'd VAGRANT_SERVER_URL in a .env; split-DNS or VPN configurations where vagrantcloud.com does not resolve; IPv6 misconfiguration.
Related errors
- There was an error while downloading the metadata for this b
- Vagrant failed to load a configured plugin source. This can
- An error occurred while uploading the file. The error messag
- This command was not invoked properly. The help for this com
- 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/a25aec8879c44632.
Report an issue: GitHub.