hashicorp/vagrant · error · Vagrant::Errors::BoxRemoveArchitectureNotFound
You requested to remove the box
Error message
You requested to remove the box '%{name}' version '%{version}'
with provider '%{provider}' and architecture '%{architecture}' but
that specific architecture is not installed. Please double-check
and try again. The available architectures are:
%{architectures} What it means
Raised by `vagrant box remove` when `--architecture X` was given but X is not among the installed architectures for that box/version/provider. The box collection data was already filtered down to the requested provider and version, so the mismatch is purely between the requested architecture string and what is on disk.
Solutions
- Read the architectures listed in the error message and re-run with exactly one of them (`--architecture amd64`).
- Verify the installed architecture with `vagrant box list` before retrying.
- If you just want the box gone, drop `--architecture` and use `--all-architectures` instead.
Example fix
# before vagrant box remove generic/ubuntu2204 --provider virtualbox --architecture arm64 # => BoxRemoveArchitectureNotFound (available: amd64) # after vagrant box remove generic/ubuntu2204 --provider virtualbox --architecture amd64
Defensive patterns
Strategy: validation
Validate before calling
# Use an architecture that actually appears in `vagrant box list`
installed=$(vagrant box list | awk -v box="$BOX_NAME" -v prov="$PROVIDER" '$0 ~ box" \("prov", {print $NF}' | tr -d ')')
case " $installed " in *" $WANT_ARCH "*) vagrant box remove "$BOX_NAME" --provider "$PROVIDER" --architecture "$WANT_ARCH";; *) echo "not installed: $WANT_ARCH (have: $installed)";; esac Prevention
- Use the exact architecture strings Vagrant prints (amd64, arm64, i386) rather than vendor synonyms like x86_64/aarch64.
- Treat the error message's architecture list as the source of truth and re-run with one of those values.
When it happens
Trigger: Running `vagrant box remove NAME --provider P --version V --architecture X` where X is not in box_info's architecture list for that provider/version (lib/vagrant/action/builtin/box_remove.rb:104-111). Typical: asking for `arm64` when only `amd64` is installed, or using a synonym like `x86_64`/`aarch64` that does not match the stored name.
Common situations: Confusion between arch spellings (amd64 vs x86_64, arm64 vs aarch64); boxes added under older Vagrant versions that recorded a default architecture; scripts hard-coding the wrong architecture for a box added on another host.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- You requested to remove the box
- feature will stop working in the next version.
- is deprecated. Please use the --provider flag. This
- The box you requested to be removed could not be found…
- WARNING: The second argument to `vagrant box remove`
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/62fd81e9b6b37b90.
Report an issue: GitHub.
Appendix: source
Thrown at lib/vagrant/action/builtin/box_remove.rb:105
# Only a single provider remains
box_provider = box_info.values.first.keys.first
# Further filtering only matters if not removing all architectures
if !box_remove_all_architectures
# If no architecture was given, check if there are more
# than a single architecture for the provider in version
if !box_architecture && box_info.values.first.values.first.size > 1
raise Errors::BoxRemoveMultiArchitecture,
name: box_name,
version: box_version,
provider: box_provider.to_s,
architectures: box_info.values.first.values.first.sort.join(", ")
end
# If architecture was given, check the provider for the version has it
if box_architecture
if !box_info.values.first.values.first.include?(box_architecture)
raise Errors::BoxRemoveArchitectureNotFound,
name: box_name,
version: box_version,
provider: box_provider.to_s,
architecture: box_architecture,
architectures: box_info.values.first.values.first.sort.join(", ")
else
box_info.values.first.values.first.delete_if { |v| v != box_architecture }
end
end
end
end
end
box_info.each do |version, provider_info|
provider_info.each do |provider, architecture_info|
provider = provider.to_sym
architecture_info.each do |architecture|
box = env[:box_collection].find(View on GitHub (pinned to 35f3160f4a)