{"record":{"id":"f262bc52095ff29f","repo":"hashicorp/vagrant","slug":"disk-name-no-longer-exists-in-vagrant-config-f262bc","errorCode":null,"errorMessage":"Disk '%{name}' no longer exists in Vagrant config. Removing and closing medium from guest...","messagePattern":"Disk '%(.+?)' no longer exists in Vagrant config\\. Removing and closing medium from guest\\.\\.\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/providers/virtualbox/cap/cleanup_disks.rb","lineNumber":42,"sourceCode":"        protected\n\n        # @param [Vagrant::Machine] machine\n        # @param [VagrantPlugins::Kernel_V2::VagrantConfigDisk] defined_disks\n        # @param [Array<Hash>] disk_meta - An array of all the previously defined disks from the last configure_disk action\n        def self.handle_cleanup_disk(machine, defined_disks, disk_meta)\n          raise TypeError, \"Expected `Array` but received `#{disk_meta.class}`\" if !disk_meta.is_a?(Array)\n          storage_controllers = machine.provider.driver.read_storage_controllers\n\n          primary = storage_controllers.get_primary_attachment\n          primary_uuid = primary[:uuid]\n\n          disk_meta.each do |d|\n            dsk = defined_disks.select { |dk| dk.name == d[\"name\"] }\n            if !dsk.empty? || d[\"uuid\"] == primary_uuid\n              next\n            else\n              LOGGER.warn(\"Found disk not in Vagrantfile config: '#{d[\"name\"]}'. Removing disk from guest #{machine.name}\")\n              machine.ui.warn(I18n.t(\"vagrant.cap.cleanup_disks.disk_cleanup\", name: d[\"name\"]), prefix: true)\n\n              controller = storage_controllers.get_controller(d[\"controller\"])\n              attachment = controller.get_attachment(uuid: d[\"uuid\"])\n\n              if !attachment\n                LOGGER.warn(\"Disk '#{d[\"name\"]}' not attached to guest, but still exists.\")\n              else\n                machine.provider.driver.remove_disk(controller.name, attachment[:port], attachment[:device])\n              end\n\n              machine.provider.driver.close_medium(d[\"uuid\"])\n            end\n          end\n        end\n\n        # @param [Vagrant::Machine] machine\n        # @param [VagrantPlugins::Kernel_V2::VagrantConfigDisk] defined_dvds\n        # @param [Array<Hash>] dvd_meta - An array of all the previously defined dvds from the last configure_disk action","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/providers/virtualbox/cap/cleanup_disks.rb#L24-L60","documentation":"Error \"Disk '%{name}' no longer exists in Vagrant config. Removing and closing medium from guest...\" thrown in hashicorp/vagrant.","triggerScenarios":"Thrown at plugins/providers/virtualbox/cap/cleanup_disks.rb:42 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}