{"record":{"id":"a252dadfa81babe1","repo":"hashicorp/vagrant","slug":"the-push-strategy-name-is-not-defined-in-the-a252da","errorCode":null,"errorMessage":"The push strategy '%{name}' is not defined in the Vagrantfile. Defined strategy names are: %{pushes}","messagePattern":"The push strategy '%(.+?)' is not defined in the Vagrantfile\\. Defined strategy names are: %(.+?)","errorType":"exception","errorClass":"Vagrant::Errors::PushStrategyNotDefined","httpStatus":null,"severity":"error","filePath":"plugins/commands/push/command.rb","lineNumber":69,"sourceCode":"      #   the compiled list of pushes\n      #\n      def validate_pushes!(pushes, name = nil)\n        if pushes.nil? || pushes.empty?\n          raise Vagrant::Errors::PushesNotDefined\n        end\n\n        if name.nil?\n          if pushes.length == 1\n            return pushes.first.to_sym\n          else\n            raise Vagrant::Errors::PushStrategyNotProvided,\n              pushes: pushes.map(&:to_s)\n          end\n        end\n\n        name = name.to_sym\n        if !pushes.include?(name)\n          raise Vagrant::Errors::PushStrategyNotDefined,\n            name: name.to_s,\n            pushes: pushes.map(&:to_s)\n        end\n\n        return name\n      end\n    end\n  end\nend\n","sourceCodeStart":51,"sourceCodeEnd":79,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/push/command.rb#L51-L79","documentation":"Raised by `vagrant push <name>` when the requested strategy does not match any `config.push.define` block in the Vagrantfile. validate_pushes! symbolizes the given name and checks membership in the compiled pushes list; on mismatch it raises PushStrategyNotDefined listing every strategy that IS defined. Almost always a typo or a stale command from a different version of the Vagrantfile.","triggerScenarios":"Running e.g. `vagrant push heroku` when the Vagrantfile only defines `ftp` and `local-exec`; invoking with a name whose define block was renamed or removed; calling validate_pushes!(pushes, name) where !pushes.include?(name.to_sym).","commonSituations":"Renaming a push block in the Vagrantfile while CI still calls the old name; copy-pasting a push command from another project's docs; case mismatches like `vagrant push FTP` because names are compared as exact symbols.","solutions":["Re-run with one of the names listed in the error message (those are the strategies actually defined)","Open the Vagrantfile and check the exact string in `config.push.define \"...\"` for spelling, case, and whitespace","If the name should exist, add the missing `config.push.define` block for it"],"exampleFix":"# before\nconfig.push.define \"ftp\" do |push| ... end\n# vagrant push FTP  ->  PushStrategyNotDefined (case mismatch)\n\n# after\n# vagrant push ftp  ->  succeeds","handlingStrategy":"validation","validationCode":"blocks = File.readlines('Vagrantfile').select { |l| l.include?('push.define') }\nabort \"unknown strategy #{name}; defined blocks: #{blocks.join(' | ')}\" unless blocks.any? { |b| b.include?(name) }\nsystem(\"vagrant push #{name}\")","typeGuard":null,"tryCatchPattern":"begin\n  VagrantPlugins::CommandPush::Command.new([name] + argv, env).execute\nrescue Vagrant::Errors::PushStrategyNotDefined => e\n  warn \"#{e.extra_data[:name]} not defined; valid: #{e.extra_data[:pushes].join(', ')}\"\n  exit 1\nend","preventionTips":["Derive the strategy name from the Vagrantfile instead of hardcoding it in scripts","When renaming a push block, grep CI configs and docs for the old name","Use lowercase, simple strategy names to avoid case-mismatch failures"],"tags":["vagrant","push","cli","typo","vagrantfile"],"backgroundTag":"unknown-name-provided","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}