{"record":{"id":"0f3c18115d5e05c0","repo":"hashicorp/vagrant","slug":"the-box-you-requested-to-be-removed-could-not-be-f","errorCode":null,"errorMessage":"The box you requested to be removed could not be found. No\nboxes named '%{name}' could be found.","messagePattern":"The box you requested to be removed could not be found\\. No\nboxes named '%(.+?)' could be found\\.","errorType":"exception","errorClass":"Vagrant::Errors::BoxRemoveNotFound","httpStatus":null,"severity":"error","filePath":"lib/vagrant/action/builtin/box_remove.rb","lineNumber":35,"sourceCode":"          box_name     = env[:box_name]\n          box_architecture = env[:box_architecture] if env[:box_architecture]\n          box_provider = env[:box_provider].to_sym if env[:box_provider]\n          box_version  = env[:box_version]\n          box_remove_all_versions = env[:box_remove_all_versions]\n          box_remove_all_providers = env[:box_remove_all_providers]\n          box_remove_all_architectures = env[:box_remove_all_architectures]\n\n          box_info = Util::HashWithIndifferentAccess.new\n          env[:box_collection].all.each do |name, version, provider, architecture|\n            next if name != box_name\n            box_info[version] ||= Util::HashWithIndifferentAccess.new\n            box_info[version][provider] ||= []\n            box_info[version][provider] << architecture\n          end\n\n          # If there's no box info, then the box doesn't exist here\n          if box_info.empty?\n            raise Errors::BoxRemoveNotFound, name: box_name\n          end\n\n          # Filtering only matters if not removing all versions\n          if !box_remove_all_versions\n            # If no version was provided, and not removing all versions,\n            # only allow one version to proceed\n            if !box_version && box_info.size > 1\n              raise Errors::BoxRemoveMultiVersion,\n                name: box_name,\n                versions: box_info.keys.sort.map { |k| \" * #{k}\" }.join(\"\\n\")\n            end\n\n            # If a version was provided, make sure it exists\n            if box_version\n              if !box_info.keys.include?(box_version)\n                raise Errors::BoxRemoveVersionNotFound,\n                  name: box_name,\n                  version: box_version,","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/action/builtin/box_remove.rb#L17-L53","documentation":"Errors::BoxRemoveNotFound is raised by the BoxRemove builtin when the box collection contains zero entries whose name equals the requested box name. It is the plain 'no such box installed' guard before any version/provider disambiguation logic runs.","triggerScenarios":"vagrant box remove NAME scans env[:box_collection].all building box_info keyed by version/provider/architecture, skipping entries where name != box_name; if box_info is empty afterwards, the raise fires with name: box_name.","commonSituations":"Typos in the box name; removing a box already removed (double-run cleanup script); box lives under a different user/VAGRANT_HOME than the shell using; name confusion between 'ubuntu/jammy64' and a locally aliased name.","solutions":["Run 'vagrant box list' and copy the exact name shown there.","If the box is genuinely gone, no action is needed - treat this as already-clean.","Check VAGRANT_HOME / which user owns ~/.vagrant.d if the box shows in another context.","In scripts, tolerate this error (grep the box list first) so cleanup is idempotent."],"exampleFix":"# before\nvagrant box remove ubutnu/jammy64   # typo -> BoxRemoveNotFound\n\n# after\nvagrant box list\nvagrant box remove ubuntu/jammy64","handlingStrategy":"validation","validationCode":"installed = env.box_collection.all.map { |name, *, | name }.uniq\nexit 0 unless installed.include?(box_name)  # idempotent cleanup","typeGuard":"def box_present?(collection, name)\n  collection.all.any? { |n, *, | n == name }\nend","tryCatchPattern":"begin\n  env.cli(\"box\", \"remove\", name)\nrescue Vagrant::Errors::BoxRemoveNotFound\n  # already absent - safe to continue\nend","preventionTips":["Always read the exact name from 'vagrant box list' before removing.","Make cleanup scripts tolerant of absent boxes so re-runs stay idempotent.","Remember boxes are per-VAGRANT_HOME/per-user when names seem missing."],"tags":["vagrant","box-remove","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}