Sonar result check timeout in Jenkins

jenkins

(ODIR LOPES PINHEIRO) #1
  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    5.6.6

Hi guys , i’m geting an erro trying to do scan result check in a code, the timeout is set about 5min and it tries 3 times. I’m wondering if it has to get more time , like 1h+ to get it done.

image

**17:06:48** Checking status of SonarQube task 'AWXPZJ0hC8Uwzx1sMUZr' on server '5.6.6' **17:06:48** SonarQube task 'AWXPZJ0hC8Uwzx1sMUZr' status is 'IN_PROGRESS' **17:11:47** Cancelling nested steps due to timeout [Pipeline] } [Pipeline] // script [Pipeline] } **17:11:48** ERROR: Execution failed **17:11:48** org.jenkinsci.plugins.workflow.steps.FlowInterruptedException **17:11:48** at 
org.jenkinsci.plugins.workflow.cps.CpsBodyExecution.cancel(CpsBodyExecution.java:245) **17:11:48** at 
org.jenkinsci.plugins.workflow.steps.TimeoutStepExecution.cancel(TimeoutStepExecution.java:133) **17:11:48** at 
org.jenkinsci.plugins.workflow.steps.TimeoutStepExecution.access$100(TimeoutStepExecution.java:24) **17:11:48** at 
org.jenkinsci.plugins.workflow.steps.TimeoutStepExecution$1.run(TimeoutStepExecution.java:83) **17:11:48** at 
jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58) **17:11:48** at 
java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) **17:11:48** at 
java.util.concurrent.FutureTask.run(Unknown Source) **17:11:48** at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) **17:11:48** at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) **17:11:48** at 
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) **17:11:48** at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) **17:11:48** at 
java.lang.Thread.run(Unknown Source) **17:11:48** Retrying [Pipeline] { [Pipeline] script [Pipeline] { [Pipeline] waitForQualityGate **17:11:48** Checking status of SonarQube task 'AWXPZJ0hC8Uwzx1sMUZr' on server '5.6.6' **17:11:48** SonarQube task 'AWXPZJ0hC8Uwzx1sMUZr' status is 'FAILED' [Pipeline] } [Pipeline] // script [Pipeline] } **17:11:48** ERROR: Execution failed **17:11:48** java.lang.IllegalStateException: SonarQube analysis 'AWXPZJ0hC8Uwzx1sMUZr' failed: FAILED **17:11:48** at 
org.sonarsource.scanner.jenkins.pipeline.WaitForQualityGateStep$Execution.checkTaskCompleted(WaitForQualityGateStep.java:156) **17:11:48** at 
org.sonarsource.scanner.jenkins.pipeline.WaitForQualityGateStep$Execution.start(WaitForQualityGateStep.java:108) **17:11:48** at 
org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:229) **17:11:48** at 
org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:153) **17:11:48** at 
org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108) **17:11:48** at 
sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source) **17:11:48** at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) **17:11:48** at 
java.lang.reflect.Method.invoke(Unknown Source) **17:11:48** at 
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) **17:11:48** at 
groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) **17:11:48** at 
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213) **17:11:48** at 
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022) **17:11:48** at 
org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42) **17:11:48** at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) **17:11:48** at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) **17:11:48** at 
org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:157) **17:11:48** at 
org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23) **17:11:48** at 
org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:133) **17:11:48** at 
org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:155) **17:11:48** at 
org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:159) **17:11:48** at 
org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:129) **17:11:48** at 
org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:129) **17:11:48** at 
org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:129) **17:11:48** at 
org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:129) **17:11:48** at 
com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17) **17:11:48** at 
WorkflowScript.sonarqube(WorkflowScript:55) **17:11:48** at 
___cps.transform___(Native Method) **17:11:48** at 
com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57) **17:11:48** at 
com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109) **17:11:48** at 
com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixName(FunctionCallBlock.java:77) **17:11:48** at 
sun.reflect.GeneratedMethodAccessor95.invoke(Unknown Source) **17:11:48** at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) **17:11:48** at 
java.lang.reflect.Method.invoke(Unknown Source) **17:11:48** at 
com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) **17:11:48** at 
com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21) **17:11:48** at 
com.cloudbees.groovy.cps.Next.step(Next.java:83) **17:11:48** at 
com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174) **17:11:48** at 
com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163) **17:11:48** at 
org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122) **17:11:48** at 
org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261) **17:11:48** at 
com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163) **17:11:48** at 
org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19) **17:11:48** at 
org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35) **17:11:48** at 
org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32) **17:11:48** at 
org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108) **17:11:48** at 
org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32) **17:11:48** at 
org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174) **17:11:48** at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:331) **17:11:48** at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$200(CpsThreadGroup.java:82) **17:11:48** at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:243) **17:11:48** at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:231) **17:11:48** at 
org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64) **17:11:48** at 
java.util.concurrent.FutureTask.run(Unknown Source) **17:11:48** at 
hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131) **17:11:48** at 
jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) **17:11:48** at 
java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) **17:11:48** at 
java.util.concurrent.FutureTask.run(Unknown Source) **17:11:48** at 
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) **17:11:48** at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) **17:11:48** at 
java.lang.Thread.run(Unknown Source) **17:11:48** Retrying [Pipeline] { [Pipeline] script [Pipeline] { [Pipeline] waitForQualityGate **17:11:48** Checking status of SonarQube task 'AWXPZJ0hC8Uwzx1sMUZr' on server '5.6.6' **17:11:48** SonarQube task 'AWXPZJ0hC8Uwzx1sMUZr' status is 'FAILED' [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // retry [Pipeline] } [Pipeline] // timeout [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // wrap [Pipeline] } [Pipeline] // ansiColor [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline [Bitbucket] Notifying commit build result [Bitbucket] Build result notified java.lang.IllegalStateException: SonarQube analysis 'AWXPZJ0hC8Uwzx1sMUZr' failed: FAILED at 
org.sonarsource.scanner.jenkins.pipeline.WaitForQualityGateStep$Execution.checkTaskCompleted(WaitForQualityGateStep.java:156) at 
org.sonarsource.scanner.jenkins.pipeline.WaitForQualityGateStep$Execution.start(WaitForQualityGateStep.java:108) at 
org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:229) at 
org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:153) at 
org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108) at 
sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source) at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at 
java.lang.reflect.Method.invoke(Unknown Source) at 
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) at 
groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at 
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213) at 
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022) at 
org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42) at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at 
org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:157) at 
org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23) at 
org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:133) at 
org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:155) at 
org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:159) at 
org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:129) at 
org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:129) at 
org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:129) at 
org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:129) at 
com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17) at 
WorkflowScript.sonarqube(WorkflowScript:55) at 
___cps.transform___(Native Method) at 
com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57) at 
com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109) at 
com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixName(FunctionCallBlock.java:77) at 
sun.reflect.GeneratedMethodAccessor95.invoke(Unknown Source) at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at 
java.lang.reflect.Method.invoke(Unknown Source) at 
com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) at 
com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21) at 
com.cloudbees.groovy.cps.Next.step(Next.java:83) at 
com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174) at 
com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163) at 
org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122) at 
org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261) at 
com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163) at 
org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19) at 
org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35) at 
org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32) at 
org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108) at 
org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32) at 
org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174) at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:331) at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$200(CpsThreadGroup.java:82) at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:243) at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:231) at 
org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64) at 
java.util.concurrent.FutureTask.run(Unknown Source) at 
hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131) at 
jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at 
java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at 
java.util.concurrent.FutureTask.run(Unknown Source) at 
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at 
java.lang.Thread.run(Unknown Source) Finished: FAILURE

(Nicolas Bontoux) #2

Hi,

You probably want to share the actual implementation of this task in oder to get feedback on what could be going wrong.

Note that you do seem to have a failing Background Task on SonarQube side:

java.lang.Thread.run(Unknown Source) **17:11:48** Retrying [Pipeline] { [Pipeline] script [Pipeline] { [Pipeline] waitForQualityGate **17:11:48** Checking status of SonarQube task 'AWXPZJ0hC8Uwzx1sMUZr' on server '5.6.6' **17:11:48** SonarQube task 'AWXPZJ0hC8Uwzx1sMUZr' status is 'FAILED' [Pipeline] } [Pipeline] // script [Pipeline] } **17:11:48** ERROR: Execution failed **17:11:48** java.lang.IllegalStateException: SonarQube analysis 'AWXPZJ0hC8Uwzx1sMUZr' failed: FAILED **17:11:48** at 

Documentation of the SonarQube integration with Jenkins is also a good read for checking best practices.

And last but not least: SonarQube 5.6.x is getting really old, might be hard to get help on that version, which is anyhow no longer maintained. Strongly suggest checking out latest versions.