{"record":{"id":"31c33f3d60c0240e","repo":"hashicorp/vagrant","slug":"the-snapshot-name-snapshot-name-was-not-found","errorCode":null,"errorMessage":"The snapshot name `%{snapshot_name}` was not found for the virtual machine `%{machine}`.","messagePattern":"The snapshot name `%(.+?)` was not found for the virtual machine `%(.+?)`\\.","errorType":"exception","errorClass":"Vagrant::Errors::SnapshotNotFound","httpStatus":null,"severity":"error","filePath":"plugins/commands/snapshot/command/delete.rb","lineNumber":38,"sourceCode":"          argv = parse_options(opts)\n          return if !argv\n          if argv.empty? || argv.length > 2\n            raise Vagrant::Errors::CLIInvalidUsage,\n              help: opts.help.chomp\n          end\n\n          name = argv.pop\n          with_target_vms(argv) do |vm|\n            if !vm.provider.capability?(:snapshot_list)\n              raise Vagrant::Errors::SnapshotNotSupported\n            end\n\n            snapshot_list = vm.provider.capability(:snapshot_list)\n\n            if snapshot_list.include? name\n              vm.action(:snapshot_delete, snapshot_name: name)\n            else\n              raise Vagrant::Errors::SnapshotNotFound,\n                snapshot_name: name,\n                machine: vm.name.to_s\n            end\n          end\n\n          # Success, exit status 0\n          0\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":20,"sourceCodeEnd":51,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/snapshot/command/delete.rb#L20-L51","documentation":"`vagrant snapshot delete [vm-name] <name>` could not find the snapshot: the provider's `snapshot_list` capability returned an array that does not include the given name. The command deliberately refuses to invoke the snapshot_delete action on a nonexistent snapshot because providers raise uglier errors in that case.","triggerScenarios":"Deleting a snapshot that was never taken, was already deleted, or differs by case/whitespace; targeting the wrong multi-machine VM (e.g. `vagrant snapshot delete web db_snap` where db_snap belongs to the db machine).","commonSituations":"Typos in scripted cleanup (`vagrant snapshot delete pre-migraion`); assuming a box ships with snapshots; stale names left in team docs after shared snapshots were deleted.","solutions":["List what exists with `vagrant snapshot list` (or `vagrant snapshot list <vm-name>`) and copy the exact name","In multi-machine projects, pass the correct vm-name so you target the machine that owns the snapshot","If the snapshot should exist, create it first with `vagrant snapshot save <name>`"],"exampleFix":"# before\nvagrant snapshot delete pre-migraion   # typo\n\n# after\nvagrant snapshot list                   # shows 'pre-migration'\nvagrant snapshot delete pre-migration","handlingStrategy":"validation","validationCode":"existing = `vagrant snapshot list`.split\nabort \"snapshot #{name} not found; have: #{existing.join(', ')}\" unless existing.include?(name)\nsystem(\"vagrant snapshot delete #{name}\")","typeGuard":null,"tryCatchPattern":"begin\n  command.execute\nrescue Vagrant::Errors::SnapshotNotFound => e\n  warn \"missing #{e.extra_data[:snapshot_name]} on #{e.extra_data[:machine]}\"\n  exit 1\nend","preventionTips":["Run `vagrant snapshot list` before delete/restore in scripts","Use a strict naming convention (lowercase, hyphens) for snapshots","In multi-machine projects always pass the vm-name that owns the snapshot"],"tags":["vagrant","snapshot","name-not-found","provider","virtualbox"],"backgroundTag":"name-not-found","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}