unexpected java.io.FileNotFoundException error at the Jenkins performance plugin - jenkins

Installed the performance plugin at Jenkins server with version 2.263.3 Run the jmeter performance test job by Pipeline, and everything works as expected. the job finished in SUCCESS status.
But around 40 mins later, the console returned message to resume the build. and it returned FileNotFoundException. This issue occurred at each job run. And we googled some resolution and still no luck. Please anyone can help at this issue. Thank you so much
Archiving artifacts
[Pipeline] stage
[Pipeline] { (Generate Test Report)
[Pipeline] perfReport
Creating parser with percentiles:'0,50,90,100,' filterRegex:null
Performance: Recording JMeterCsv reports 'Belong_Jenkins_PerformanceTest/outputFolder/performanceTestResult.jtl'
Performance: JMeterCsv copying reports to master, files '[/home/jenkins/agent/workspace/Belong_Digital_Test/PerformanceTest/Belong_Jenkins_PerformanceTest/outputFolder/performanceTestResult.jtl]'
Performance: JMeterCsv parsing local reports '[/var/jenkins_home/jobs/Belong_Digital_Test/jobs/PerformanceTest/builds/72/performance-reports/JMeterCSV/performanceTestResult.jtl]'
Performance: Parsing report file '/var/jenkins_home/jobs/Belong_Digital_Test/jobs/PerformanceTest/builds/72/performance-reports/JMeterCSV/performanceTestResult.jtl' with filterRegex 'null'.
Performance: No threshold configured for making the test unstable
Performance: No threshold configured for making the test failure
Performance: File performanceTestResult.jtl reported 0.036% of errors [SUCCESS]. Build status is: SUCCESS
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // container
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] End of Pipeline
Finished: SUCCESS
Resuming build at Sun May 02 04:31:06 UTC 2021 after Jenkins restart
[Pipeline] End of Pipeline
java.io.FileNotFoundException: /var/jenkins_home/jobs/Belong_Digital_Test/jobs/PerformanceTest/builds/72/program.dat (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverReader.openStreamAt(RiverReader.java:188)
at org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverReader.restorePickles(RiverReader.java:136)
at
org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.loadProgramAsync(CpsFlowExecution.java:784)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.onLoad(CpsFlowExecution.java:750)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.getExecution(WorkflowRun.java:691)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.onLoad(WorkflowRun.java:550)
at hudson.model.RunMap.retrieve(RunMap.java:225)
at hudson.model.RunMap.retrieve(RunMap.java:57)
at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:501)
at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:483)
at jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:381)
at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunMap.java:346)
at jenkins.model.lazy.AbstractLazyLoadRunMap.newestBuild(AbstractLazyLoadRunMap.java:276)
at jenkins.model.lazy.LazyBuildMixIn.getLastBuild(LazyBuildMixIn.java:242)
at org.jenkinsci.plugins.workflow.job.WorkflowJob.getLastBuild(WorkflowJob.java:240)
at org.jenkinsci.plugins.workflow.job.WorkflowJob.getLastBuild(WorkflowJob.java:103)
at org.jenkinsci.plugins.prometheus.JobCollector.appendJobMetrics(JobCollector.java:241)
at org.jenkinsci.plugins.prometheus.JobCollector.lambda$collect$0(JobCollector.java:196)
at org.jenkinsci.plugins.prometheus.util.Jobs.forEachJob(Jobs.java:14)
at org.jenkinsci.plugins.prometheus.JobCollector.collect(JobCollector.java:189)
at io.prometheus.client.CollectorRegistry$MetricFamilySamplesEnumeration.findNextElement(CollectorRegistry.java:190)
at io.prometheus.client.CollectorRegistry$MetricFamilySamplesEnumeration.nextElement(CollectorRegistry.java:223)
at io.prometheus.client.CollectorRegistry$MetricFamilySamplesEnumeration.nextElement(CollectorRegistry.java:144)
at io.prometheus.client.exporter.common.TextFormat.write004(TextFormat.java:22)
at org.jenkinsci.plugins.prometheus.service.DefaultPrometheusMetrics.collectMetrics(DefaultPrometheusMetrics.java:54)
at org.jenkinsci.plugins.prometheus.service.PrometheusAsyncWorker.execute(PrometheusAsyncWorker.java:41)
at hudson.model.AsyncPeriodicWork.lambda$doRun$0(AsyncPeriodicWork.java:100)
Caused: java.io.IOException: Failed to load build state
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$3.onSuccess(CpsFlowExecution.java:865)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$3.onSuccess(CpsFlowExecution.java:863)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$4$1.run(CpsFlowExecution.java:917)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:136)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE

There is not enough data to analyze the root cause of the problem, the very first line tells that the Jenkins has been restarted during the JMeter job execution so I wouldn't trust the test results in any case, just re-run the job and assuming your configuration is correct you should see the output, performance trends chart, etc.
More information:
Configure Jenkins to Run and Show JMeter Tests
How to Use the Jenkins Performance Plugin

Related

Sonarqube and Jenkins Integration with I/O Exception

We have a Enterprise SonarQube and Enterprise Jenkins already in place and the respective configuration in Jenkins exists. I have created a stage in my Jenkinsfile as shown below.
stage('Sonarqube') {
environment {
scannerHome = tool 'SonarQubeScanner'
}
steps {
withSonarQubeEnv('Enterprise Devops Sonar') {
sh "printenv"
sh "${scannerHome}/bin/sonar-scanner"
}
timeout(time: 10, unit: 'MINUTES') {
waitForQualityGate abortPipeline: true
}
}
}
This however throws some errors like it cannot install specific required modules. Here is the error log
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:210)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
at sun.security.ssl.InputRecord.read(InputRecord.java:503)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:990)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1388)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1416)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1400)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:167)
at hudson.FilePath.installIfNecessaryFrom(FilePath.java:863)
Caused: java.io.IOException: Failed to install https://repo1.maven.org/maven2/org/sonarsource/scanner/cli/sonar-scanner-cli/4.5.0.2216/sonar-scanner-cli-4.5.0.2216.zip to /tmp/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQubeScanner
at hudson.FilePath.installIfNecessaryFrom(FilePath.java:937)
at hudson.FilePath.installIfNecessaryFrom(FilePath.java:850)
at hudson.tools.DownloadFromUrlInstaller.performInstallation(DownloadFromUrlInstaller.java:77)
at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:69)
at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109)
at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206)
at hudson.plugins.sonar.SonarRunnerInstallation.forNode(SonarRunnerInstallation.java:91)
at hudson.plugins.sonar.SonarRunnerInstallation.forNode(SonarRunnerInstallation.java:49)
at org.jenkinsci.plugins.workflow.steps.ToolStep$Execution.run(ToolStep.java:152)
at org.jenkinsci.plugins.workflow.steps.ToolStep$Execution.run(ToolStep.java:133)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE
Without using the environment block, I once just printed the env to debug and it is configured correctly. Also the config at Jenkins Management was done as per the documentation.
I am still figuring it out how to overcome this. Any pointers here would help.

Error running jenkins pipeline during deployment phase while integrating jenkins with GKE

I have followed the article here and I used my springboot app to deploy to GKE and the job executes all the way but failing at the final stage, which is deploying to GKE.
-------------------------------------------------------
omitted for brevity
-----------------------------
Running com.example.TestGreeter
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.101 sec
Results :
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # server ---
[INFO] Building jar: /var/lib/jenkins/workspace/Hello/server/target/server.jar
[INFO]
[INFO] ------------------< com.example.maven-project:webapp >------------------
[INFO] Building Webapp 1.0-SNAPSHOT [3/3]
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # webapp ---
[INFO] Deleting /var/lib/jenkins/workspace/Hello/webapp/target
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # webapp ---
[debug] execute contextualize
[INFO] Using 'utf-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/Hello/webapp/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # webapp ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) # webapp ---
[debug] execute contextualize
[INFO] Using 'utf-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/Hello/webapp/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompil
+ docker push registry.hub.docker.com/rdocker11/simple-devops-image:latest
The push refers to repository [registry.hub.docker.com/rdocker11/simple-devops-image]
b9725720a38a: Preparing
117a4af1f7d6: Preparing
c9fe82b92442: Preparing
5977227d48fa: Waiting
27974e3533d3: Waiting
d35c5bda4793: Waiting
a3c1026c6bcc: Waiting
f1d420c2af1a: Waiting
461719022993: Waiting
117a4af1f7d6: Layer already exists
34303658eb0e: Layer already exists
c9fe82b92442: Layer already exists
b9725720a38a: Pushed
latest: digest: sha256:a2df4896fd2563ee73ff628d8aeb784947a55fb0bb94415734e1109655d81adc size: 2629
[Pipeline] isUnix
[Pipeline] sh
+ docker tag rdocker11/simple-devops-image:25 registry.hub.docker.com/rdocker11/simple-devops-image:25
[Pipeline] isUnix
[Pipeline] sh
+ docker push registry.hub.docker.com/rdocker11/simple-devops-image:25
The push refers to repository [registry.hub.docker.com/rdocker11/simple-devops-image]
f1d420c2af1a: Preparing
461719022993: Preparing
5977227d48fa: Waiting
27974e3533d3: Waiting
d35c5bda4793: Waiting
a3c1026c6bcc: Waiting
f1d420c2af1a: Waiting
461719022993: Waiting
c9fe82b92442: Layer already exists
117a4af1f7d6: Layer already exists
c46c0b39fa89: Layer already exists
34303658eb0e: Layer already exists
b9725720a38a: Layer already exists
5977227d48fa: Layer already exists
27974e3533d3: Layer already exists
d35c5bda4793: Layer already exists
a3c1026c6bcc: Layer already exists
461719022993: Layer already exists
f1d420c2af1a: Layer already exists
25: digest: sha256:a2df4896fd2563ee73ff628d8aeb784947a55fb0bb94415734e1109655d81adc size: 2629
[Pipeline] }
[Pipeline] // withDockerRegistry
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Deploy to GKE)
[Pipeline] tool
[Pipeline] envVarsForTool
[Pipeline] withEnv
[Pipeline] {
[Pipeline] sh
+ sed -i s/simple-devops-image:latest/simple-devops-image:25/g deployment.yaml
[Pipeline] step
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
Caused: java.io.IOException: Cannot run program "kubectl": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at hudson.Proc$LocalProc.<init>(Proc.java:252)
at hudson.Proc$LocalProc.<init>(Proc.java:221)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:936)
at hudson.Launcher$ProcStarter.start(Launcher.java:454)
at hudson.Launcher$ProcStarter.join(Launcher.java:465)
at com.google.jenkins.plugins.k8sengine.KubectlWrapper.launchAndJoinCommand(KubectlWrapper.java:166)
at com.google.jenkins.plugins.k8sengine.KubectlWrapper.runKubectlCommand(KubectlWrapper.java:112)
at com.google.jenkins.plugins.k8sengine.KubernetesEngineBuilder.perform(KubernetesEngineBuilder.java:267)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE
I have created google service account and cluster and the details have been provided and kubectl has been installed as per google linux installation steps on jenkins server.
I really appreciate your help.
Thanks,

Jenkins pipeline stuck on Build

I have a few services running on a Kubernetes cluster on ibmcloud and I use Jenkins to deploy these services.
So, until yesterday everything was working fine, but today as I tried to re-deploy my services 2 of them got stuck on "BUILD", freezing Jenkins, and the only way to get Jenkins to work again was by running "systemctl restart jenkins" on the remote machine where jenkins is installed.
After restarting Jenkins I went into the failed build
The end of the console output was:
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (BUILD)
[Pipeline] sh
+ yarn build
yarn run v1.16.0
$ yarn clean && tsc
$ rm -rf dist/
Done in 7.25s.
[Pipeline] sh
+ yarn build:webpack
yarn run v1.16.0
$ webpack --config webpack.config.js
Resuming build at Fri Mar 13 23:00:58 UTC 2020 after Jenkins restart
[Pipeline] End of Pipeline
Global Slack Notifier try posting to slack. However some error occurred
TeamDomain :
Channel :build-info
Message :
java.lang.IllegalStateException: JENKINS-50407: no loaded shell in CpsFlowExecution[Owner[isa-v2/user-service/2:isa-v2/user-service #2]]
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:35)
at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Finished: FAILURE
I've tried to delete pipeline and create it again, updated jenkins but still no luck.
Truth is I don't really know much about Jenkins and I'm getting kind of desperate here! :x
It was working fine yesterday, no code was changed, no Jenkins configuration or pipeline changes eithe. It just seems to have started out of nowhere.
Could someone please help me figure out what is going on and how to fix it?

Why is my Jenkins failing for the first build and then succeeds from the next build onwards even though there is no change?

So, I come in the morning and give a Jenkins build which is from an svn repository it fails. But the next build succeeds without any changes. The error I am getting is below.
[Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node
[Pipeline] End of Pipeline java.lang.ClassCastException:
hudson.scm.SVNRevisionState cannot be cast to
hudson.scm.SVNRevisionState at
hudson.scm.SubversionSCM.calcChangeLog(SubversionSCM.java:756) at
hudson.scm.SubversionSCM.checkout(SubversionSCM.java:897) at
org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:124)
at
org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
at
org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
at
org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
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
Below is how my stage for checkout looks like :
stage('Clone repository')
bat 'cd "C:/Microservices"'
bat 'svn upgrade'
bat 'svn update'
checkout scm
}
I am clueless on what is happening. My TortiseSVN version is 1.13.1 and my Jenkins version is 2.190. If someone can help me on this I'd be really thankful.

How to use quality gates in Sonarqube to trigger the webhook to jenkins

I am reading this official post and documentation that explain how should be used the quality gates with jenkins.
My goal is to trigger a build in jenkins if the quality gates is passed.
According to the post, I only have to install a sonarqube and use the snippet of code.
This is the jenkins log after manually triggering the build :
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 8cddf9af39adbada9366efd3d707d8056c27cd8d (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 8cddf9af39adbada9366efd3d707d8056c27cd8d
> git branch -a -v --no-abbrev # timeout=10
> git branch -D master # timeout=10
> git checkout -b master 8cddf9af39adbada9366efd3d707d8056c27cd8d
> git rev-list 8cddf9af39adbada9366efd3d707d8056c27cd8d # timeout=10
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (build & SonarQube Scan)
[Pipeline] wrap
[Pipeline] // wrap
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
hudson.remoting.ProxyException: hudson.AbortException: SonarQube installation defined in this job (My SonarQube Server) does not match any configured installation. Number of installations that can be configured: 1.
If you want to reassign a lot of jobs to a different SonarQube installation see http://docs.sonarqube.org/display/PLUG/Reassign+Jobs+to+Another+SonarQube+Instance
at hudson.plugins.sonar.SonarInstallation.checkValid(SonarInstallation.java:170)
at hudson.plugins.sonar.SonarBuildWrapper.setUp(SonarBuildWrapper.java:81)
at org.jenkinsci.plugins.workflow.steps.CoreWrapperStep$Execution.start(CoreWrapperStep.java:80)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:184)
Caused: hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: hudson.AbortException: SonarQube installation defined in this job (My SonarQube Server) does not match any configured installation. Number of installations that can be configured: 1.
If you want to reassign a lot of jobs to a different SonarQube installation see http://docs.sonarqube.org/display/PLUG/Reassign+Jobs+to+Another+SonarQube+Instance
at org.jenkinsci.plugins.workflow.cps.CpsStepContext.replay(CpsStepContext.java:497)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:213)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeDescribable(DSL.java:313)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:129)
at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
at groovy.lang.GroovyObject$invokeMethod.call(Unknown Source)
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:151)
at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:115)
at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:16)
Caused: hudson.remoting.ProxyException: java.lang.IllegalArgumentException: Failed to prepare withSonarQubeEnv step
at org.jenkinsci.plugins.workflow.cps.DSL.invokeDescribable(DSL.java:315)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:129)
at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
at groovy.lang.GroovyObject$invokeMethod.call(Unknown Source)
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:151)
at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:115)
at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:16)
at WorkflowScript.run(WorkflowScript:6)
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.fixArg(FunctionCallBlock.java:82)
at sun.reflect.GeneratedMethodAccessor499.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:46)
at com.cloudbees.groovy.cps.Next.step(Next.java:74)
at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)
at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:165)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Finished: FAILURE
I have configured the Sonar jenkins plugins in my jenkins configuration like this:
I have also installed the Sonarqube Quality Gates Plugin in jenkins: (and not the Quality Gates Plugin which according to the author is deprecated)
This is my pipeline groovy script in my job configuration:
node {
stage('SCM') {
git credentialsId: 'a011099a-e3f6-4d67-9e99-8887b186699d', url: 'ssh://git#module.domain.com/docs/styled.git'
}
stage('build & SonarQube Scan') {
def sonarqubeScannerHome = tool name: 'domain', type: 'hudson.plugins.sonar.SonarRunnerInstallation'
withSonarQubeEnv('My SonarQube Server') {
sh "${sonarqubeScannerHome}/bin/sonar-scanner"
} // SonarQube taskId is automatically attached to the pipeline context
}
}
// No need to occupy a node
stage("Quality Gate") {
timeout(time: 1, unit: 'HOURS') { // Just in case something goes wrong, pipeline will be killed after a timeout
def qg = waitForQualityGate() // Reuse taskId previously collected by withSonarQubeEnv
if (qg.status != 'OK') {
error "Pipeline aborted due to quality gate failure: ${qg.status}"
}
}
}
I am really looking for any way, using gitlab-ci or jenkins to take advantage of the quality gates to decide if an application is deployed.
It clearly says
SonarQube installation defined in this job (My SonarQube Server) does not match any configured installation.
The instructions say:
Configure your SonarQube server(s)
Log into Jenkins as an administrator and go to Manage Jenkins > Configure System:
Scroll down to the SonarQube configuration section, click on Add SonarQube, and add the values you're prompted for.
While you've been referring to the docs yourself, it still seems you either haven't done or used a different name for the installation.
In doubt, please edit your post and add a screenshot from the SonarQube configuration in Manage Jenkins.
you have to install SonarScanner and Quality gate plugin
And put the configuration as below , the project key you have to generate it from SonarServer Account->Security and put the security key in the Jenkins configuration in Sonarqube section
jpg
Include the quality gate plugin in post build action
In the Sonarserver page you have configure the attribute in Qualitygate section that you are trying the make your build failed for

Resources