{"record":{"id":"531f8211b137141e","repo":"hashicorp/vagrant","slug":"the-box-you-re-attempting-to-add-has-no-available-531f82","errorCode":null,"errorMessage":"The box you're attempting to add has no available version that\nmatches the constraints you requested. Please double-check your\nsettings. Also verify that if you specified version constraints,\nthat the provider you wish to use is available for these constraints.\n\nBox: %{name}\nAddress: %{url}\nConstraints: %{constraints}\nAvailable versions: %{versions}","messagePattern":"The box you're attempting to add has no available version that\nmatches the constraints you requested\\. Please double-check your\nsettings\\. Also verify that if you specified version constraints,\nthat the provider you wish to use is available for these constraints\\.\n\nBox: %(.+?)\nAddress: %(.+?)\nConstraints: %(.+?)\nAvailable versions: %(.+?)","errorType":"exception","errorClass":"Vagrant::Errors::BoxAddNoMatchingVersion","httpStatus":null,"severity":"error","filePath":"lib/vagrant/action/builtin/box_add.rb","lineNumber":319,"sourceCode":"                raise Errors::BoxAddNoMatchingArchitecture,\n                  provider: Array(provider).join(\", \"),\n                  architecture: display_architecture,\n                  name: metadata.name,\n                  url: display_url,\n                  supported_providers: supported_providers\n              end\n\n              raise Errors::BoxAddNoMatchingProviderVersion,\n                constraints: version || \">= 0\",\n                provider: Array(provider).join(\", \"),\n                architecture: display_architecture,\n                name: metadata.name,\n                url: display_url,\n                versions: available_versions.reverse.join(\", \")\n            else\n              # Report that no version can match the constraints requested\n              # but show what versions are supported\n              raise Errors::BoxAddNoMatchingVersion,\n                constraints: version || \">= 0\",\n                name: metadata.name,\n                url: display_url,\n                versions: metadata.versions(architecture: architecture).reverse.join(\", \")\n            end\n          end\n\n          metadata_provider = nil\n          if provider\n            # If a provider was specified, make sure we get that specific\n            # version.\n            provider.each do |p|\n              metadata_provider = metadata_version.provider(p, architecture)\n              break if metadata_provider\n            end\n          elsif metadata_version.providers(architecture).length == 1\n            # If we have only one provider in the metadata, just use that\n            # provider.","sourceCodeStart":301,"sourceCodeEnd":337,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/action/builtin/box_add.rb#L301-L337","documentation":"Errors::BoxAddNoMatchingVersion is the no-provider-specified variant: your version constraints match no version of the box (for the requested architecture) at all. It is the generic 'no version matches' branch taken when provider filtering is not in play.","triggerScenarios":"No provider argument is given; metadata.version(version || '>= 0', provider: nil, architecture:) returns nil; the else branch raises with constraints, name, display_url, and versions: metadata.versions(architecture: architecture).reverse joined.","commonSituations":"'--box-version 1.2.3' for a box whose versions are 1.0 and 2.0; constraints like '>= 2.5, < 3' that fall in a gap; a box whose latest release was yanked leaving stale pins; copying box_version from docs for a different box.","solutions":["Choose a version from the 'Available versions' list in the error output.","Loosen the constraint ('~> 2.0') or remove --box-version to take the latest.","Check the box's version history on Vagrant Cloud for yanked/released versions before pinning.","Ensure the constraint syntax is valid RubyGem-style ranges; a typo like '2,.0' silently matches nothing."],"exampleFix":"# before\nvagrant box add --box-version \"1.2.3\" ubuntu/jammy64   # no 1.2.3 exists -> BoxAddNoMatchingVersion\n\n# after\nvagrant box add --box-version \"202303.0.0\" ubuntu/jammy64\n\n# or just take the latest\nvagrant box add ubuntu/jammy64","handlingStrategy":"validation","validationCode":"meta = Vagrant::BoxMetadata.new(File.open(metadata_json))\nconstraint = \"~> 2.0\"\nunless meta.version(constraint)\n  abort \"no version matches #{constraint}; available: #{meta.versions.join(', ')}\"\nend","typeGuard":"def constraint_satisfiable?(metadata, constraint)\n  !metadata.version(constraint).nil?\nend","tryCatchPattern":"begin\n  env.cli(\"box\", \"add\", \"--box-version\", constraint, name)\nrescue Vagrant::Errors::BoxAddNoMatchingVersion => e\n  # e.extra_data[:versions] lists every available version\n  abort \"choose one of: #{e.extra_data[:versions]}\"\nend","preventionTips":["Read the version list from the box page before writing box_version into shared Vagrantfiles.","Avoid constraints in gaps between major series; pin to versions you have verified exist."],"tags":["vagrant","box-add","version-constraints","metadata"],"backgroundTag":"version-constraint-mismatch","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}