hashicorp/vagrant · error · Vagrant::Errors::CorruptMachineIndex

The machine index which stores all required information abou

Error message

The machine index which stores all required information about
running Vagrant environments has become corrupt. This is usually
caused by external tampering of the Vagrant data folder.

Vagrant cannot manage any Vagrant environments if the index is
corrupt. Please attempt to manually correct it. If you are unable
to manually correct it, then remove the data file at the path below.
This will leave all existing Vagrant environments "orphaned" and
they'll have to be destroyed manually.

Path: %{path}

What it means

Error "The machine index which stores all required information about running Vagrant environments has become corrupt. This is usually caused by external tampering of the Vagrant data folder. Vagrant cannot manage any Vagrant environments if the index is corrupt. Please attempt to manually correct it. If you are unable to manually correct it, then remove the data file at the path below. This will leave all existing Vagrant environments "orphaned" and they'll have to be destroyed manually. Path: %{path}" thrown in hashicorp/vagrant.

Source

Thrown at lib/vagrant/machine_index.rb:327

          # Another process is probably opened it, no problem.
        end

        @machine_locks.delete(id)
      end
    end

    # This will reload the data without locking the index. It is assumed
    # the caller with lock the index outside of this call.
    #
    # @param [File] f
    def unlocked_reload
      return if !@index_file.file?

      data = nil
      begin
        data = JSON.load(@index_file.read)
      rescue JSON::ParserError
        raise Errors::CorruptMachineIndex, path: @index_file.to_s
      end

      if data
        if !data["version"] || data["version"].to_i != 1
          raise Errors::CorruptMachineIndex, path: @index_file.to_s
        end

        @machines = data["machines"] || {}
      end
    end

    # Saves the index.
    def unlocked_save
      @index_file.open("w") do |f|
        f.write(JSON.dump({
          "version"  => 1,
          "machines" => @machines,
        }))

View on GitHub (pinned to 35f3160f4a)

When it happens

Trigger: Thrown at lib/vagrant/machine_index.rb:327 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21). Data as JSON: /api/errors/e0be2b998368ca4a. Report an issue: GitHub.