Sonarqube runner exits with exit code 138 in TeamCity run - teamcity

I'm migrating current stack to Teamcity and sonarqube build step suddenly fails with following output:
[09:56:54][Step 2/3] 09:56:54.862 INFO - Sensor SCM Sensor
[09:56:54][Step 2/3] 09:56:54.872 INFO - SCM provider for this project is: hg
<analysis>
[09:58:28][Step 2/3] 09:58:28.921 INFO - 1197/1831 files analyzed
[09:58:28][Step 2/3] 09:58:28.921 WARN - Missing blame information for the following files:
[09:58:28][Step 2/3] 09:58:28.921 WARN - * <list of paths>
...
[09:58:29][Step 2/3] 09:58:29.024 WARN - This may lead to missing/broken features in SonarQube
[09:58:30][Step 2/3] INFO: ------------------------------------------------------------------------
[09:58:30][Step 2/3] INFO: EXECUTION FAILURE
[09:58:30][Step 2/3] INFO: ------------------------------------------------------------------------
[09:58:30][Step 2/3] Total time: 3:27.871s
[09:58:30][Step 2/3] Final Memory: 18M/161M
[09:58:30][Step 2/3] INFO: ------------------------------------------------------------------------
[09:58:30][Step 2/3] ERROR: Error during Sonar runner execution
[09:58:30][Step 2/3] ERROR: Unable to execute Sonar
[09:58:30][Step 2/3] ERROR: Caused by: -1
[09:58:30][Step 2/3] ERROR:
[09:58:30][Step 2/3] ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
[09:58:30][Step 2/3] ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
[09:58:30][Step 2/3] Process exited with code 1
[09:58:30][Step 2/3] Step SonarQube Runner failed
How do i beat up that problem so the build would continue, or, at least, get the exact reason build fails? Mercurial data directory (.hg) should be in place, checkout is done on agent side.

Related

Maven build failure in Jenkins pipeline

I've Jenkins as my CI/CD with over 30 multi-branch pipelines running and I have started getting this error at "artifactory configuration stage" when trying to deploy the artifactory to Jfrog. The snippet of my Jenkinsfile is as follows:
// Artifactory Intigration
stage('Artifactory configuration') {
container('mvn') {
// Obtain an Artifactory server instance, defined in Jenkins --> Manage:
server = Artifactory.server 'dlight-jfrog'
rtMaven = Artifactory.newMavenBuild()
rtMaven.tool = 'mvn' // Tool name from Jenkins configuration
rtMaven.opts = "-Denv=dev"
rtMaven.deployer releaseRepo: 'libs-release-local', snapshotRepo: 'libs-snapshot-local', server: server
rtMaven.resolver releaseRepo: 'libs-release', snapshotRepo: 'libs-snapshot', server: server
rtMaven.deployer.deployArtifacts = false // Disable artifacts deployment during Maven run
buildInfo = Artifactory.newBuildInfo()
}
}
// sonarqube configuration
stage('SonarQube analysis') {
withSonarQubeEnv('dlight sonar') {
//rtMaven.run pom: 'pom.xml', goals: 'package sonar:sonar -Dsonar.branch.name=develop', buildInfo: buildInfo
rtMaven.run pom: 'pom.xml', goals: 'package sonar:sonar', buildInfo: buildInfo
}
}
stage("Quality Gate"){
timeout(time: 1, unit: 'HOURS') {
def qg = waitForQualityGate()
if (qg.status != 'OK') {
error "Pipeline aborted due to quality gate failure: ${qg.status}"
}
}
}
// build artifact
stage ('MVN Install') {
rtMaven.run pom: 'pom.xml', goals: 'install', buildInfo: buildInfo
}
And the pipeline aborts with this error message
Downloaded from central: https://xxx.xxx.xxx.com/libs-release/org/apache/maven/surefire/surefire-junit4/2.18.1/surefire-junit4-2.18.1.jar (68 kB at 6.2 MB/s)
-------------------------------------------------------
T E S T S
-------------------------------------------------------
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Skipping pipeline-name
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - This project has been banned from the build due to previous failures.
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - BUILD FAILURE
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Total time: 27.139 s
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Finished at: 2021-10-06T12:08:08Z
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Final Memory: 163M/962M
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] ERROR org.apache.maven.cli.MavenCli - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project pipeline-name: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[main] ERROR org.apache.maven.cli.MavenCli - Command was /bin/sh -c cd /home/jenkins/agent/workspace/piplelinename && /usr/local/openjdk-11/bin/java -javaagent:/home/jenkins/.m2/repository/org/jacoco/org.jacoco.agent/0.8.0/org.jacoco.agent-0.8.0-runtime.jar=destfile=/home/jenkins/agent/workspace/core-service-pipeline-name/target/jacoco.exec org.apache.maven.surefire.booter.ForkedBooter /home/jenkins/agent/workspace/core-service-pipelinename/target/surefire/surefire5994062267928659047tmp /home/jenkins/agent/workspace/pipeline-name/target/surefire/surefire_06380871570757565397tmp
[main] ERROR org.apache.maven.cli.MavenCli - -> [Help 1]
[main] ERROR org.apache.maven.cli.MavenCli -
[main] ERROR org.apache.maven.cli.MavenCli - To see the full stack trace of the errors, re-run Maven with the -e switch.
[main] ERROR org.apache.maven.cli.MavenCli - Re-run Maven using the -X switch to enable full debug logging.
[main] ERROR org.apache.maven.cli.MavenCli -
[main] ERROR org.apache.maven.cli.MavenCli - For more information about the errors and possible solutions, please read the following articles:
[main] ERROR org.apache.maven.cli.MavenCli - [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[Pipeline] }

Snoarqube- I keep getting the error "The 'report' parameter is missing"

I can not seem to find any answers regarding this issue
5:04:56.635 INFO: ------------------------------------------------------------------------
05:04:56.635 INFO: EXECUTION FAILURE
05:04:56.635 INFO: ------------------------------------------------------------------------
05:04:56.635 INFO: Total time: 28.403s
05:04:56.849 INFO: Final Memory: 63M/1435M
05:04:56.849 INFO: ------------------------------------------------------------------------
05:04:56.849 ERROR: Error during SonarQube Scanner execution
The 'report' parameter is missing
05:04:56.850 DEBUG: Execution getVersion
05:04:56.850 DEBUG: Execution stop
For me, this was that the SonarQube server had a full HDD
Re-run SonarQube using the -X switch to enable full debug logging.

Jenkins svn branches

I recently created an automated process to run multi-step Maven builds for my organization. But i am having difficulty committing the version changes on svn
I want to update this file contents and compile my code and then commit this file back to svn. So that SVN has latest build version number.
How do I commit this changed file to SVN.
Ty very much.
I invoke top-level Maven targets to release in svn:
my goals is: release:perform -DconnectionUrl=scm:svn:http://XXX
This is my maven error in jenkins:
[maven] $ cmd.exe /C "D:\apache-maven-3.5.0\bin\mvn.cmd release:perform -DconnectionUrl=scm:svn:http://10.10.20.151/svn/repos/aubay/test/jenkins/branches && exit %%ERRORLEVEL%%"
channel stopped
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jenkins 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-release-plugin:2.3.2:perform (default-cli) # jenkins ---
[ERROR] Cannot perform release - the preparation step was stopped mid-way. Please re-run release:prepare to continue, or perform the release from an SCM tag.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.199 s
[INFO] Finished at: 2017-08-24T15:48:29+02:00
[INFO] Final Memory: 12M/150M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:perform (default-cli) on project jenkins: Cannot perform release - the preparation step was stopped mid-way. Please re-run release:prepare to continue, or perform the release from an SCM tag. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE

sonarqube v5.4 analysis failed on WARN messages

My cobertura coverage on sonarqube v4.5.6 with runner-2.4, and 2.5.1 has some warning "WARN-File not found:" but the sonar analysis complete successfully.
However, when the same job run on sonarqube v5.4 with same runner versions, the sonar analysis failed with "execution failure". I haven't found a way to ignore this warning for now. Has anyone run into the same issue and got it resolved? Thanks,
...
02:03:48.202 INFO - Sensor Groovy CoberturaSensor
02:03:48.202 INFO - Analyzing Cobertura report: target/test-reports/cobertura/coverage.xml
02:03:48.402 WARN - File not found: Route1.groovy
02:03:48.402 WARN - File not found: Route2.groovy
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
...

Execution failure, unable to request: /deploy/jdbc-driver.txt

We used a Master/Slaves Jenkins architecture to perform SonarQube. When i runned my job,
Sonar was unable to execute and request the file /deploy/jdbc-driver.txt. I didn't find the reason, my properties files (Sonar server and sonar runner) seems to be good.
Could you help me please ?
Best regards,
David Parcoit
[IBP.DVB] $ D:\sonar-runner\bin\sonar-runner.bat -Dsonar.jdbc.driver=com.mysql.jdbc.Driver "-Dsonar.jdbc.url=jdbc:mysql://ibicer05.srv-ib.dev:54301/sonar?autoReconnect=true&useUnicode=true&characterEncoding=utf8" ******** ******** -Dsonar.host.url=http://ibicer00.srv-ib.dev:8090/sonar "-Dsonar.projectBaseDir=E:\Jenkins\workspace\DVB - Build Quotidien\IBP.DVB" -Dsonar.sourceEncoding=UTF-8 -Dsonar.dotnet.excludeGeneratedCode=true -Dsonar.dotnet.buildConfigurations=Release -Dsonar.language=cs -Dsonar.sources=. -Dsonar.gendarme.mode=skip -Dsonar.projectVersion=1.0.0.0 -Dsonar.projectKey=IBP.DVB -Dsonar.ndeps.mode=skip -Dsonar.dotnet.visualstudio.solution.file=IBP.DVB.sln -Dsonar.projectName=DVB
D:\sonar-runner
SonarQube Runner 2.4
Java 1.8.0_05 Oracle Corporation (64-bit)
Windows Server 2012 6.2 amd64
INFO: Runner configuration file: D:\sonar-runner\conf\sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: E:\Jenkins\workspace\DVB - Build Quotidien\IBP.DVB\.sonar
INFO: SonarQube Server 3.7.4
23:47:37.351 INFO - Load batch settings
23:47:37.507 INFO - User cache: C:\Windows\system32\config\systemprofile\.sonar\cache
23:47:37.523 INFO - Install plugins
23:47:42.265 INFO - Install JDBC driver
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 13.573s
Final Memory: 4M/44M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to request: /deploy/jdbc-driver.txt
ERROR: Caused by: Unexpected end of ZLIB input stream
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
Finished: FAILURE

Resources