hashicorp/vagrant · warning
The command '%{cmd}' was not found for this trigger.
Error message
The command '%{cmd}' was not found for this trigger. What it means
A trigger scoped to a command (type :command or unset) checks its @command string against the registered command names from Vagrant.plugin("2").manager.commands.keys. If it matches none and is not :all, this warning prints during config validation; the trigger simply never fires for any command.
Source
Thrown at plugins/kernel_v2/config/vm_trigger.rb:228
end
end
# @return [Array] array of strings of error messages from config option validation
def validate(machine)
errors = _detected_errors
if @type && !VALID_TRIGGER_TYPES.include?(@type)
errors << I18n.t("vagrant.config.triggers.bad_trigger_type",
type: @type,
trigger: @command,
types: VALID_TRIGGER_TYPES.join(', '))
end
if @type == :command || !@type
commands = Vagrant.plugin("2").manager.commands.keys.map(&:to_s)
if !commands.include?(@command) && @command != :all
machine.ui.warn(I18n.t("vagrant.config.triggers.bad_command_warning",
cmd: @command))
end
end
if @run
errorz = @run.validate(machine)
errors.concat errorz["shell provisioner"] if !errorz.empty?
if @run.privileged == true
machine.ui.warn(I18n.t("vagrant.config.triggers.privileged_ignored",
command: @command))
end
if @run.powershell_args != ""
machine.ui.warn(I18n.t("vagrant.config.triggers.powershell_args_ignored"))
end
end
View on GitHub (pinned to 35f3160f4a)
Solutions
- Correct the command name to a registered command; run `vagrant list-commands` to see valid names
- Install the plugin that provides the command you reference in the trigger
- Use `:all` instead of a command name if the trigger should fire for every command
Example fix
# before
config.trigger.after :prvoision do |t|
t.run = { inline: "echo done" }
end
# after
config.trigger.after :provision do |t|
t.run = { inline: "echo done" }
end Defensive patterns
Strategy: type-guard
Validate before calling
# Tooling: assert trigger commands are registered
valid = Vagrant.plugin("2").manager.commands.keys.map(&:to_s)
trigger_cmds.each { |c| warn "unknown command #{c}" unless valid.include?(c.to_s) || c.to_s == "all" } Type guard
known_command = ->(cmd) { Vagrant.plugin("2").manager.commands.keys.map(&:to_s).include?(cmd.to_s) || cmd.to_s == "all" } Prevention
- Cross-check trigger command symbols against `vagrant list-commands`
- Install plugins before referencing their commands in triggers
- Prefer :all over guessed names when in doubt
When it happens
Trigger: A Vagrantfile with `config.trigger.after :prvoision do ... end` (typo of provision), or a trigger referencing a command provided by a plugin that is not installed, so the name is absent from the registered commands map.
Common situations: Typos in command symbols; referencing plugin commands without the plugin installed; command renames across Vagrant versions.
Related errors
- The push strategy '%{name}' is not defined in the Vagrantfil
- '%{name}' is not a known provisioner. Please specify a valid
- There was an error parsing the Vagrantfile: No config was gi
- vagrant.trigger.abort
- The `privileged` setting for option `run` for trigger comman
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/492e230a2028ef6f.
Report an issue: GitHub.