hashicorp/vagrant · warning · Vagrant::Errors::BoxMetadataDownloadError

There was an error while downloading the metadata for this b

Error message

There was an error while downloading the metadata for this box.
The error message is shown below:

%{message}

What it means

The identical empty-run_list warning in run_chef_zero (chef_zero.rb:57-61), emitted just before CommandBuilder.command(:client, ..., local_mode: true). chef_zero runs chef-client in local mode against an in-guest Chef Zero server, so the run list must come entirely from the Vagrantfile — an empty list (default [] per base_runner.rb:64) means a no-op converge. The command still executes, so the warning is the only hint that provisioning did nothing.

Source

Thrown at lib/vagrant/action/builtin/box_add.rb:146

          if expanded && url.length == 1
            is_error = is_metadata_results.find do |b|
              b.is_a?(Errors::DownloaderError)
            end

            if is_error
              raise Errors::BoxAddShortNotFound,
                error: is_error.extra_data[:message],
                name: env[:box_url],
                url: url
            end
          end

          is_error = is_metadata_results.find do |b|
            b.is_a?(Errors::DownloaderError)
          end
          if is_error
            raise Errors::BoxMetadataDownloadError,  
              message: is_error.extra_data[:message]
          end

          is_metadata = is_metadata_results.any? { |b| b === true }
          if is_metadata && url.length > 1
            raise Errors::BoxAddMetadataMultiURL,
              urls: url.join(", ")
          end

          if is_metadata
            url = [url.first, authed_urls.first]
            add_from_metadata(url, env, expanded)
          else
            add_direct(authed_urls, env)
          end

          @app.call(env)
        end

View on GitHub (pinned to 35f3160f4a)

Solutions

  1. Add recipes/roles in the chef_zero block: chef.add_recipe "myapp" and chef.add_role "base".
  2. Or set chef.run_list = ["recipe[myapp]", "role[base]"] explicitly.
  3. Re-run `vagrant provision` and confirm the Chef output shows 'Running handlers' / recipes loaded rather than an instant exit.

Example fix

# Vagrantfile — before
config.vm.provision "chef_zero" do |chef|
  chef.cookbooks_path = "cookbooks"
end

# after
config.vm.provision "chef_zero" do |chef|
  chef.cookbooks_path = "cookbooks"
  chef.add_recipe "myapp"
end
Defensive patterns

Strategy: validation

Validate before calling

# Vagrantfile — guard inside the chef_zero block
config.vm.provision "chef_zero" do |chef|
  chef.cookbooks_path = "cookbooks"
  chef.add_recipe "myapp"
  raise "chef_zero run_list is empty — local mode has no server-side run list" if chef.run_list.empty?
end

Type guard

def chef_run_list_empty?(cfg)
  cfg.run_list.nil? || cfg.run_list.empty?
end

Prevention

When it happens

Trigger: `vagrant provision` with `config.vm.provision "chef_zero"` whose block configures cookbooks_path/roles_path/data_bags_path etc. but never adds recipes or roles; or a run list that got emptied by config merging across Vagrantfiles.

Common situations: Migrating from chef_solo to chef_zero and dropping the add_recipe lines during the edit; assuming data bags or roles alone trigger convergence; overrides from a wrapper Vagrantfile discarding the inner block's run list.

Related errors


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