hashicorp/vagrant · error · Vagrant::Errors::PluginSourceError

Vagrant failed to load a configured plugin source. This can

Error message

Vagrant failed to load a configured plugin source. This can be caused by a variety of issues including: transient connectivity issues, proxy filtering rejecting access to a configured plugin source, or a configured plugin source not responding correctly. Please review the error message below to help resolve the issue:

  %{error_msg}

Source: %{source}

What it means

PluginSourceError is raised by Vagrant::Bundler#validate_configured_sources! (lib/vagrant/bundler.rb:718) when a configured gem source fails src.load_specs(:released) with a Gem::Exception. It fires during plugin install/update (called from the install path at bundler.rb:581) and names both the failing source URI and the underlying error.

Source

Thrown at lib/vagrant/bundler.rb:718

        end
      end
      list.values
    end

    # Iterates each configured RubyGem source to validate that it is properly
    # available. If source is unavailable an exception is raised.
    def validate_configured_sources!
      Gem.sources.each_source do |src|
        begin
          src.load_specs(:released)
        rescue Gem::Exception => source_error
          if ENV["VAGRANT_ALLOW_PLUGIN_SOURCE_ERRORS"]
            @logger.warn("Failed to load configured plugin source: #{src}!")
            @logger.warn("Error received attempting to load source (#{src}): #{source_error}")
            @logger.warn("Ignoring plugin source load failure due user request via env variable")
          else
            @logger.error("Failed to load configured plugin source `#{src}`: #{source_error}")
            raise Vagrant::Errors::PluginSourceError,
              source: src.uri.to_s,
              error_msg: source_error.message
          end
        end
      end
    end

    # Generate the builtin resolver set
    def generate_builtin_set(system_plugins=[])
      builtin_set = BuiltinSet.new
      @logger.debug("Generating new builtin set instance.")
      vagrant_internal_specs.each do |spec|
        if !system_plugins.include?(spec.name)
          builtin_set.add_builtin_spec(spec)
        end
      end
      builtin_set
    end

View on GitHub (pinned to 35f3160f4a)

Solutions

  1. Test the source directly: 'gem fetch -s <source> rails' or curl the source's /specs.*/ endpoint to see the real failure
  2. Remove dead custom sources: 'vagrant plugin source list' then 'vagrant plugin source remove <url>'
  3. Fix network/proxy env (HTTPS_PROXY, SSL_CERT_FILE) so the source is reachable
  4. As an explicit opt-out for flaky sources, set VAGRANT_ALLOW_PLUGIN_SOURCE_ERRORS=1 (the code path in the source shows it only warns then)

Example fix

# before
vagrant plugin install vagrant-share   # PluginSourceError from dead source

# after
vagrant plugin source remove https://gems.old-corp.internal
vagrant plugin install vagrant-share
# or bypass when the source is known-flaky:
VAGRANT_ALLOW_PLUGIN_SOURCE_ERRORS=1 vagrant plugin install vagrant-share
Defensive patterns

Strategy: retry

Validate before calling

require 'net/http'
sources = `vagrant plugin source list`.split("\n")
sources.each do |s|
  uri = URI.join(URI(s), '/specs.4.8.gz') rescue URI(s)
  code = Net::HTTP.get_response(uri).code rescue 'ERR'
  warn "source #{s} unhealthy (#{code})" unless code == '200'
end

Try / catch

begin
  Vagrant::Bundler::new.init!([]) # plugin install path
rescue Vagrant::Errors::PluginSourceError => e
  retry_after_backoff(e) or raise # transient rubygems hiccups often clear
end

Prevention

When it happens

Trigger: Running 'vagrant plugin install/update/expunge' while one of the configured gem sources (default rubygems/Vagrant Cloud endpoint, or one added with 'vagrant plugin source add') is unreachable, filtered by a proxy, or returns a bad response. Setting VAGRANT_ALLOW_PLUGIN_SOURCE_ERRORS makes it log-and-continue instead of raising.

Common situations: Corporate proxies/MITM filtering blocking gems.rabbitmq.com-style or internal Artifactory/Gemfury sources; air-gapped machines; stale custom sources left from old team infrastructure; transient rubygems.org outages.

Related errors


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