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

Null pointer exception on GCloud SDK 0.0.3 version

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • gcloud-sdk-plugin
    • None

      Hi Team,

      I have configured GClound SDK plugin and included gcloud cli in the job,

      While executing a job it fails due to null pointer exception

      Here is the log

       
      ERROR: Processing failed due to a bug in the code. Please report this to the issue tracker (
      https://jenkins.io/redirect/report-an-issue
      ).
      java.lang.NullPointerException
      at com.byclosure.jenkins.plugins.gcloud.GCloudBuildWrapper.getSDK(GCloudBuildWrapper.java:92)
      at com.byclosure.jenkins.plugins.gcloud.GCloudBuildWrapper.setUp(GCloudBuildWrapper.java:52)
      at jenkins.tasks.SimpleBuildWrapper.setUp(SimpleBuildWrapper.java:146)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:667)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
      at hudson.model.Run.execute(Run.java:1815)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)
      project=hudson.maven.MavenModuleSet@15b6d37a[dk0871-e/gcloud-integration]
      project.getModules()=[]
      project.getRootModule()=null
      FATAL: null
      java.lang.NullPointerException
      at com.byclosure.jenkins.plugins.gcloud.GCloudBuildWrapper.getSDK(GCloudBuildWrapper.java:92)
      at com.byclosure.jenkins.plugins.gcloud.GCloudBuildWrapper.setUp(GCloudBuildWrapper.java:52)
      at jenkins.tasks.SimpleBuildWrapper.setUp(SimpleBuildWrapper.java:146)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:667)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
      at hudson.model.Run.execute(Run.java:1815)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)
      Finished: FAILURE

          [JENKINS-63640] Null pointer exception on GCloud SDK 0.0.3 version

          We are seeing very similar errors of the above described pattern occurring very rarely (one out of hundreds of build). It's always a "bug in the code" with an NPE following the "Modules changed, recalculating dependency graph"

          1. Modules changed, recalculating dependency graph
          2. ERROR: Processing failed due to a bug in the code. Please report this to the issue tracker (https://jenkins.io/redirect/report-an-issue).
          3. debug output with Maven project info (project, modules, rootModule)
          4. java.lang.NullPointerException
          

          And the debug output comes straight from this line of the maven-plugin:
          https://github.com/jenkinsci/maven-plugin/blob/master/src/main/java/hudson/maven/MavenModuleSetBuild.java#L935

          In my case, the project, project.getModules(), and project.getRootModule() are never empty, but always match the actual Maven coordinates of the build that was running.

          Dominik Kaspar added a comment - We are seeing very similar errors of the above described pattern occurring very rarely (one out of hundreds of build). It's always a "bug in the code" with an NPE following the "Modules changed, recalculating dependency graph" 1. Modules changed, recalculating dependency graph 2. ERROR: Processing failed due to a bug in the code. Please report this to the issue tracker (https://jenkins.io/redirect/report-an-issue). 3. debug output with Maven project info (project, modules, rootModule) 4. java.lang.NullPointerException And the debug output comes straight from this line of the maven-plugin: https://github.com/jenkinsci/maven-plugin/blob/master/src/main/java/hudson/maven/MavenModuleSetBuild.java#L935 In my case, the project, project.getModules(), and project.getRootModule() are never empty, but always match the actual Maven coordinates of the build that was running.

          Andy Cobley added a comment -

          I'm seeing very similar.  

          Commit message: "Testing webhook again"
          First time build. Skipping changelog.
          FATAL: null
          java.lang.NullPointerException
          at com.byclosure.jenkins.plugins.gcloud.GCloudBuildWrapper.getSDK(GCloudBuildWrapper.java:92)
          at com.byclosure.jenkins.plugins.gcloud.GCloudBuildWrapper.setUp(GCloudBuildWrapper.java:52)
          at jenkins.tasks.SimpleBuildWrapper.setUp(SimpleBuildWrapper.java:146)
          at hudson.model.Build$BuildExecution.doRun(Build.java:157)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
          at hudson.model.Run.execute(Run.java:1815)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:429)
          Finished: FAILURE

          Andy Cobley added a comment - I'm seeing very similar.   Commit message: "Testing webhook again" First time build. Skipping changelog. FATAL: null java.lang.NullPointerException at com.byclosure.jenkins.plugins.gcloud.GCloudBuildWrapper.getSDK(GCloudBuildWrapper.java:92) at com.byclosure.jenkins.plugins.gcloud.GCloudBuildWrapper.setUp(GCloudBuildWrapper.java:52) at jenkins.tasks.SimpleBuildWrapper.setUp(SimpleBuildWrapper.java:146) at hudson.model.Build$BuildExecution.doRun(Build.java:157) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504) at hudson.model.Run.execute(Run.java:1815) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Finished: FAILURE

          Andy Cobley added a comment -

          I've been doing some investigating, this error is caused because the gcloud SDK is not installed on the Jenkins machine.  I added the gcloud sdk to my docker image and the command now runs . 

          I think the issue can be closed, but a trap at GCloudBuildWrapper.java line 92 for a missing gcloud with a sensible error message would be helpful.

          Andy Cobley added a comment - I've been doing some investigating, this error is caused because the gcloud SDK is not installed on the Jenkins machine.  I added the gcloud sdk to my docker image and the command now runs .  I think the issue can be closed, but a trap at GCloudBuildWrapper.java line 92 for a missing gcloud with a sensible error message would be helpful.

            jrluis João Luís
            sukhendra sukhendra parouha
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: