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

  1. Use the exact provisioner name from the Vagrantfile's `config.vm.provision "<name>"` (or its type, e.g. `shell`)
  2. Fix typos in the --provision-with value
  3. 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

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


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