hashicorp/vagrant · error · Vagrant::Errors::ProvisionerFlagInvalid
'%{name}' is not a known provisioner. Please specify a valid
Error message
'%{name}' is not a known provisioner. Please specify a valid
provisioner. What it means
`vagrant up --provision-with X` (and reload/resume) raises ProvisionerFlagInvalid when X matches neither a provisioner name configured in the Vagrantfile nor a provisioner type registered by installed plugins. The check collects provisioner names across the targeted machines; if none of the flag values intersect those names, each value is looked up in the plugin manager's provisioner registry and any miss raises this error.
Source
Thrown at plugins/commands/up/start_mixins.rb:50
# This validates the provisioner flags and raises an exception
# if there are invalid ones.
def validate_provisioner_flags!(options, argv)
if options[:provision_types].nil?
return
end
provisioner_names = Set.new
with_target_vms(argv) do |machine|
machine.config.vm.provisioners.map(&:name).each do |name|
provisioner_names.add(name)
end
end
if (provisioner_names & options[:provision_types]).empty?
(options[:provision_types] || []).each do |type|
klass = Vagrant.plugin("2").manager.provisioners[type]
if !klass
raise Vagrant::Errors::ProvisionerFlagInvalid,
name: type.to_s
end
end
end
end
end
end
end
View on GitHub (pinned to 35f3160f4a)
Solutions
- Use the exact provisioner name from the Vagrantfile's `config.vm.provision "<name>"` (or its type, e.g. `shell`)
- Fix typos in the --provision-with value
- If the type comes from a plugin, install it (`vagrant plugin install ...`) and confirm with `vagrant plugin list`
Example fix
# before config.vm.provision 'bootstrap', type: 'shell' do |p| ... end # vagrant up --provision-with boostrap # typo # after # vagrant up --provision-with bootstrap
Defensive patterns
Strategy: validation
Validate before calling
declared = File.readlines('Vagrantfile').select { |l| l.include?('vm.provision') }
abort "no provisioner named #{flag} in this Vagrantfile" unless declared.any? { |l| l.include?(flag) }
system("vagrant up --provision-with #{flag}") Try / catch
begin
command.execute
rescue Vagrant::Errors::ProvisionerFlagInvalid => e
warn "#{e.extra_data[:name]} is not a known provisioner; check Vagrantfile names"
exit 1
end Prevention
- Extract --provision-with values from the same Vagrantfile source rather than hardcoding them
- Name provisioners explicitly (`config.vm.provision 'bootstrap', type: 'shell'`) and reference the names in scripts
- Verify plugin-provided provisioners with `vagrant plugin list` before using their type names
When it happens
Trigger: A typo like `--provision-with shl`; a plugin-provided type (e.g. chef_solo via plugin) whose plugin is not installed; passing a provisioner name defined only in a different machine's config while targeting machines that lack it.
Common situations: Custom-named provisioners (`config.vm.provision 'bootstrap', type: 'shell'`) where scripts pass the wrong identifier; workstations missing team plugins; docs drift after provisioners were renamed.
Related errors
- The push strategy '%{name}' is not defined in the Vagrantfil
- This Vagrant environment has specified that it requires the
- The box '%{name}' could not be found or could not be accesse
- There was an error while downloading the metadata for this b
- Multiple URLs for a box can't be specified when adding versi
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/8085621f90a89978.
Report an issue: GitHub.