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

Custom-tools plugin breaks path for android-emulator

      Created for the original issue in JENKINS-19506

      I run customtools-plugin together with android-emulator-plugin, and when jenkins launches tasks for android-emulator, they are launched without the default PATH varable.
      This means that the shell scripts that start the emulator can't find common tools as dirname, file and so on.

      Workaround is to add a custom tool that defines default paths too, but thats site-wide and when some nodes have other PATH's than other, i can only add the directories that exists on all nodes.

          [JENKINS-20560] Custom-tools plugin breaks path for android-emulator

          Oleg Nenashev created issue -
          Oleg Nenashev made changes -
          Link New: This issue depends on JENKINS-19506 [ JENKINS-19506 ]

          Alexander Silgidjian added a comment - - edited

          I am experiencing an issue that also seems to be caused by this bug.
          Once I enable custom tools, I am not able to run Xvnc:

          Starting xvnc
          [smoke] $ vncserver :37
          /usr/bin/env: perl: No such file or directory
          Starting xvnc
          [smoke] $ vncserver :38
          /usr/bin/env: perl: No such file or directory
          Starting xvnc
          [smoke] $ vncserver :39
          /usr/bin/env: perl: No such file or directory
          Starting xvnc
          [smoke] $ vncserver :40
          /usr/bin/env: perl: No such file or directory
          
          FATAL: Failed to run 'vncserver :40' (exit code 127), blacklisting display #40; consider checking the "Clean up before start" option
          java.io.IOException: Failed to run 'vncserver :40' (exit code 127), blacklisting display #40; consider checking the "Clean up before start" option
          	at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:100)
          	at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:98)
          	at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:98)
          	at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:98)
          	at hudson.plugins.xvnc.Xvnc.setUp(Xvnc.java:73)
          	at hudson.model.Build$BuildExecution.doRun(Build.java:154)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:584)
          	at hudson.model.Run.execute(Run.java:1575)
          	at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
          	at hudson.model.ResourceController.execute(ResourceController.java:88)
          	at hudson.model.Executor.run(Executor.java:237)
          

          The issue is solved, when I remove custom tool installation from the job.

          I am using a snapshot build of custom-tools, because I needed a fix for JENKINS-19506.

          Alexander Silgidjian added a comment - - edited I am experiencing an issue that also seems to be caused by this bug. Once I enable custom tools, I am not able to run Xvnc: Starting xvnc [smoke] $ vncserver :37 /usr/bin/env: perl: No such file or directory Starting xvnc [smoke] $ vncserver :38 /usr/bin/env: perl: No such file or directory Starting xvnc [smoke] $ vncserver :39 /usr/bin/env: perl: No such file or directory Starting xvnc [smoke] $ vncserver :40 /usr/bin/env: perl: No such file or directory FATAL: Failed to run 'vncserver :40' (exit code 127), blacklisting display #40; consider checking the "Clean up before start" option java.io.IOException: Failed to run 'vncserver :40' (exit code 127), blacklisting display #40; consider checking the "Clean up before start" option at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:100) at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:98) at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:98) at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:98) at hudson.plugins.xvnc.Xvnc.setUp(Xvnc.java:73) at hudson.model.Build$BuildExecution.doRun(Build.java:154) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:584) at hudson.model.Run.execute(Run.java:1575) at hudson.matrix.MatrixRun.run(MatrixRun.java:146) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237) The issue is solved, when I remove custom tool installation from the job. I am using a snapshot build of custom-tools, because I needed a fix for JENKINS-19506 .
          Oleg Nenashev made changes -
          Description Original: I run customtools-plugin together with android-emulator-plugin, and when jenkins launches tasks for android-emulator, they are launched without the default PATH varable.
          This means that the shell scripts that start the emulator can't find common tools as dirname, file and so on.

          Workaround is to add a custom tool that defines default paths too, but thats site-wide and when some nodes have other PATH's than other, i can only add the directories that exists on all nodes.
          New: Created for the original issue in JENKINS-19506
          {quote}
          I run customtools-plugin together with android-emulator-plugin, and when jenkins launches tasks for android-emulator, they are launched without the default PATH varable.
          This means that the shell scripts that start the emulator can't find common tools as dirname, file and so on.

          Workaround is to add a custom tool that defines default paths too, but thats site-wide and when some nodes have other PATH's than other, i can only add the directories that exists on all nodes.
          {quote}
          Oleg Nenashev made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          Oleg Nenashev added a comment -

          I confirm the issue. Hope to resolve it soon

          Oleg Nenashev added a comment - I confirm the issue. Hope to resolve it soon
          Oleg Nenashev made changes -
          Environment Original: custom-tools 0.4, android emulator plugin New: custom-tools 0.4,
          Affected plugins: android emulator plugin, xvnc plugin

          Oleg Nenashev added a comment -

          The draft fix is ready: https://github.com/jenkinsci/customtools-plugin/pull/13
          This fix changes order of paths in ProcStarter. It may cause regressions in the case of multiple wrappers exporting same binaries from different folders (not good in any case), but it should work for other cases.

          Oleg Nenashev added a comment - The draft fix is ready: https://github.com/jenkinsci/customtools-plugin/pull/13 This fix changes order of paths in ProcStarter. It may cause regressions in the case of multiple wrappers exporting same binaries from different folders (not good in any case), but it should work for other cases.

          Anton Lundin added a comment -

          Not that good.

          Started by user anonymous
          Building in workspace /home/anton/Downloads/jenkins-dot/workspace/test2
          FATAL: Null value not allowed as an environment variable: PATH+
          java.lang.IllegalArgumentException: Null value not allowed as an environment variable: PATH+
          	at hudson.EnvVars.put(EnvVars.java:356)
          	at com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper$2.launch(CustomToolInstallWrapper.java:230)
          	at hudson.Launcher$ProcStarter.start(Launcher.java:353)
          	at hudson.Launcher$ProcStarter.join(Launcher.java:360)
          	at hudson.plugins.android_emulator.util.Utils.runAndroidTool(Utils.java:420)
          	at hudson.plugins.android_emulator.util.Utils.runAndroidTool(Utils.java:398)
          	at hudson.plugins.android_emulator.SdkInstaller.isPlatformInstalled(SdkInstaller.java:320)
          	at hudson.plugins.android_emulator.SdkInstaller.installPlatform(SdkInstaller.java:267)
          	at hudson.plugins.android_emulator.SdkInstaller.installPlatform(SdkInstaller.java:252)
          	at hudson.plugins.android_emulator.SdkInstaller.installDependencies(SdkInstaller.java:239)
          	at hudson.plugins.android_emulator.AndroidEmulator.setUp(AndroidEmulator.java:253)
          	at hudson.model.Build$BuildExecution.doRun(Build.java:154)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:566)
          	at hudson.model.Run.execute(Run.java:1679)
          	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          	at hudson.model.ResourceController.execute(ResourceController.java:88)
          	at hudson.model.Executor.run(Executor.java:230)
          

          Anton Lundin added a comment - Not that good. Started by user anonymous Building in workspace /home/anton/Downloads/jenkins-dot/workspace/test2 FATAL: Null value not allowed as an environment variable: PATH+ java.lang.IllegalArgumentException: Null value not allowed as an environment variable: PATH+ at hudson.EnvVars.put(EnvVars.java:356) at com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper$2.launch(CustomToolInstallWrapper.java:230) at hudson.Launcher$ProcStarter.start(Launcher.java:353) at hudson.Launcher$ProcStarter.join(Launcher.java:360) at hudson.plugins.android_emulator.util.Utils.runAndroidTool(Utils.java:420) at hudson.plugins.android_emulator.util.Utils.runAndroidTool(Utils.java:398) at hudson.plugins.android_emulator.SdkInstaller.isPlatformInstalled(SdkInstaller.java:320) at hudson.plugins.android_emulator.SdkInstaller.installPlatform(SdkInstaller.java:267) at hudson.plugins.android_emulator.SdkInstaller.installPlatform(SdkInstaller.java:252) at hudson.plugins.android_emulator.SdkInstaller.installDependencies(SdkInstaller.java:239) at hudson.plugins.android_emulator.AndroidEmulator.setUp(AndroidEmulator.java:253) at hudson.model.Build$BuildExecution.doRun(Build.java:154) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:566) at hudson.model.Run.execute(Run.java:1679) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:230)

          Oleg Nenashev added a comment -

          Have you got it in the case of empty tools list?

          Oleg Nenashev added a comment - Have you got it in the case of empty tools list?

            oleg_nenashev Oleg Nenashev
            oleg_nenashev Oleg Nenashev
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: