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

192 views
Skip to first unread message

Mike Rooney

unread,
Jun 16, 2016, 7:57:32 PM6/16/16
to Jenkins Users
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



Kohsuke Kawaguchi

unread,
Jun 17, 2016, 9:04:40 PM6/17/16
to Jenkins Users
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.

--
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 jenkinsci-use...@googlegroups.com.
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 all
Reply to author
Forward
0 new messages