{"record":{"id":"9e153713461a1939","repo":"hashicorp/vagrant","slug":"the-push-strategy-name-is-not-defined-in-the","errorCode":null,"errorMessage":"The push strategy '%{name}' is not defined in the Vagrantfile. Defined\nstrategy names are:\n\n    %{pushes}","messagePattern":"The push strategy '%(.+?)' is not defined in the Vagrantfile\\. Defined\nstrategy names are:\n\n    %(.+?)","errorType":"exception","errorClass":"Vagrant::Errors::PushStrategyNotDefined","httpStatus":null,"severity":"error","filePath":"lib/vagrant/environment.rb","lineNumber":697,"sourceCode":"    # This executes the push with the given name, raising any exceptions that\n    # occur.\n    #\n    # @param name [String] Push plugin name\n    # @param manager [Vagrant::Plugin::Manager] Plugin Manager to use,\n    # defaults to the primary one registered but parameterized so it can be\n    # overridden in server mode\n    #\n    # @see VagrantPlugins::CommandServe::Service::PushService Server mode behavior\n    #\n    # Precondition: the push is not nil and exists.\n    def push(name, manager: Vagrant.plugin(\"2\").manager)\n      @logger.info(\"Getting push: #{name}\")\n\n      name = name.to_sym\n\n      pushes = self.vagrantfile.config.push.__compiled_pushes\n      if !pushes.key?(name)\n        raise Vagrant::Errors::PushStrategyNotDefined,\n          name: name,\n          pushes: pushes.keys\n      end\n\n      strategy, config = pushes[name]\n      push_registry = manager.pushes\n      klass, _ = push_registry.get(strategy)\n      if klass.nil?\n        raise Vagrant::Errors::PushStrategyNotLoaded,\n          name: strategy,\n          pushes: push_registry.keys\n      end\n\n      klass.new(self, config).push\n    end\n\n    # The list of pushes defined in this Vagrantfile.\n    #","sourceCodeStart":679,"sourceCodeEnd":715,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/environment.rb#L679-L715","documentation":"Raised as Vagrant::Errors::PushStrategyNotDefined from Vagrant::Environment#push (lib/vagrant/environment.rb:697) when the requested name is not a key in vagrantfile.config.push.__compiled_pushes — the set of `config.push.define \"name\"` blocks in the Vagrantfile. The error lists the names that are defined so you can pick one.","triggerScenarios":"Running `vagrant push staging` (or calling env.push(\"staging\")) when the Vagrantfile contains no `config.push.define \"staging\" do |push| ... end` block, or the name is mistyped/renamed, or you are in a directory served by a fallback Vagrantfile (home/root) that defines no pushes.","commonSituations":"Deploying from memory with a stale stage name after the Vagrantfile was refactored; running push from the wrong project directory; teammates' checkouts missing the push definition because it lives in an uncommitted file.","solutions":["Compare the name you passed against the \"Defined strategy names\" list printed in the error","Add the missing definition in Vagrant.configure: config.push.define \"<name>\" do |push| ... end","If the push is defined in another project's Vagrantfile, run vagrant push from that project directory","Commit and pull the Vagrantfile changes that define the push so all machines see it"],"exampleFix":"# before — Vagrantfile defines nothing, so `vagrant push staging` fails\nVagrant.configure(\"2\") do |config|\n  config.vm.box = \"ubuntu/jammy64\"\nend\n\n# after\nVagrant.configure(\"2\") do |config|\n  config.vm.box = \"ubuntu/jammy64\"\n  config.push.define \"staging\" do |push|\n    push.path = \".\"\n  end\nend","handlingStrategy":"validation","validationCode":"name = \"staging\"\ndefined = env.pushes   # Array<Symbol> from config.push.__compiled_pushes\nunless defined.include?(name.to_sym)\n  abort \"No push named '#{name}'; defined: #{defined.join(', ')}\"\nend\nenv.push(name)","typeGuard":null,"tryCatchPattern":"begin\n  env.push(name)\nrescue Vagrant::Errors::PushStrategyNotDefined => e\n  abort \"Unknown push '#{e.extra_data[:name]}'; pick one of: #{Array(e.extra_data[:pushes]).join(', ')}\"\nend","preventionTips":["Source push names from a single config so scripts and Vagrantfile cannot drift","List available pushes via env.pushes before prompting users for a name","Commit push definitions together with the deploy scripts that reference them"],"tags":["vagrant","push","deployment","configuration"],"backgroundTag":"unknown-strategy-name","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}