{"record":{"id":"66bf7ab4aa99493e","repo":"hashicorp/vagrant","slug":"you-requested-to-remove-the-box-name-version-66bf7a","errorCode":null,"errorMessage":"You requested to remove the box '%{name}' version '%{version}'\nwith provider '%{provider}'. This box has multiple architectures.\nYou must explicitly select a single architecture to remove with\n`--architecture` or specify the `--all-architectures` flag to\nremove all architectures. The available architectures for this\nbox are:\n\n%{architectures}","messagePattern":"You requested to remove the box '%(.+?)' version '%(.+?)'\nwith provider '%(.+?)'\\. This box has multiple architectures\\.\nYou must explicitly select a single architecture to remove with\n`--architecture` or specify the `--all-architectures` flag to\nremove all architectures\\. The available architectures for this\nbox are:\n\n%(.+?)","errorType":"exception","errorClass":"Vagrant::Errors::BoxRemoveMultiArchitecture","httpStatus":null,"severity":"error","filePath":"lib/vagrant/action/builtin/box_remove.rb","lineNumber":95,"sourceCode":"                  raise Errors::BoxRemoveProviderNotFound,\n                    name: box_name,\n                    version: box_version,\n                    provider: box_provider.to_s,\n                    providers: box_info.values.first.keys.map(&:to_s).sort.join(\", \")\n                else\n                  box_info.values.first.delete_if { |k, _| k.to_s != box_provider.to_s }\n                end\n              end\n\n              # Only a single provider remains\n              box_provider = box_info.values.first.keys.first\n\n              # Further filtering only matters if not removing all architectures\n              if !box_remove_all_architectures\n                # If no architecture was given, check if there are more\n                # than a single architecture for the provider in version\n                if !box_architecture && box_info.values.first.values.first.size > 1\n                  raise Errors::BoxRemoveMultiArchitecture,\n                    name: box_name,\n                    version: box_version,\n                    provider: box_provider.to_s,\n                    architectures: box_info.values.first.values.first.sort.join(\", \")\n                end\n\n                # If architecture was given, check the provider for the version has it\n                if box_architecture\n                  if !box_info.values.first.values.first.include?(box_architecture)\n                    raise Errors::BoxRemoveArchitectureNotFound,\n                      name: box_name,\n                      version: box_version,\n                      provider: box_provider.to_s,\n                      architecture: box_architecture,\n                      architectures: box_info.values.first.values.first.sort.join(\", \")\n                  else\n                    box_info.values.first.values.first.delete_if { |v| v != box_architecture }\n                  end","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/action/builtin/box_remove.rb#L77-L113","documentation":"Raised by `vagrant box remove` when the selected box name/version/provider has more than one architecture installed (box_info's arch set size > 1) and the command line did not disambiguate. Since boxes can carry multiple architectures per provider (e.g. amd64 and arm64), Vagrant refuses to guess which one to delete. The message enumerates the installed architectures so you can pick one.","triggerScenarios":"Running `vagrant box remove NAME --provider PROVIDER` (optionally with `--version V`) where that provider/version has 2+ architectures installed, without passing `--architecture` or `--all-architectures`. In code it fires when box_architecture is nil, box_remove_all_architectures is false, and box_info.values.first.values.first.size > 1 (lib/vagrant/action/builtin/box_remove.rb:93-100).","commonSituations":"Apple Silicon users who previously added both x86_64 and arm64 builds of the same box; shared CI caches accumulating multi-arch boxes; scripts written before architecture support (Vagrant < 2.3.x) that assume one install per provider.","solutions":["Re-run the remove command with `--architecture <arch>` using one of the architectures listed in the error message (e.g. `vagrant box remove mybox --provider virtualbox --architecture arm64`).","Or pass `--all-architectures` to delete every architecture of that box/version/provider in one go.","Check what is actually installed first with `vagrant box list` (it shows provider and architecture per entry) to avoid a second wrong guess."],"exampleFix":"# before\nvagrant box remove generic/ubuntu2204 --provider virtualbox\n# => BoxRemoveMultiArchitecture (amd64, arm64 listed)\n\n# after\nvagrant box remove generic/ubuntu2204 --provider virtualbox --architecture arm64\n# or remove everything at once:\nvagrant box remove generic/ubuntu2204 --provider virtualbox --all-architectures","handlingStrategy":"validation","validationCode":"# Before removing, detect multi-arch installs and disambiguate\nlist=$(vagrant box list 2>/dev/null | grep -F \"${BOX_NAME} (${PROVIDER}\")\nif [ \"$(echo \"$list\" | grep -cE ', (amd64|x86_64|arm64|aarch64|i386)' )\" -gt 1 ] || [ \"$(echo \"$list\" | grep -c \"${BOX_NAME} (${PROVIDER}, \")\" )\" -ge 1 ]; then\n  vagrant box remove \"$BOX_NAME\" --provider \"$PROVIDER\" --all-architectures\nelse\n  vagrant box remove \"$BOX_NAME\" --provider \"$PROVIDER\"\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["In cleanup scripts always pass either --architecture or --all-architectures so behavior is deterministic on any Vagrant version.","Check `vagrant box list` output (it includes the architecture per entry) before scripted removals.","Pin one architecture per box in shared CI caches to keep remove scripts simple."],"tags":["vagrant","box-remove","architecture","cli"],"backgroundTag":"ambiguous-resource-selection","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}