hashicorp/vagrant · warning
Trigger configured to continue on error...
Error message
Trigger configured to continue on error...
What it means
When a trigger's executed command fails — either TriggersBadExitCodes (exit code not in the allowed exit_codes list) or any raised exception — trigger.rb prints 'Trigger run encountered an error' plus the exception. If the trigger was configured with on_error: :continue, it then warns with vagrant.trigger.on_error_continue ('Trigger configured to continue on error...') and swallows the failure. This entry is that warning: an inner command failed but the Vagrant run proceeds by design.
Source
Thrown at lib/vagrant/plugin/v2/trigger.rb:292
options[:color] = :red if !config.keep_color
end
@ui.detail(data, **options)
end
if !exit_codes.include?(result.exit_code)
raise Errors::TriggersBadExitCodes,
code: result.exit_code
end
rescue => e
@ui.error(I18n.t("vagrant.errors.triggers_run_fail"))
@ui.error(e.message)
if on_error == :halt
@logger.debug("Trigger run encountered an error. Halting on error...")
raise e
else
@logger.debug("Trigger run encountered an error. Continuing on anyway...")
@ui.warn(I18n.t("vagrant.trigger.on_error_continue"))
end
end
end
# Runs a script on the guest
#
# @param [ShellProvisioner/Config] config A Shell provisioner config
def run_remote(config, on_error, exit_codes)
if !@machine
# machine doesn't even exist.
if on_error == :halt
raise Errors::TriggersGuestNotExist
else
@ui.warn(I18n.t("vagrant.errors.triggers_guest_not_exist"))
@ui.warn(I18n.t("vagrant.trigger.on_error_continue"))
return
end
elsif @machine.state.id != :runningView on GitHub (pinned to 35f3160f4a)
Solutions
- Treat the 'Trigger run encountered an error' line printed just above as the real failure and inspect its message
- Temporarily switch the trigger to on_error: :halt (the default) so failures stop the run and surface fully
- Fix the inner command: correct path/permissions, and whitelist expected codes via exit_codes: [0, 2]
- Keep :continue only for genuinely optional triggers
Example fix
# before
config.trigger.after :up do |t|
t.run = { inline: "./notify.sh" }
t.on_error = :continue # failure silently downgraded to warning
end
# after
config.trigger.after :up do |t|
t.run = { inline: "./notify.sh" }
t.on_error = :halt
t.exit_codes = [0, 2]
end Defensive patterns
Strategy: fallback
Validate before calling
# dry-run the trigger command before wiring it into a :continue trigger
system("./notify.sh") or ui.warn("notify.sh fails - fix before adding as trigger") Type guard
def trigger_halt?(trigger_config) trigger_config.on_error != :continue end
Try / catch
# mirror trigger.rb's own rescue when scripting around triggers
begin
run_trigger_command(cmd)
rescue => e
raise if on_error == :halt
ui.error("trigger failed, continuing: #{e.message}")
end Prevention
- Default triggers to on_error: :halt; opt into :continue per-trigger only for best-effort steps
- Pin exit_codes lists so expected failures don't even warn
- During debugging, flip :continue to :halt so real errors stop the run
When it happens
Trigger: A trigger with on_error: :continue whose run command exits non-zero or raises (missing script path, failing inline command, exit code not listed in exit_codes), during up/destroy/trigger runs; the generic rescue => e converts the failure into this warning.
Common situations: Best-effort CI triggers (notifications, cleanups) where failure shouldn't abort; accidentally setting :continue and never noticing real deploy-script failures; go/ruby triggers referencing files not on the host.
Related errors
- There was an error parsing the Vagrantfile: No config was gi
- Could not run remote script on guest because it does not exi
- There are errors in the configuration of this machine. Pleas
- The specified Vagrantfile to clone from was not found. Pleas
- There was an error loading a Vagrantfile. The file being loa
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/02318c773115ebca.
Report an issue: GitHub.