{"record":{"id":"eb5aecabdd2bdc2b","repo":"hashicorp/vagrant","slug":"vagrant-commands-deprecated","errorCode":null,"errorMessage":"vagrant.commands.deprecated","messagePattern":"vagrant\\.commands\\.deprecated","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"lib/vagrant/util/command_deprecation.rb","lineNumber":36,"sourceCode":"      def self.included(klass)\n        klass.class_eval do\n          class << self\n            if method_defined?(:synopsis)\n              alias_method :non_deprecated_synopsis, :synopsis\n\n              def synopsis\n                if !non_deprecated_synopsis.to_s.empty?\n                  \"#{non_deprecated_synopsis} [DEPRECATED]\"\n                else\n                  non_deprecated_synopsis\n                end\n              end\n            end\n          end\n          alias_method :non_deprecated_execute, :execute\n\n          def execute(*args, &block)\n            @env[:ui].warn(I18n.t(\"vagrant.commands.deprecated\",\n              name: deprecation_command_name\n            ) + \"\\n\")\n            non_deprecated_execute(*args, &block)\n          end\n        end\n      end\n\n      # Mark command deprecation complete and fully disable\n      # the command's functionality\n      module Complete\n        def self.included(klass)\n          klass.include(CommandDeprecation)\n          klass.class_eval do\n            def execute(*_)\n              raise Vagrant::Errors::CommandDeprecated,\n                name: deprecation_command_name\n            end\n          end","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/util/command_deprecation.rb#L18-L54","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["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).","Run `vagrant list-commands` to see which commands are marked deprecated in your installed version.","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.","Only if you must silence it during a migration window, filter stderr in your wrapper script — the command itself still works."],"exampleFix":"# before (CI script)\nvagrant login\n\n# after\nvagrant cloud auth login","handlingStrategy":"validation","validationCode":"# Check command status before invoking\nvagrant list-commands | grep -E \"^\\s*<command>\" # presence + (deprecated) annotation\n# or probe the class in a plugin test:\n# klass.include?(Vagrant::Util::CommandDeprecation)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer plugin-namespaced command spellings (e.g. `vagrant cloud auth login`) in all new scripts.","After each Vagrant upgrade, run your vagrant-based scripts once and fix any deprecation banners immediately — the Complete module later disables the command outright.","Pin the Vagrant version in CI containers so deprecations surface on your schedule, not mid-deploy."],"tags":["vagrant","deprecation","cli","i18n-warning"],"backgroundTag":"deprecated-command-invoked","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}