getting only an NPE when building a Jenkinsfile job, how to debug?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

getting only an NPE when building a Jenkinsfile job, how to debug?

Mike Rooney-5
Hello there! We're using Jenkins 2.9 with the Bitbucket Branch Source Plugin 1.5. It picks up on a branch with a Jenkinsfile which is neat, but the only build output we get is:

Started by user m a
java
.lang.NullPointerException
        at org
.eclipse.jgit.lib.ObjectId.fromString(ObjectId.java:231)
        at jenkins
.plugins.git.AbstractGitSCMSource$SpecificRevisionBuildChooser.<init>(AbstractGitSCMSource.java:388)
        at com
.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.build(BitbucketSCMSource.java:411)
        at org
.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:78)
        at org
.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:206)
        at hudson
.model.ResourceController.execute(ResourceController.java:98)
        at hudson
.model.Executor.run(Executor.java:410)
Finished: FAILURE


The Jenkinsfile looks like this:
node {
  stage "Checkout Git"
  checkout scm

  stage "Fake build"
  echo "My branch is: ${env.BRANCH_NAME}"
  sh "ls"
}


I'm at a loss of how to debug this. I've tried changing the Jenkinsfile and pushing, but it isn't clear that Jenkins is using that new Jenkinsfile, so I'm not sure how to see which Jenkinsfile it uses (or does it always grab it from the repo for each run?) This error doesn't seem to provide any context so I'm not sure if this is coming from a stage in my Jenkinsfile or somewhere else earlier. Any tips? For what it is worth, here is the sanitized Jenkins log:

Jun 16, 2016 4:53:48 PM com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient getHttpClient

INFO: Jenkins proxy: XXX

Jun 16, 2016 4:53:48 PM com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient getHttpClient

INFO: Using proxy authentication (user=XXX)

Jun 16, 2016 4:53:48 PM com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient getHttpClient

INFO: Jenkins proxy: XXX

Jun 16, 2016 4:53:48 PM com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient getHttpClient

INFO: Using proxy authentication (user=XXX)

Jun 16, 2016 4:53:49 PM org.jenkinsci.plugins.workflow.job.WorkflowRun finish

INFO: stash-mps/XXX/feature%2FCM-10898-android-use-a-jenkinsfile-to-test #8 completed: FAILURE



--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/55fe6eb9-1f9e-4965-ac5a-db28738748a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: getting only an NPE when building a Jenkinsfile job, how to debug?

Kohsuke Kawaguchi
Administrator
This looks like a bug in bitbucket branch source plugin. As an author of Jenkinsfile there's nothing you can to to debug this.

As a developer of a plugin, if you are interested in digging deeper, BitbucketSCMSource.java:411 is where you will attach the debugger.

On Fri, Jun 17, 2016 at 8:57 AM Mike Rooney <[hidden email]> wrote:
Hello there! We're using Jenkins 2.9 with the Bitbucket Branch Source Plugin 1.5. It picks up on a branch with a Jenkinsfile which is neat, but the only build output we get is:

Started by user m a
java
.lang.NullPointerException
        at org
.eclipse.jgit.lib.ObjectId.fromString(ObjectId.java:231)
        at jenkins
.plugins.git.AbstractGitSCMSource$SpecificRevisionBuildChooser.<init>(AbstractGitSCMSource.java:388)
        at com
.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.build(BitbucketSCMSource.java:411)
        at org
.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:78)
        at org
.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:206)
        at hudson
.model.ResourceController.execute(ResourceController.java:98)
        at hudson
.model.Executor.run(Executor.java:410)
Finished: FAILURE


The Jenkinsfile looks like this:
node {
  stage "Checkout Git"
  checkout scm

  stage "Fake build"
  echo "My branch is: ${env.BRANCH_NAME}"
  sh "ls"
}


I'm at a loss of how to debug this. I've tried changing the Jenkinsfile and pushing, but it isn't clear that Jenkins is using that new Jenkinsfile, so I'm not sure how to see which Jenkinsfile it uses (or does it always grab it from the repo for each run?) This error doesn't seem to provide any context so I'm not sure if this is coming from a stage in my Jenkinsfile or somewhere else earlier. Any tips? For what it is worth, here is the sanitized Jenkins log:

Jun 16, 2016 4:53:48 PM com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient getHttpClient

INFO: Jenkins proxy: XXX

Jun 16, 2016 4:53:48 PM com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient getHttpClient

INFO: Using proxy authentication (user=XXX)

Jun 16, 2016 4:53:48 PM com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient getHttpClient

INFO: Jenkins proxy: XXX

Jun 16, 2016 4:53:48 PM com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient getHttpClient

INFO: Using proxy authentication (user=XXX)

Jun 16, 2016 4:53:49 PM org.jenkinsci.plugins.workflow.job.WorkflowRun finish

INFO: stash-mps/XXX/feature%2FCM-10898-android-use-a-jenkinsfile-to-test #8 completed: FAILURE



--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/55fe6eb9-1f9e-4965-ac5a-db28738748a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAN4CQ4wf9-%2BAt9v53BPJzmAS1MAa6FPcF8m6LKb75XpzAjO4_g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...