{"record":{"id":"0356247c4dcf4978","repo":"hashicorp/vagrant","slug":"a-vm-by-the-name-of-name-was-not-found","errorCode":null,"errorMessage":"A VM by the name of %{name} was not found.","messagePattern":"A VM by the name of %(.+?) was not found\\.","errorType":"exception","errorClass":"Vagrant::Errors::VMNotFoundError","httpStatus":null,"severity":"error","filePath":"lib/vagrant/plugin/v1/command.rb","lineNumber":96,"sourceCode":"\n          # First determine the proper array of VMs.\n          vms = []\n          if names.length > 0\n            names.each do |name|\n              if pattern = name[/^\\/(.+?)\\/$/, 1]\n                # This is a regular expression name, so we convert to a regular\n                # expression and allow that sort of matching.\n                regex = Regexp.new(pattern)\n\n                @env.vms.each do |name, vm|\n                  vms << vm if name =~ regex\n                end\n\n                raise Errors::VMNoMatchError if vms.empty?\n              else\n                # String name, just look for a specific VM\n                vms << @env.vms[name.to_sym]\n                raise Errors::VMNotFoundError, name: name if !vms[0]\n              end\n            end\n          else\n            vms = @env.vms_ordered\n          end\n\n          # Make sure we're only working with one VM if single target\n          if options[:single_target] && vms.length != 1\n            vm = @env.primary_vm\n            raise Errors::MultiVMTargetRequired if !vm\n            vms = [vm]\n          end\n\n          # If we asked for reversed ordering, then reverse it\n          vms.reverse! if options[:reverse]\n\n          # Go through each VM and yield it!\n          vms.each do |old_vm|","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/plugin/v1/command.rb#L78-L114","documentation":"A v1 command was given a plain (non-regex) VM name that does not exist in the current environment: @env.vms[name.to_sym] returned nil and the guard at lib/vagrant/plugin/v1/command.rb:96 raised. Valid names come from the `config.vm.define :name` entries in the Vagrantfile (or the implicit `:default` for single-machine projects). Name lookup is case-sensitive.","triggerScenarios":"`vagrant <cmd> web` where the Vagrantfile defines only :default or machines named differently; case mismatches (Web vs web); a name defined in a different project's Vagrantfile.","commonSituations":"Typos; commands copied from team chat or tutorials written for a different Vagrantfile; renaming a vm.define block without updating scripts that reference the old name.","solutions":["Run `vagrant status` to list the valid machine names for this environment","Correct the name, watching case sensitivity","If the machine should exist, add or fix its config.vm.define block in the Vagrantfile"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"valid = env.vms.keys.map(&:to_s)\nabort \"unknown VM '#{name}'; valid names: #{valid.join(', ')}\" unless valid.include?(name)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check `vagrant status` for exact machine names before batch operations","Machine names are case-sensitive symbols — match the config.vm.define key exactly","Centralize machine names in one variable when scripting"],"tags":["cli","vm-selection","not-found","v1-plugins"],"backgroundTag":"resource-not-found","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}