{"record":{"id":"6bad2a2163acbc00","repo":"hashicorp/vagrant","slug":"machine-name-has-not-been-created-yet-and-th","errorCode":null,"errorMessage":"Machine '%{name}' has not been created yet, and therefore cannot save snapshots. Skipping...","messagePattern":"Machine '%(.+?)' has not been created yet, and therefore cannot save snapshots\\. Skipping\\.\\.\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"plugins/commands/snapshot/command/save.rb","lineNumber":51,"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\n          with_target_vms(argv) do |vm|\n            if !vm.provider.capability?(:snapshot_list)\n              raise Vagrant::Errors::SnapshotNotSupported\n            end\n\n            # In this case, no vm name was given, and we are iterating over the\n            # entire environment. If a vm hasn't been created yet, we can't list\n            # its snapshots\n            if vm.id.nil?\n              @env.ui.warn(I18n.t(\"vagrant.commands.snapshot.save.vm_not_created\",\n                                  name: vm.name))\n              next\n            end\n\n            snapshot_list = vm.provider.capability(:snapshot_list)\n\n            if !snapshot_list.include? name\n              vm.action(:snapshot_save, snapshot_name: name)\n            elsif options[:force]\n              # not a unique snapshot name\n              vm.action(:snapshot_delete, snapshot_name: name)\n              vm.action(:snapshot_save, snapshot_name: name)\n            else\n              raise Vagrant::Errors::SnapshotConflictFailed\n            end\n          end\n\n          # Success, exit status 0","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/snapshot/command/save.rb#L33-L69","documentation":"While `vagrant snapshot save` iterates target VMs, any machine whose vm.id is nil (never created, no entry in .vagrant) cannot take snapshots. That machine is named in this warning and skipped; remaining created machines still receive the snapshot and the command succeeds.","triggerScenarios":"`vagrant snapshot save my_snap` with no machine name, so with_target_vms iterates the entire environment while at least one machine has vm.id nil — e.g. a fresh checkout without `vagrant up`, or after destroying one machine of a multi-machine environment.","commonSituations":"Partially-up environments; running snapshot save right after destroying one node; CI runs against a clean project state.","solutions":["Create the machine first with `vagrant up <name>`, then re-run the snapshot","Target only the created machines: `vagrant snapshot save my_snap web db`","Accept the skip if intended — created machines are snapshotted and the command exits 0"],"exampleFix":"# before\nvagrant snapshot save snap1           # warns for not-created machines\n# after\nvagrant snapshot save snap1 web db     # only existing machines","handlingStrategy":"validation","validationCode":"# Check machine state before snapshotting\nvagrant status --machine-readable | grep ',state,' | grep -v ',not_created,'","typeGuard":"def machine_created?(machine)\n  !machine.id.nil? && machine.state.id != :not_created\nend","tryCatchPattern":null,"preventionTips":["Bring machines up before snapshot commands in multi-machine environments","Pass explicit machine names to `vagrant snapshot save`","Treat the warning as expected after partial destroys; exit code stays 0"],"tags":["vagrant","snapshot","machine-not-created","skip"],"backgroundTag":"operation-on-missing-resource","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}