hashicorp/vagrant · error · Vagrant::Errors::BoxNotFound

The box '%{name}' does not exist. Please double check and tr

Error message

The box '%{name}' does not exist. Please double check and
try again. You can see the boxes that are installed with
`vagrant box list`.

What it means

Raised by `vagrant box update --box <name>` (update_specific) when a scan over all installed boxes finds none whose name equals the requested one, leaving the box_info hash empty. The filter is `next if name != box_name` - exact string equality against the stored box name - so casing or slug differences (owner/name) count as not found.

Source

Thrown at plugins/commands/box/command/update.rb:72

            update_specific(options[:box], options[:provider], options[:architecture], download_options, options[:force])
          else
            update_vms(argv, options[:provider], download_options, options[:force])
          end

          0
        end

        def update_specific(name, provider, architecture, download_options, force)
          box_info = Vagrant::Util::HashWithIndifferentAccess.new
          @env.boxes.all.each do |box_name, box_version, box_provider, box_architecture|
            next if name != box_name
            box_info[box_provider] ||= Vagrant::Util::HashWithIndifferentAccess.new
            box_info[box_provider][box_version] ||= []
            box_info[box_provider][box_version].push(box_architecture.to_s).uniq!
          end

          if box_info.empty?
            raise Vagrant::Errors::BoxNotFound, name: name.to_s
          end

          if !provider
            if box_info.size > 1
              raise Vagrant::Errors::BoxUpdateMultiProvider,
                name: name.to_s,
                providers: box_info.keys.map(&:to_s).sort.join(", ")
            end

            provider = box_info.keys.first
          elsif !box_info[provider]
            raise Vagrant::Errors::BoxNotFoundWithProvider,
              name: name.to_s,
              provider: provider.to_s,
              providers: box_info.keys.map(&:to_s).sort.join(", ")
          end

          version = box_info[provider].keys.sort_by{ |v| Gem::Version.new(v) }.last

View on GitHub (pinned to 35f3160f4a)

Solutions

  1. Run `vagrant box list` and copy the exact stored name
  2. If missing, install it first: `vagrant box add <name>`
  3. Then retry `vagrant box update --box <exact-name>`

Example fix

# before
vagrant box update --box ubuntu
# error: box 'ubuntu' does not exist

# after
vagrant box list            # shows ubuntu/jammy
vagrant box add ubuntu/jammy # if not listed
vagrant box update --box ubuntu/jammy
Defensive patterns

Strategy: validation

Validate before calling

# bash: verify the box name exists before updating
vagrant box list | awk '{print $1}' | sort -u | grep -qx "$BOX" ||
  { echo "box not installed: $BOX"; vagrant box add "$BOX"; }

Type guard

# Ruby: exact-name check against the installed collection
def box_name_installed?(env, name)
  env.boxes.all.any? { |box_name, *_| box_name == name }
end

Prevention

When it happens

Trigger: `vagrant box update --box ubuntu/jammy` when the box is installed under a different name or not installed at all; passing a display name instead of the stored slug.

Common situations: Box never added on this machine; wrong owner prefix; assuming `--box` accepts a URL or a partial name.

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


AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21). Data as JSON: /api/errors/e6ddf179f48e9cb4. Report an issue: GitHub.