Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61975

Powershell command was not found on a different OS slave machine

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • powershell-plugin
    • # Master Slave
      - OS: Windows10
      - Jenkins: org.jenkins-ci.main:jenkins-war:2.222.1
      - Powershell plugin: 1.4

      # Slave
      - OS: macOS Catalina
      - pwsh: PowerShell 7.0.0
      - PATH: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

      When I tried to use powershell-plugin on each slave machines(Win and Mac) from Win master machine, just MacOS slave machine had an error because no such found `pwsh` command.

      Here's the error log details.

      [test] $ pwsh -NonInteractive -File /var/folders/7s/624v46091sdgcf0b1qt98v6hz4r8lc/T/jenkins7665436840857556803.ps1
      FATAL: コマンドの実行に失敗しました
      java.io.IOException: error=2, No such file or directory
      	at java.lang.UNIXProcess.forkAndExec(Native Method)
      	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
      	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
      	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
      Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to mac
      		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1788)
      		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
      		at hudson.remoting.Channel.call(Channel.java:998)
      		at hudson.Launcher$RemoteLauncher.launch(Launcher.java:1057)
      		at hudson.Launcher$ProcStarter.start(Launcher.java:454)
      		at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
      		at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
      		at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      		at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
      		at hudson.model.Build$BuildExecution.build(Build.java:206)
      		at hudson.model.Build$BuildExecution.doRun(Build.java:163)
      		at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
      		at hudson.model.Run.execute(Run.java:1856)
      		at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      		at hudson.model.ResourceController.execute(ResourceController.java:97)
      		at hudson.model.Executor.run(Executor.java:428)
      Caused: java.io.IOException: Cannot run program "pwsh" (in directory "/Users/****/workspace/test"): error=2, No such file or directory
      	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
      	at hudson.Proc$LocalProc.<init>(Proc.java:252)
      	at hudson.Proc$LocalProc.<init>(Proc.java:221)
      	at hudson.Launcher$LocalLauncher.launch(Launcher.java:936)
      	at hudson.Launcher$ProcStarter.start(Launcher.java:454)
      	at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1316)
      	at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1269)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
      	at hudson.remoting.Request$2.run(Request.java:369)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Build step 'PowerShell' marked build as failure
      Finished: FAILURE
      

       

            Unassigned Unassigned
            tanishi Shintaro Tanikawa
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: