{"record":{"id":"0417db6a4236e05c","repo":"hashicorp/vagrant","slug":"the-snapshot-name-snapshot-name-was-not-found-0417db","errorCode":null,"errorMessage":"The snapshot name `%{snapshot_name}` was not found for the\nvirtual machine `%{machine}`.","messagePattern":"The snapshot name `%(.+?)` was not found for the\nvirtual machine `%(.+?)`\\.","errorType":"exception","errorClass":"Vagrant::Errors::SnapshotNotFound","httpStatus":null,"severity":"error","filePath":"plugins/commands/snapshot/command/restore.rb","lineNumber":55,"sourceCode":"          end\n\n          # Validate the provisioners\n          validate_provisioner_flags!(options, argv)\n\n          name = argv.pop\n          options[:snapshot_name] = name\n\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_restore, options)\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":37,"sourceCodeEnd":68,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/snapshot/command/restore.rb#L37-L68","documentation":"`vagrant snapshot restore [vm-name] <name>` could not find the snapshot: the provider's `snapshot_list` capability does not include the given name. As with delete, Vagrant checks membership before dispatching the snapshot_restore action and raises SnapshotNotFound naming the machine and the missing snapshot.","triggerScenarios":"Restoring a snapshot that was never saved on that machine, was deleted, or differs by case/whitespace; targeting the wrong vm in a multi-machine environment.","commonSituations":"Rollback scripts referencing snapshots a teammate already deleted; renaming snapshots outside Vagrant (via the provider GUI) so the list no longer matches; case-sensitive name mismatches.","solutions":["Run `vagrant snapshot list` (optionally with the vm-name) and copy the exact name","Confirm you are targeting the machine that owns the snapshot by passing the vm-name","Re-save the snapshot with `vagrant snapshot save <name>` if it should exist"],"exampleFix":"# before\nvagrant snapshot restore db clean-db   # snapshot lives on 'web' machine\n\n# after\nvagrant snapshot restore web clean-db","handlingStrategy":"validation","validationCode":"existing = `vagrant snapshot list`.split\nabort \"snapshot #{name} not found; have: #{existing.join(', ')}\" unless existing.include?(name)\nsystem(\"vagrant snapshot restore #{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":["List snapshots before restoring in automation","Do not rename snapshots outside Vagrant (provider GUI) if scripts reference them","Target the exact machine with the vm-name argument in multi-machine setups"],"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"}