hashicorp/vagrant · error · Vagrant::Errors::SnapshotNotFound
The snapshot name `%{snapshot_name}` was not found for the v
Error message
The snapshot name `%{snapshot_name}` was not found for the virtual machine `%{machine}`. What it means
`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.
Source
Thrown at plugins/commands/snapshot/command/delete.rb:38
argv = parse_options(opts)
return if !argv
if argv.empty? || argv.length > 2
raise Vagrant::Errors::CLIInvalidUsage,
help: opts.help.chomp
end
name = argv.pop
with_target_vms(argv) do |vm|
if !vm.provider.capability?(:snapshot_list)
raise Vagrant::Errors::SnapshotNotSupported
end
snapshot_list = vm.provider.capability(:snapshot_list)
if snapshot_list.include? name
vm.action(:snapshot_delete, snapshot_name: name)
else
raise Vagrant::Errors::SnapshotNotFound,
snapshot_name: name,
machine: vm.name.to_s
end
end
# Success, exit status 0
0
end
end
end
end
end
View on GitHub (pinned to 35f3160f4a)
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>`
Example fix
# before vagrant snapshot delete pre-migraion # typo # after vagrant snapshot list # shows 'pre-migration' vagrant snapshot delete pre-migration
Defensive patterns
Strategy: validation
Validate before calling
existing = `vagrant snapshot list`.split
abort "snapshot #{name} not found; have: #{existing.join(', ')}" unless existing.include?(name)
system("vagrant snapshot delete #{name}") Try / catch
begin
command.execute
rescue Vagrant::Errors::SnapshotNotFound => e
warn "missing #{e.extra_data[:snapshot_name]} on #{e.extra_data[:machine]}"
exit 1
end Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- The snapshot name `%{snapshot_name}` was not found for the v
- You requested to remove the box '%{name}' version '%{version
- No synced folder implementation is available for your synced
- The clone environment hasn't been created yet. To clone from
- The guest machine entered an invalid state while waiting for
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/31c33f3d60c0240e.
Report an issue: GitHub.