hashicorp/vagrant · error · VagrantPlugins::Chef::Provisioner::Base::ChefError
Chef never successfully completed! Any errors should be visi
Error message
Chef never successfully completed! Any errors should be visible in the output above. Please fix your recipes so that they properly complete.
What it means
Raised at the end of the chef_zero provisioner's convergence run, which uses the same loop as chef_solo/chef_client: stream output, treat exit 259 as reboot-and-continue, return on exit 0, otherwise re-run up to `config.attempts` times, then raise :no_convergence. chef_zero runs against a local in-memory Chef server, so failures are recipe/cookbook errors or local upload problems, visible in the output above.
Source
Thrown at plugins/provisioners/chef/provisioner/chef_zero.rb:102
opts = { error_check: false, elevated: true }
exit_status = @machine.communicate.sudo(command, opts) do |type, data|
# Output the data with the proper color based on the stream.
color = type == :stdout ? :green : :red
data = data.chomp
next if data.empty?
@machine.ui.info(data, color: color)
end
# There is no need to run Chef again if it converges
return if exit_status == 0
end
end
# If we reached this point then Chef never converged! Error.
raise ChefError, :no_convergence
end
def verify_shared_folders(folders)
folders.each do |folder|
@logger.debug("Checking for shared folder: #{folder}")
if !@machine.communicate.test("test -d #{folder}", sudo: true)
raise ChefError, :missing_shared_folders
end
end
end
protected
# Extracts only the remote paths from a list of folders
def guest_paths(folders)
folders.map { |parts| parts[2] }
end
endView on GitHub (pinned to 35f3160f4a)
Solutions
- Read the streamed output above - fix the first failing resource
- Confirm roles/data_bags/environments paths exist on host and are mounted: `chef.roles_path`, `chef.data_bags_path`, `chef.environments_path`
- If using encrypted data bags, verify `chef.encrypted_data_bag_secret_path` points at the real secret
- Set `chef.attempts = 3` to ride out transient package/network failures inside recipes
Example fix
# Vagrantfile - before config.vm.provision "chef_zero" do |chef| chef.run_list = ["recipe[myapp]"] end # Vagrantfile - after config.vm.provision "chef_zero" do |chef| chef.run_list = ["recipe[myapp]"] chef.data_bags_path = "data_bags" chef.encrypted_data_bag_secret_path = "secrets/databag_key" end
Defensive patterns
Strategy: retry
Try / catch
begin
env.cli(%w[provision])
rescue Vagrant::Errors::VagrantError => e
if e.to_s.include?("never successfully completed") && Time.now.hour.between?(2, 4) # mirror maintenance window
sleep 300; retry
end
raise
end Prevention
- Validate data bags locally: `knife data bag from file` against a chef-zero server in CI before Vagrant runs them
- Keep encrypted_data_bag_secret_path under version-controlled provisioning config (gitignored secret file itself)
- Set chef.attempts so mirror hiccups self-heal instead of failing the build
When it happens
Trigger: chef-zero/solo-legacy run exiting non-zero on every attempt: recipe failures, missing data bags/roles/environments passed to the zero server, encrypted data bag secret issues, or cookbook dependency errors.
Common situations: Same as chef_solo plus: encrypted_data_bag_secret path wrong or secret missing so recipes fail on decryption; environments/roles referenced in run_list but not present in the configured paths; migrating from chef_solo with legacy_mode confusion.
Related errors
- Chef never successfully completed! Any errors should be visi
- Chef never successfully completed! Any errors should be visi
- Shared folders that Chef requires are missing on the virtual
- This Vagrant environment has specified that it requires the
- There was an error while downloading the metadata for this b
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/74879d54bddb9e9f.
Report an issue: GitHub.