{"record":{"id":"c472b9f247580103","repo":"hashicorp/vagrant","slug":"you-requested-to-remove-the-box-name-version","errorCode":null,"errorMessage":"You requested to remove the box '%{name}' version '%{version}',\nbut that specific version of the box is not installed. Please\ndouble-check and try again. The available versions for this box\nare:\n\n%{versions}","messagePattern":"You requested to remove the box '%(.+?)' version '%(.+?)',\nbut that specific version of the box is not installed\\. Please\ndouble-check and try again\\. The available versions for this box\nare:\n\n%(.+?)","errorType":"exception","errorClass":"Vagrant::Errors::BoxRemoveVersionNotFound","httpStatus":null,"severity":"error","filePath":"lib/vagrant/action/builtin/box_remove.rb","lineNumber":51,"sourceCode":"          # 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,\n                  versions: box_info.keys.sort.map { |k| \" * #{k}\" }.join(\"\\n\")\n              else\n                box_info.delete_if { |k, _| k != box_version }\n              end\n            end\n\n            # Only a single version remains\n            box_version = box_info.keys.first\n\n            # Further filtering only matters if not removing all providers\n            if !box_remove_all_providers\n              # If no provider was given, check if there are more\n              # than a single provider for the version\n              if !box_provider && box_info.values.first.size > 1\n                raise Errors::BoxRemoveMultiProvider,\n                  name: box_name,","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/action/builtin/box_remove.rb#L33-L69","documentation":"Errors::BoxRemoveVersionNotFound is raised when an explicit --box-version was given for removal but that version is not installed for the named box. The error lists the versions that actually are installed.","triggerScenarios":"box_version is truthy and !box_info.keys.include?(box_version) after the collection scan; the raise carries name, the requested version, and the sorted installed versions as ' * version' lines.","commonSituations":"The version string is misformatted (202303 vs 202303.0.0 - Cloud boxes use full triplets); the version was already removed by a previous cleanup run; docs/README pins a version the user never installed.","solutions":["Copy the exact version string from the error's 'available versions' list.","Run 'vagrant box list' to see canonical name/version formatting.","Drop --box-version (with --all if multiple) when the exact version does not matter."],"exampleFix":"# before\nvagrant box remove ubuntu/jammy64 --box-version 202303   # real string is 202303.0.0\n\n# after\nvagrant box remove ubuntu/jammy64 --box-version 202303.0.0","handlingStrategy":"validation","validationCode":"installed = env.box_collection.all\n  .select { |n, *, | n == box_name }.map { |_, v, *, | v }\nexit 0 unless installed.include?(requested_version)","typeGuard":"def version_installed?(collection, name, version)\n  collection.all.any? { |n, v, *, | n == name && v == version }\nend","tryCatchPattern":"begin\n  env.cli(\"box\", \"remove\", name, \"--box-version\", ver)\nrescue Vagrant::Errors::BoxRemoveVersionNotFound => e\n  # e.extra_data[:versions] lists what is really installed\n  warn \"installed versions: #{e.extra_data[:versions]}\"\nend","preventionTips":["Copy version strings verbatim from 'vagrant box list' (full triplets like 202303.0.0).","Derive the version to remove from the collection at runtime instead of hardcoding it in scripts."],"tags":["vagrant","box-remove","version-not-installed"],"backgroundTag":"version-not-installed","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}