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 != :running

View on GitHub (pinned to 35f3160f4a)

Solutions

  1. Treat the 'Trigger run encountered an error' line printed just above as the real failure and inspect its message
  2. Temporarily switch the trigger to on_error: :halt (the default) so failures stop the run and surface fully
  3. Fix the inner command: correct path/permissions, and whitelist expected codes via exit_codes: [0, 2]
  4. 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

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


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