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

[integration] - android-plugin + custom-tools installation fails due to NPE in ProcStarter::envs()

      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-19506] [integration] - android-plugin + custom-tools installation fails due to NPE in ProcStarter::envs()

          Oleg Nenashev added a comment -

          @Anton
          I apologize for a long delay. Seems I've located the issue.
          Will you be able to test a local build with a fix?
          If yes, I'll provide it tomorrow.

          Oleg Nenashev added a comment - @Anton I apologize for a long delay. Seems I've located the issue. Will you be able to test a local build with a fix? If yes, I'll provide it tomorrow.

          Anton Lundin added a comment -

          Just give me a url/git-commit-ish and ill take it for a spin.

          Anton Lundin added a comment - Just give me a url/git-commit-ish and ill take it for a spin.

          Oleg Nenashev added a comment -

          Hello Anton,

          You can find the fix in https://github.com/jenkinsci/customtools-plugin/pull/11
          The fix works well in my tests cases, please check it against your plugins.

          In real, the fix is just a workaround for issue inside Jenkins core or its API, which cannot be avoided on custom-tools side. If you invoke commands on nodes from setUp() functions, you should explicitly call Launcher::envs(...) to prevent NPEs in Launcher::envs(). I'll take care about the issue in the core.

          Oleg Nenashev added a comment - Hello Anton, You can find the fix in https://github.com/jenkinsci/customtools-plugin/pull/11 The fix works well in my tests cases, please check it against your plugins. In real, the fix is just a workaround for issue inside Jenkins core or its API, which cannot be avoided on custom-tools side. If you invoke commands on nodes from setUp() functions, you should explicitly call Launcher::envs(...) to prevent NPEs in Launcher::envs(). I'll take care about the issue in the core.

          Anton Lundin added a comment -

          Tested and now it doesn't die on a npe. Thanks.

          Anton Lundin added a comment - Tested and now it doesn't die on a npe. Thanks.

          Oleg Nenashev added a comment -

          Thank you too.
          Does the plugin install android-emulator properly?

          P.S: I'm going to release a new version soon, so all new bugs will be appreciated

          Oleg Nenashev added a comment - Thank you too. Does the plugin install android-emulator properly? P.S: I'm going to release a new version soon, so all new bugs will be appreciated

          Anton Lundin added a comment -

          pull/11 solves all blocking bugs.

          The part with the default path being emptied is still there, so it fails as shown in error-custom-tools-0.5-snap-with-platform-tools.txt, but i currently workaround that by adding a custom-tool, DEFAULT_PATH which exports the default path.

          It would be neat to get that one fixed to.

          Anton Lundin added a comment - pull/11 solves all blocking bugs. The part with the default path being emptied is still there, so it fails as shown in error-custom-tools-0.5-snap-with-platform-tools.txt, but i currently workaround that by adding a custom-tool, DEFAULT_PATH which exports the default path. It would be neat to get that one fixed to.

          Oleg Nenashev added a comment -

          Moved the initial issue to JENKINS-20560

          Oleg Nenashev added a comment - Moved the initial issue to JENKINS-20560

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/main/java/com/cloudbees/jenkins/plugins/customtools/CustomToolInstallWrapper.java
          src/main/java/com/cloudbees/jenkins/plugins/customtools/DecoratedLauncher.java
          src/test/java/com/cloudbees/jenkins/plugins/customtools/CustomToolInstallWrapperTest.java
          src/test/java/com/cloudbees/jenkins/plugins/customtools/CustomToolInstallerTest.java
          src/test/java/com/synopsys/arc/jenkins/plugins/customtools/util/CommandCallerInstaller.java
          src/test/java/com/synopsys/arc/jenkins/plugins/customtools/util/StubWrapper.java
          http://jenkins-ci.org/commit/customtools-plugin/784a0c091b306d27df4aeb13e54b2ced43fd2db1
          Log:
          [FIXED JENKINS-19506] - Prevent errors on nested wrappers usage
          The provides workarounds for NPEs in Launcher::envs() and also properly calls inner launcher wrappers.
          Resolves https://issues.jenkins-ci.org/browse/JENKINS-19506

          Signed-off-by: Oleg Nenashev <nenashev@synopsys.com>

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/com/cloudbees/jenkins/plugins/customtools/CustomToolInstallWrapper.java src/main/java/com/cloudbees/jenkins/plugins/customtools/DecoratedLauncher.java src/test/java/com/cloudbees/jenkins/plugins/customtools/CustomToolInstallWrapperTest.java src/test/java/com/cloudbees/jenkins/plugins/customtools/CustomToolInstallerTest.java src/test/java/com/synopsys/arc/jenkins/plugins/customtools/util/CommandCallerInstaller.java src/test/java/com/synopsys/arc/jenkins/plugins/customtools/util/StubWrapper.java http://jenkins-ci.org/commit/customtools-plugin/784a0c091b306d27df4aeb13e54b2ced43fd2db1 Log: [FIXED JENKINS-19506] - Prevent errors on nested wrappers usage The provides workarounds for NPEs in Launcher::envs() and also properly calls inner launcher wrappers. Resolves https://issues.jenkins-ci.org/browse/JENKINS-19506 Signed-off-by: Oleg Nenashev <nenashev@synopsys.com>

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/main/java/com/cloudbees/jenkins/plugins/customtools/CustomToolInstallWrapper.java
          src/main/java/com/cloudbees/jenkins/plugins/customtools/DecoratedLauncher.java
          src/test/java/com/cloudbees/jenkins/plugins/customtools/CustomToolInstallWrapperTest.java
          src/test/java/com/cloudbees/jenkins/plugins/customtools/CustomToolInstallerTest.java
          src/test/java/com/synopsys/arc/jenkins/plugins/customtools/util/CommandCallerInstaller.java
          src/test/java/com/synopsys/arc/jenkins/plugins/customtools/util/StubWrapper.java
          http://jenkins-ci.org/commit/customtools-plugin/5d9a150ffd107c1a247c0b54e57e16ed38671a3f
          Log:
          Merge pull request #11 from synopsys-arc-oss/nested_wrappers_fix

          [FIXED JENKINS-19506] - Prevent errors on nested wrappers usage

          Compare: https://github.com/jenkinsci/customtools-plugin/compare/dcf9ac719bd1...5d9a150ffd10

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/com/cloudbees/jenkins/plugins/customtools/CustomToolInstallWrapper.java src/main/java/com/cloudbees/jenkins/plugins/customtools/DecoratedLauncher.java src/test/java/com/cloudbees/jenkins/plugins/customtools/CustomToolInstallWrapperTest.java src/test/java/com/cloudbees/jenkins/plugins/customtools/CustomToolInstallerTest.java src/test/java/com/synopsys/arc/jenkins/plugins/customtools/util/CommandCallerInstaller.java src/test/java/com/synopsys/arc/jenkins/plugins/customtools/util/StubWrapper.java http://jenkins-ci.org/commit/customtools-plugin/5d9a150ffd107c1a247c0b54e57e16ed38671a3f Log: Merge pull request #11 from synopsys-arc-oss/nested_wrappers_fix [FIXED JENKINS-19506] - Prevent errors on nested wrappers usage Compare: https://github.com/jenkinsci/customtools-plugin/compare/dcf9ac719bd1...5d9a150ffd10

          Oleg Nenashev added a comment -

          @Anton
          https://github.com/jenkinsci/customtools-plugin/pull/13 provides a fix for your initial issue

          Oleg Nenashev added a comment - @Anton https://github.com/jenkinsci/customtools-plugin/pull/13 provides a fix for your initial issue

            oleg_nenashev Oleg Nenashev
            glance Anton Lundin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: