{"record":{"id":"b04d7bfcddd71ae9","repo":"hashicorp/vagrant","slug":"an-error-occurred-while-executing-multiple-actions","errorCode":null,"errorMessage":"An error occurred while executing multiple actions in parallel. Any errors that occurred are shown below.\n\n%{message}","messagePattern":"An error occurred while executing multiple actions in parallel\\. Any errors that occurred are shown below\\.\n\n%(.+?)","errorType":"exception","errorClass":"Vagrant::Errors::BatchMultiError","httpStatus":null,"severity":"error","filePath":"lib/vagrant/batch_action.rb","lineNumber":167,"sourceCode":"          if !thread[:error].is_a?(Errors::VagrantError)\n            e       = thread[:error]\n            message = e.message\n            message += \"\\n\"\n            message += \"\\n#{e.backtrace.join(\"\\n\")}\"\n\n            errors << I18n.t(\"vagrant.general.batch_unexpected_error\",\n                             machine: thread[:machine].name,\n                             message: message)\n          else\n            errors << I18n.t(\"vagrant.general.batch_vagrant_error\",\n                             machine: thread[:machine].name,\n                             message: thread[:error].message)\n          end\n        end\n      end\n\n      if !errors.empty?\n        raise Errors::BatchMultiError, message: errors.join(\"\\n\\n\")\n      end\n\n      # Check if any threads set an exit code and exit if found. If\n      # multiple threads have exit code values set, the first encountered\n      # will be the value used.\n      threads.each do |thread|\n        if thread[:exit_code]\n          @logger.debug(\"Found exit code set within batch action thread. Exiting\")\n          Process.exit!(thread[:exit_code])\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":149,"sourceCodeEnd":182,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/batch_action.rb#L149-L182","documentation":"BatchMultiError is raised at the end of BatchAction#run (lib/vagrant/batch_action.rb:167) when one or more machine-action threads recorded an error. It aggregates the per-machine failure messages (joined with blank lines) collected from thread[:error] / unexpected exceptions, so the body lists each machine that failed and why.","triggerScenarios":"Running a multi-machine action in parallel ('vagrant up' with parallel enabled, e.g. VirtualBox provider) where at least one machine's action raises a VagrantError or an unexpected exception; after all threads join, errors is non-empty and the combined error is raised. A thread setting thread[:exit_code] can also cause Process.exit! right after.","commonSituations":"'vagrant up' on a Vagrantfile with several VMs where one has a bad box or provider error; parallel provision where one node cannot reach the network; partial infra failures hidden behind one combined message.","solutions":["Read the per-machine sections inside the error body: each block names the machine and its real message; fix that root error first","Re-run only the failed machines: 'vagrant up <machine-name>' to iterate faster","Disable parallelism to get linear, uncluttered output: VAGRANT_NO_PARALLEL=1 vagrant up","Re-run with '--debug' (DEBUG=1) for a stack trace of the failing thread"],"exampleFix":"# before\nvagrant up\n\n# after (isolate the failing machine, sequential output)\nVAGRANT_NO_PARALLEL=1 vagrant up web","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"begin\n  Vagrant::BatchAction.new(true).tap do |b|\n    machines.each { |m| b.custom(m) { |machine| machine.action(:up) } }\n    b.run\n  end\nrescue Vagrant::Errors::BatchMultiError => e\n  # e.message body: one block per failed machine\n  failed = e.message.split(\"\\n\\n\")\n  failed.each { |blk| report(blk) }\nend","preventionTips":["Run 'VAGRANT_NO_PARALLEL=1 vagrant up' in CI for deterministic, single-stream failures","Target single machines ('vagrant up web') when iterating on one node"],"tags":["vagrant","parallel","multi-machine","batch-action","aggregated-errors"],"backgroundTag":"parallel-execution-partial-failure","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}