{"record":{"id":"290c31da83000432","repo":"hashicorp/vagrant","slug":"the-incorrect-stage-was-given-to-the-trigger-plugi","errorCode":null,"errorMessage":"The incorrect stage was given to the trigger plugin:\nGuest: %{guest_name}\nName:  %{name}\nType:  %{type}\nStage: %{stage}\n\nThis is an internal error that should be reported as a bug.","messagePattern":"The incorrect stage was given to the trigger plugin:\nGuest: %(.+?)\nName:  %(.+?)\nType:  %(.+?)\nStage: %(.+?)\n\nThis is an internal error that should be reported as a bug\\.","errorType":"exception","errorClass":"Vagrant::Errors::TriggersNoStageGiven","httpStatus":null,"severity":"error","filePath":"lib/vagrant/plugin/v2/trigger.rb","lineNumber":89,"sourceCode":"        # @return [Array]\n        def find(name, stage, guest, type, all: false)\n          triggers = nil\n          name = nameify(name)\n\n          if stage == :before\n            triggers = config.before_triggers.select do |t|\n              (all && t.command.respond_to?(:to_sym) && t.command.to_sym == :all && !t.ignore.include?(name.to_sym)) ||\n                (type == :hook && matched_hook?(t.command, name)) ||\n                nameify(t.command) == name\n            end\n          elsif stage == :after\n            triggers = config.after_triggers.select do |t|\n              (all && t.command.respond_to?(:to_sym) && t.command.to_sym == :all && !t.ignore.include?(name.to_sym)) ||\n                (type == :hook && matched_hook?(t.command, name)) ||\n                nameify(t.command) == name\n            end\n          else\n            raise Errors::TriggersNoStageGiven,\n              name: name,\n              stage: stage,\n              type: type,\n              guest_name: guest\n          end\n\n          filter_triggers(triggers, guest, type)\n        end\n\n        protected\n\n        # Convert object into name\n        #\n        # @param [Object, Class] object Object to name\n        # @return [String]\n        def nameify(object)\n          if object.is_a?(Class)\n            object.name.to_s","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/plugin/v2/trigger.rb#L71-L107","documentation":"Internal invariant error in Vagrant::Plugin::V2::Trigger#find: the `stage` argument was neither :before nor :after, so no trigger set could be selected and the else branch raised (lib/vagrant/plugin/v2/trigger.rb:89). The message itself says this is an internal error that should be reported as a bug — it cannot be produced by any supported Vagrantfile trigger configuration, which only ever passes :before/:after.","triggerScenarios":"Vagrant core code (or a plugin monkey-patching Trigger internals) invoking the trigger lookup with a wrong stage symbol — e.g. a typo'd or newly introduced stage value that the if/elsif chain does not cover. Reached on any command that fires triggers once the bad stage is passed in.","commonSituations":"A regression in a specific Vagrant release's trigger scheduling; third-party plugins that wrap or re-implement Trigger#find with custom stage values; forks patched to add stages (e.g. :during) without extending this method.","solutions":["Upgrade Vagrant to a release where the trigger-stage bug is fixed — check the changelog for trigger fixes","Report a bug as the message instructs: include Vagrant version, the Vagrantfile, and the backtrace","If a third-party trigger-related plugin is installed, update or remove it and re-test to rule out interference"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"raise ArgumentError, \"stage must be :before or :after, got #{stage.inspect}\" unless %i[before after].include?(stage)","typeGuard":"# Ruby guard before calling Trigger#find or wrappers around it\ndef valid_trigger_stage?(stage)\n  %i[before after].include?(stage)\nend","tryCatchPattern":null,"preventionTips":["Pin Vagrant versions in CI that are known to work with your trigger configurations","Smoke-test Vagrantfiles that use triggers after every Vagrant upgrade","If you monkey-patch trigger internals, validate the stage argument yourself before delegating"],"tags":["triggers","internal-error","bug"],"backgroundTag":"invalid-enum-value","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}