{"record":{"id":"6a2e0e0a572f8940","repo":"hashicorp/vagrant","slug":"the-executable-file-vagrant-is-trying-to-run","errorCode":null,"errorMessage":"The executable '%{file}' Vagrant is trying to run was not\nfound in the %PATH% variable. This is an error. Please verify\nthis software is installed and on the path.","messagePattern":"The executable '%(.+?)' Vagrant is trying to run was not\nfound in the %PATH% variable\\. This is an error\\. Please verify\nthis software is installed and on the path\\.","errorType":"exception","errorClass":"Vagrant::Errors::CommandUnavailableWindows","httpStatus":null,"severity":"error","filePath":"lib/vagrant/util/subprocess.rb","lineNumber":33,"sourceCode":"  module Util\n    # Execute a command in a subprocess, gathering the results and\n    # exit status.\n    #\n    # This class also allows you to read the data as it is outputted\n    # from the subprocess in real time, by simply passing a block to\n    # the execute method.\n    class Subprocess\n      # Convenience method for executing a method.\n      def self.execute(*command, &block)\n        new(*command).execute(&block)\n      end\n\n      def initialize(*command)\n        @options = command.last.is_a?(Hash) ? command.pop : {}\n        @command = command.dup\n        @command[0] = Which.which(@command[0]) if !File.file?(@command[0])\n        if !@command[0]\n          raise Errors::CommandUnavailableWindows, file: command[0] if Platform.windows?\n          raise Errors::CommandUnavailable, file: command[0]\n        end\n\n        @logger  = Log4r::Logger.new(\"vagrant::util::subprocess\")\n      end\n\n      # @return [TrueClass, FalseClass] subprocess is currently running\n      def running?\n        !!(@process && @process.alive?)\n      end\n\n      # Stop the subprocess if running\n      #\n      # @return [TrueClass] FalseClass] true if process was running and stopped\n      def stop\n        if @process && @process.alive?\n          @process.stop\n          true","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/util/subprocess.rb#L15-L51","documentation":"Vagrant::Util::Subprocess#initialize resolves the command's first token via Which.which (skipped only when it is already an existing file path); if resolution fails on Windows it raises CommandUnavailableWindows with the executable name in %{file}. Every Vagrant shell-out (curl, ssh, rsync, powershell, ...) funnels through this check.","triggerScenarios":"Any Subprocess.execute('tool', ...) where the tool is not found on the Windows PATH: rsync synced folders without rsync.exe, missing ssh, provisioners referencing uninstalled utilities.","commonSituations":"Windows hosts missing extras Vagrant assumes (rsync from Git for Windows/cwRsync, ssh, tar); PATH differences between interactive and service contexts.","solutions":["Install the executable named in %{file} on the Windows host","Add its directory to PATH and restart the shell/agent so Vagrant inherits it","Prefer absolute file paths as argv[0] in your own Subprocess calls (that path skips Which), and verify with `where <file>` in the same environment"],"exampleFix":"# before\n> vagrant up   # CommandUnavailableWindows: 'rsync'\n\n# after: install rsync (e.g. via Git for Windows), then\n> setx PATH \"%PATH%;C:\\Program Files\\Git\\usr\\bin\"\n> vagrant up","handlingStrategy":"validation","validationCode":"require 'vagrant/util/which'\n\ntool = 'rsync'\npath = Vagrant::Util::Which.which(tool)\nabort \"#{tool} not on PATH; install it before continuing\" unless path","typeGuard":null,"tryCatchPattern":"begin\n  Vagrant::Util::Subprocess.execute('rsync', '-a', src, dst)\nrescue Vagrant::Errors::CommandUnavailableWindows => e\n  abort \"install #{e.extra_data[:file]} and ensure it is on PATH\"\nend","preventionTips":["Pre-install host tooling (rsync/ssh/tar) on Windows hosts","Which.which-check tools before long operations","Remember Subprocess resolves argv[0] via PATH unless it is an existing file path"],"tags":["subprocess","windows","path","executable"],"backgroundTag":"executable-not-found-in-path","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}