hashicorp/vagrant · warning

vagrant.commands.deprecated

Error message

vagrant.commands.deprecated

What it means

Warning printed by Vagrant's CommandDeprecation module whenever a command class that includes Vagrant::Util::CommandDeprecation has its execute method invoked. It warns that the command is deprecated using deprecation_command_name, then transparently forwards the invocation to non_deprecated_execute, so the command still runs.

Source

Thrown at lib/vagrant/util/command_deprecation.rb:36

      def self.included(klass)
        klass.class_eval do
          class << self
            if method_defined?(:synopsis)
              alias_method :non_deprecated_synopsis, :synopsis

              def synopsis
                if !non_deprecated_synopsis.to_s.empty?
                  "#{non_deprecated_synopsis} [DEPRECATED]"
                else
                  non_deprecated_synopsis
                end
              end
            end
          end
          alias_method :non_deprecated_execute, :execute

          def execute(*args, &block)
            @env[:ui].warn(I18n.t("vagrant.commands.deprecated",
              name: deprecation_command_name
            ) + "\n")
            non_deprecated_execute(*args, &block)
          end
        end
      end

      # Mark command deprecation complete and fully disable
      # the command's functionality
      module Complete
        def self.included(klass)
          klass.include(CommandDeprecation)
          klass.class_eval do
            def execute(*_)
              raise Vagrant::Errors::CommandDeprecated,
                name: deprecation_command_name
            end
          end

View on GitHub (pinned to 35f3160f4a)

Solutions

  1. Switch the invocation to the non-deprecated form — usually the plugin-prefixed name (e.g. use `vagrant cloud auth login` instead of the deprecated alias shown in the warning's name field).
  2. Run `vagrant list-commands` to see which commands are marked deprecated in your installed version.
  3. If the deprecated command comes from a plugin, update the plugin (`vagrant plugin update`) — maintainers remove the deprecation once the rename cycle completes; the Complete module later fully disables the command.
  4. Only if you must silence it during a migration window, filter stderr in your wrapper script — the command itself still works.

Example fix

# before (CI script)
vagrant login

# after
vagrant cloud auth login
Defensive patterns

Strategy: validation

Validate before calling

# Check command status before invoking
vagrant list-commands | grep -E "^\s*<command>" # presence + (deprecated) annotation
# or probe the class in a plugin test:
# klass.include?(Vagrant::Util::CommandDeprecation)

Prevention

When it happens

Trigger: Running any CLI command whose plugin class includes Vagrant::Util::CommandDeprecation (or its Complete variant), e.g. legacy top-level commands like `vagrant sahara` style aliases, `vagrant rsync-auto` era commands, or plugin commands aliased without their namespace. Every invocation of execute on such a class prints the warning before delegating.

Common situations: Scripts and CI jobs calling an old command spelling after a Vagrant upgrade renamed it into a plugin namespace (e.g. `vagrant login` vs `vagrant cloud auth login`); users seeing the banner on every run and wondering if the command failed (it did not — it still executes and returns the real exit status).

Related errors


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