{"record":{"id":"a4c4b5a935ca4a1a","repo":"puppetlabs/puppet","slug":"could-not-find-command-exe","errorCode":null,"errorMessage":"Could not find command '%{exe}'","messagePattern":"Could not find command '%(.+?)'","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/provider/exec/posix.rb","lineNumber":35,"sourceCode":"    When the command is an Array of Strings, passed as `[cmdname, arg1, ...]`\n    it will be executed directly(the first element is taken as a command name\n    and the rest are passed as parameters to command with no shell expansion)\n    This is a safer and more predictable way to execute most commands,\n    but prevents the use of globbing and shell built-ins (including control\n    logic like \"for\" and \"if\" statements).\n\n    If the use of globbing and shell built-ins is desired, please check\n    the `shell` provider\n\n  EOT\n\n  # Verify that we have the executable\n  def checkexe(command)\n    exe = extractexe(command)\n\n    if File.expand_path(exe) == exe\n      if !Puppet::FileSystem.exist?(exe)\n        raise ArgumentError, _(\"Could not find command '%{exe}'\") % { exe: exe }\n      elsif !File.file?(exe)\n        raise ArgumentError, _(\"'%{exe}' is a %{klass}, not a file\") % { exe: exe, klass: File.ftype(exe) }\n      elsif !File.executable?(exe)\n        raise ArgumentError, _(\"'%{exe}' is not executable\") % { exe: exe }\n      end\n\n      return\n    end\n\n    if resource[:path]\n      Puppet::Util.withenv :PATH => resource[:path].join(File::PATH_SEPARATOR) do\n        return if which(exe)\n      end\n    end\n\n    # 'which' will only return the command if it's executable, so we can't\n    # distinguish not found from not executable\n    raise ArgumentError, _(\"Could not find command '%{exe}'\") % { exe: exe }","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/exec/posix.rb#L17-L53","documentation":"Error \"Could not find command '%{exe}'\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/provider/exec/posix.rb:35 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}