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

  1. Verify basic connectivity: `curl -v https://vagrantcloud.com` (or your VAGRANT_SERVER_URL)
  2. Check DNS: `getent hosts vagrantcloud.com`; fix the resolver or VPN split-DNS if it fails
  3. Unset or correct the override: `env | grep VAGRANT` then `unset VAGRANT_SERVER_URL`
  4. 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

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


AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21). Data as JSON: /api/errors/a25aec8879c44632. Report an issue: GitHub.