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

The license file to install could not be found. Please verif

Error message

The license file to install could not be found. Please verify the path you gave is correct. The path to the license file given was: '%{path}'

What it means

The LicensePlugin middleware, invoked by `vagrant plugin license <name> <license-file>`, checks Pathname(env[:plugin_license_path]).file? and raises Vagrant::Errors::PluginInstallLicenseNotFound when the path is not an existing regular file, interpolating %{name} and %{path}. It fires before any copy happens.

Source

Thrown at plugins/commands/plugin/action/license_plugin.rb:26

require "log4r"

module VagrantPlugins
  module CommandPlugin
    module Action
      # This middleware licenses a plugin by copying the license file to
      # the proper place.
      class LicensePlugin
        def initialize(app, env)
          @app    = app
          @logger = Log4r::Logger.new("vagrant::plugins::plugincommand::license")
        end

        def call(env)
          # Verify the license file exists
          license_file = Pathname.new(env[:plugin_license_path])
          if !license_file.file?
            raise Vagrant::Errors::PluginInstallLicenseNotFound,
              name: env[:plugin_name],
              path: license_file.to_s
          end

          # Copy it in.
          final_path = env[:home_path].join("license-#{env[:plugin_name]}.lic")
          @logger.info("Copying license from: #{license_file}")
          @logger.info("Copying license to: #{final_path}")
          env[:ui].info(I18n.t("vagrant.commands.plugin.installing_license",
                               name: env[:plugin_name]))
          FileUtils.cp(license_file, final_path)

          # Installed!
          env[:ui].success(I18n.t("vagrant.commands.plugin.installed_license",
                                 name: env[:plugin_name]))

          @app.call(env)
        end

View on GitHub (pinned to 35f3160f4a)

Solutions

  1. Confirm the file exists: `ls -l <path>` from the directory where you run vagrant.
  2. Re-run with an absolute path: `vagrant plugin license <name> /abs/path/to/license.lic`.
  3. If the file is gone, re-download the license from the vendor portal and retry.

Example fix

# before
vagrant plugin license vagrant-vmware-desktop license.lic   # wrong cwd
# after
vagrant plugin license vagrant-vmware-desktop /home/me/Downloads/license.lic
Defensive patterns

Strategy: validation

Validate before calling

name, lic = ARGV
lic = File.expand_path(lic) if lic
abort 'usage: vagrant plugin license <name> <existing-file>' unless name && lic && File.file?(lic)
system('vagrant', 'plugin', 'license', name, lic)

Try / catch

begin
  Vagrant::Environment.new.cli(['plugin', 'license', name, lic])
rescue Vagrant::Errors::PluginInstallLicenseNotFound => e
  warn e.extra_data[:path]
  exit 1
end

Prevention

When it happens

Trigger: `vagrant plugin license my-plugin ./license.lic` when license.lic is not in the current directory; a typo'd filename; passing a directory; a path correct in your editor but wrong relative to where vagrant runs.

Common situations: Commercial plugins (e.g. the VMware provider) deliver a .lic file by download or email; users save it in Downloads or a project subfolder and pass a stale relative path.

Related errors


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