[JIRA] (JENKINS-60309) NPE when using with gitlab-plugin's statuses.

28 views
Skip to first unread message

tamerlaha@gmail.com (JIRA)

unread,
Nov 27, 2019, 1:27:03 PM11/27/19
to jenkinsc...@googlegroups.com
ipleten created an issue
 
Jenkins / Bug JENKINS-60309
NPE when using with gitlab-plugin's statuses.
Issue Type: Bug Bug
Assignee: Parichay Barpanda
Components: gitlab-branch-source-plugin
Created: 2019-11-27 18:26
Priority: Minor Minor
Reporter: ipleten

We are using gitlab-plugin and evaluating gitlab-branch-source-plugin for our need.

Pipeline is failing with: Null pointer exception and prior that failure in Jenkins maser log:

...
org.gitlab4j.api.GitLabApiException: Cannot transition status via :run from :running (Reason(s): Status cannot transition via "run")
...

in pipeline we have something like that:

..
  steps {
    gitlabCommitStatus(STAGE_NAME) {
      container('deploy') {
         sh 'mvn deploy'
   }

When I remove all "gitlabCommitStatus(STAGE_NAME) {" in all stages it starts working.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

tamerlaha@gmail.com (JIRA)

unread,
Nov 27, 2019, 1:30:03 PM11/27/19
to jenkinsc...@googlegroups.com
ipleten updated an issue
Change By: ipleten
We are using gitlab-plugin to pushes statuses back to GitLab server and evaluating gitlab-branch-source-plugin for our need.

Pipeline is failing with:
" Null pointer exception " and prior that failure in Jenkins maser log:
{noformat}

...
org.gitlab4j.api.GitLabApiException: Cannot transition status via :run from :running (Reason(s): Status cannot transition via "run")
...
{noformat}

in pipeline we have something like that:

{noformat}

..
  steps {
    gitlabCommitStatus(STAGE_NAME) {
      container('deploy') {
         sh 'mvn deploy'
   }
{noformat}

When I remove all "gitlabCommitStatus(STAGE_NAME) {" in all stages it starts working.

tamerlaha@gmail.com (JIRA)

unread,
Nov 27, 2019, 2:01:04 PM11/27/19
to jenkinsc...@googlegroups.com
ipleten updated an issue
We are using gitlab-plugin to pushes statuses back to GitLab server and evaluating gitlab-branch-source-plugin for our need.

Pipeline is failing with: "Null pointer exception" and prior that failure in Jenkins maser log:
{noformat}
...
org.gitlab4j.api.GitLabApiException: Cannot transition status via :run from :running (Reason(s): Status cannot transition via "run")
...
{noformat}
in pipeline we have something like that:

{noformat}
..
  steps {
    gitlabCommitStatus(STAGE_NAME) {
      container('deploy') {
         sh 'mvn deploy'
   }
{noformat}
When I remove all "gitlabCommitStatus(STAGE_NAME) {" in all stages it starts working.

Logs snapshot:
{noformat}
ov 27, 2019 6:59:00 PM io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier$JobCheckOutListener onCheckout
INFO: SCMListener: Checkoutsoftserve » pipe-test-build-ipleten » MR-64-merge #5
Nov 27, 2019 6:59:00 PM io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier sendNotifications
INFO: Result: null
Nov 27, 2019 6:59:00 PM io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier sendNotifications
INFO: COMMIT: 2d46589fed77023cc5a4ac38422873408e5ce1cb

org.gitlab4j.api.GitLabApiException: Cannot transition status via :run from :running (Reason(s): Status cannot transition via "run")
at org.gitlab4j.api.AbstractApi.validate(AbstractApi.java:593)
at org.gitlab4j.api.AbstractApi.post(AbstractApi.java:264)
at org.gitlab4j.api.CommitsApi.addCommitStatus(CommitsApi.java:452)
at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier.sendNotifications(GitLabPipelineStatusNotifier.java:249)
at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier.access$300(GitLabPipelineStatusNotifier.java:51)
at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier$JobCheckOutListener.onCheckout(GitLabPipelineStatusNotifier.java:373)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:140)
at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.lambda$doRetrieve$1(SCMSourceRetriever.java:154)
at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrySCMOperation(SCMSourceRetriever.java:104)
at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.doRetrieve(SCMSourceRetriever.java:153)
at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:93)
at org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:157)
at org.jenkinsci.plugins.workflow.libs.LibraryAdder.add(LibraryAdder.java:138)
at org.jenkinsci.plugins.workflow.libs.LibraryDecorator$1.call(LibraryDecorator.java:125)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:142)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:561)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:522)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:320)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
{noformat}

tamerlaha@gmail.com (JIRA)

unread,
Nov 27, 2019, 2:02:02 PM11/27/19
to jenkinsc...@googlegroups.com
INFO: SCMListener: Checkoutsoftserve Checkoutsoftware » pipe-test-build -ipleten » MR-64-merge #5

tamerlaha@gmail.com (JIRA)

unread,
Nov 27, 2019, 3:26:02 PM11/27/19
to jenkinsc...@googlegroups.com
ipleten updated an issue
Change By: ipleten
Component/s: gitlab-plugin

tamerlaha@gmail.com (JIRA)

unread,
Nov 27, 2019, 3:26:03 PM11/27/19
to jenkinsc...@googlegroups.com

kuhnroyal@gmail.com (JIRA)

unread,
Jan 8, 2020, 7:21:02 PM1/8/20
to jenkinsc...@googlegroups.com

I am seeing the same stack without the nullpointer, only the second part.

tamerlaha@gmail.com (JIRA)

unread,
Jan 9, 2020, 12:44:04 PM1/9/20
to jenkinsc...@googlegroups.com
ipleten commented on Bug JENKINS-60309

I tried to fix the problem in gitlab-plugin:
https://github.com/jenkinsci/gitlab-plugin/pull/1014
https://github.com/jenkinsci/gitlab-plugin/pull/1012
They haven't released that yet, but I checkout 1.5.13 (currently released as master breaks another things.) version and cherry-pick'ed both commits to branch and build self-hosted version.
Give it a try.

tamerlaha@gmail.com (JIRA)

unread,
Jan 9, 2020, 12:47:02 PM1/9/20
to jenkinsc...@googlegroups.com
ipleten edited a comment on Bug JENKINS-60309
They haven't released that yet, but I checkout 1.5.13 (currently released as master breaks another things   see: https://github . com/jenkinsci/gitlab-plugin/pull/916#issuecomment-57266272. ) version and cherry-pick'ed both commits to branch and build self-hosted version.
Give it a try.

tamerlaha@gmail.com (JIRA)

unread,
Jan 9, 2020, 12:49:04 PM1/9/20
to jenkinsc...@googlegroups.com
ipleten edited a comment on Bug JENKINS-60309
They haven't released that yet, but I checkout 1.5.13 (currently released as master breaks another things  see: https://github.com/jenkinsci/gitlab-plugin/pull/916#issuecomment-57266272.) version and cherry-pick'ed both commits to branch and build self-hosted version.
Give it a try.

*UPDATE:* you right about log.  I've updated summary with correct log.

tamerlaha@gmail.com (JIRA)

unread,
Jan 9, 2020, 12:49:04 PM1/9/20
to jenkinsc...@googlegroups.com
ipleten updated an issue
Change By: ipleten
We are using gitlab-plugin to pushes statuses back to GitLab server and evaluating gitlab-branch-source-plugin for our need.

Pipeline is failing with: "Null pointer exception" and prior that failure in Jenkins maser log:
{noformat}
...
org.gitlab4j.api.GitLabApiException: Cannot transition status via :run from :running (Reason(s): Status cannot transition via "run")
...
{noformat}
in pipeline we have something like that:

{noformat}
..
  steps {
    gitlabCommitStatus(STAGE_NAME) {
      container('deploy') {
         sh 'mvn deploy'
   }
{noformat}
When I remove all "gitlabCommitStatus(STAGE_NAME) {" in all stages it starts working.

Logs snapshot:
{noformat}
ov 27, 2019 6:59:00 PM io java . jenkins lang . plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier$JobCheckOutListener onCheckout NullPointerException
INFO: SCMListener: Checkoutsoftware » pipe-test-build » MR-64-merge #5

Nov 27, 2019 6:59:00 PM io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier sendNotifications
INFO: Result: null
Nov 27, 2019 6:59:00 PM io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier sendNotifications
INFO: COMMIT: 2d46589fed77023cc5a4ac38422873408e5ce1cb
org.gitlab4j.api.GitLabApiException: Cannot transition status via :run from :running (Reason(s): Status cannot transition via "run")
at org. gitlab4j eclipse . api jgit . AbstractApi lib . validate ObjectId.fromString ( AbstractApi ObjectId .java: 593 235 )
at
org com . gitlab4j dabsquared . api gitlabjenkins . AbstractApi util . post CommitStatusUpdater.retrieveGitlabProjectIds ( AbstractApi CommitStatusUpdater .java: 264 195 )
at
org com . gitlab4j dabsquared . api gitlabjenkins . CommitsApi util . addCommitStatus CommitStatusUpdater.updateCommitStatus ( CommitsApi CommitStatusUpdater .java: 452 61 )
at
io com . jenkins dabsquared . plugins gitlabjenkins . gitlabbranchsource util . helpers CommitStatusUpdater . GitLabPipelineStatusNotifier.sendNotifications updateCommitStatus ( GitLabPipelineStatusNotifier CommitStatusUpdater .java: 249 97 )
at
io com . jenkins dabsquared . plugins gitlabjenkins . gitlabbranchsource workflow . helpers.GitLabPipelineStatusNotifier.access GitLabBuildsStep $ 300 GitLabBuildStepExecution$1.onStart ( GitLabPipelineStatusNotifier GitLabBuildsStep .java: 51 85 )
at
io org . jenkins jenkinsci .plugins. gitlabbranchsource workflow . helpers cps . GitLabPipelineStatusNotifier$JobCheckOutListener CpsBodyExecution . onCheckout launch ( GitLabPipelineStatusNotifier CpsBodyExecution .java: 373 135 )
at org.jenkinsci.plugins.workflow.
steps cps . scm CpsBodyInvoker . SCMStep.checkout launch ( SCMStep CpsBodyInvoker .java: 140 187 )
at org.jenkinsci.plugins.workflow.
libs cps . SCMSourceRetriever DSL$ThreadTaskImpl .lambda$ doRetrieve invokeBodiesAndSwitchToAsyncMode $ 1 0 ( SCMSourceRetriever DSL .java: 154 660 )
at org.jenkinsci.plugins.workflow.
libs cps . SCMSourceRetriever CpsStepContext . retrySCMOperation withBodyInvokers ( SCMSourceRetriever CpsStepContext .java: 104 537 )
at org.jenkinsci.plugins.workflow.
libs cps . SCMSourceRetriever DSL$ThreadTaskImpl . doRetrieve invokeBodiesAndSwitchToAsyncMode ( SCMSourceRetriever DSL .java: 153 650 )
at org.jenkinsci.plugins.workflow.
libs cps . SCMSourceRetriever DSL$ThreadTaskImpl . retrieve eval ( SCMSourceRetriever DSL .java: 93 615 )
at org.jenkinsci.plugins.workflow.
libs cps . LibraryAdder CpsThread . retrieve runNextChunk ( LibraryAdder CpsThread .java: 157 195 )
at org.jenkinsci.plugins.workflow.
libs cps . LibraryAdder CpsThreadGroup . add run ( LibraryAdder CpsThreadGroup .java: 138 405 )
at org.jenkinsci.plugins.workflow.
libs cps . LibraryDecorator$1 CpsThreadGroup . call access$400 ( LibraryDecorator CpsThreadGroup .java: 125 96 )
at org.
codehaus jenkinsci . groovy plugins . control workflow . CompilationUnit cps . applyToPrimaryClassNodes CpsThreadGroup$2.call ( CompilationUnit CpsThreadGroup .java: 1065 317 )
at org.
codehaus jenkinsci . groovy plugins . control workflow . CompilationUnit cps . doPhaseOperation CpsThreadGroup$2.call ( CompilationUnit CpsThreadGroup .java: 603 281 )
at org.
codehaus jenkinsci . groovy plugins . control workflow . CompilationUnit cps . processPhaseOperations CpsVmExecutorService$2.call ( CompilationUnit CpsVmExecutorService .java: 581 67 )
at
org java . codehaus util . groovy concurrent . control FutureTask . CompilationUnit.compile run ( CompilationUnit FutureTask .java: 558 266 )
at
groovy hudson . lang remoting . GroovyClassLoader SingleLaneExecutorService$1 . doParseClass run ( GroovyClassLoader SingleLaneExecutorService .java: 298 131 )
at
groovy jenkins . lang util . GroovyClassLoader ContextResettingExecutorService$1 . parseClass run ( GroovyClassLoader ContextResettingExecutorService .java: 268 28 )
at
groovy jenkins . lang security . GroovyShell ImpersonatingExecutorService$1 . parseClass run ( GroovyShell ImpersonatingExecutorService .java: 688 59 )
at
groovy.lang.GroovyShell.parse(GroovyShell. java :700)
at org
. jenkinsci util . plugins concurrent . workflow Executors$RunnableAdapter . cps.CpsGroovyShell.doParse call ( CpsGroovyShell Executors .java: 142 511 )
at
org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell. java :127)
at org
. jenkinsci util . plugins concurrent . workflow FutureTask . cps.CpsFlowExecution.parseScript run ( CpsFlowExecution FutureTask .java: 561 266 )
at
org java . jenkinsci util . plugins concurrent . workflow ThreadPoolExecutor . cps.CpsFlowExecution.start runWorker ( CpsFlowExecution ThreadPoolExecutor .java: 522 1149 )
at
org java . jenkinsci util . plugins concurrent . workflow ThreadPoolExecutor$Worker . job.WorkflowRun. run( WorkflowRun ThreadPoolExecutor .java: 320 624 )
at
hudson.model.ResourceController.execute(ResourceController. java :97)
at hudson
. model lang . Executor Thread .run( Executor Thread .java: 429 748 )
Finished: FAILURE
{noformat}

tamerlaha@gmail.com (JIRA)

unread,
Feb 6, 2020, 3:50:03 PM2/6/20
to jenkinsc...@googlegroups.com
ipleten commented on Bug JENKINS-60309
 
Re: NPE when using with gitlab-plugin's statuses.

Should be fixed in gitlab-plugin-1.5.16

tamerlaha@gmail.com (JIRA)

unread,
Feb 6, 2020, 3:51:03 PM2/6/20
to jenkinsc...@googlegroups.com
ipleten assigned an issue to ipleten
 
Change By: ipleten
Assignee: Parichay Barpanda ipleten

tamerlaha@gmail.com (JIRA)

unread,
Feb 6, 2020, 3:51:03 PM2/6/20
to jenkinsc...@googlegroups.com

tamerlaha@gmail.com (JIRA)

unread,
Feb 18, 2020, 8:17:03 PM2/18/20
to jenkinsc...@googlegroups.com
ipleten closed an issue as Fixed
Change By: ipleten
Status: Resolved Closed
Reply all
Reply to author
Forward
0 new messages