HTTP 500 / NullPointerException at the end of the SonarQube build downloading retrieving issues - sonarqube

In the Jenkins build, here's the stack we have:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project gwt-parent: Fail to execute request [code=500, url=http://forge.mipih.net/sonar/batch/issues?key=fr.pgih.socle%3Agwt-parent]: Fail to download [http://forge.mipih.net/sonar/batch/issues?key=fr.pgih.socle%3Agwt-parent]. Response code: 500 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project gwt-parent: Fail to execute request [code=500, url=http://forge.mipih.net/sonar/batch/issues?key=fr.pgih.socle%3Agwt-parent]
[snip]
... 19 more
Caused by: java.lang.IllegalStateException: Fail to execute request [code=500, url=http://forge.mipih.net/sonar/batch/issues?key=fr.pgih.socle%3Agwt-parent]
at org.sonar.batch.bootstrap.ServerClient.handleHttpException(ServerClient.java:139)
at org.sonar.batch.repository.DefaultServerIssuesLoader.load(DefaultServerIssuesLoader.java:49)
[snip]
... 22 more
Caused by: org.sonar.api.utils.HttpDownloader$HttpException: Fail to download [http://forge.mipih.net/sonar/batch/issues?key=fr.pgih.socle%3Agwt-parent]. Response code: 500
at org.sonar.api.utils.HttpDownloader$BaseHttpDownloader$HttpInputSupplier.getInput(HttpDownloader.java:305)
[snip]
And on the Server
2015.08.31 12:56:55 ERROR web[o.s.s.w.WebServiceEngine] Fail to process request http://forge.mipih.net/sonar/batch/issues?key=fr.pgih.socle%3Agwt-parent
java.lang.NullPointerException: null
at org.sonar.batch.protocol.input.BatchInput$ServerIssue$Builder.setModuleKey(BatchInput.java:1451) ~[sonar-batch-protocol-5.1.1.jar:na]
at org.sonar.server.batch.IssuesAction.handleIssue(IssuesAction.java:96) ~[sonar-server-5.1.1.jar:na]
at org.sonar.server.batch.IssuesAction.handle(IssuesAction.java:87) ~[sonar-server-5.1.1.jar:na]
at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:84) ~[sonar-server-5.1.1.jar:na]
at sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source) ~[na:na]
[snip]
But indeed, this URL is accessible from my browser. Here's what it serves:
{"errors":[{"msg":""}]}
Do you have any idea where it might come from?
Just in case, FYI, SonarQube 5.1.1 is running through the official sonarqube & mysql images.
I've crawled the changelog from 5.1.2, and I didn't find an obviously related issue. Is this a known issue?
Thanks a lot for your help.

It looks like you are facing the same issue reported here, at least it's the exact same stacktrace, which is fixed since 5.1.
Only case left where this error could occur is if the Jenkins job you are running is trying to analyse a deleted module.
Since analyzing a module is a bit odd, you might be analyzing a module which used to be a project.
Fix would then be to update your Jenkins job to analyse the new project.

Related

Jenkins maven projet build failed on fork during test

I'm building maven project on Jenkins (version 2.263.4, not the last but not so far).
It's a git project with pipeline configuration and webhook from bitbucket when push is done on the project.
So when a developper create a branch and another one a pull request, i have 2 build in parallel. Domain test running in about 45min.
And sometimes(not always), i have this error :
Command was /bin/sh -c cd /jenkins/workspace/a-hub_test-plantage-jenkins_PR-1/server/project-core/project-core-domain && /jenkins/tools/hudson.model.JDK/jdk11/jdk-11.0.2+9/bin/java -Xmx1500M -jar /jenkins/workspace/a-hub_test-plantage-jenkins_PR-1/server/project-core/project-core-domain/target/surefire/surefirebooter15630998754365374145.jar /jenkins/workspace/a-hub_test-plantage-jenkins_PR-1/server/project-core/project-core-domain/target/surefire 2021-05-04T12-39-54_622-jvmRun1 surefire5846464826560071036tmp surefire_13691263758446667285tmp
Error occurred in starting fork, check output in log
14:46:13 [ERROR] Process Exit Code: 1
14:46:13 [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:669)
14:46:13 [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282)
14:46:13 [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)
If i re run the buildin error, it work.
I'm using maven-surefire 2.22.2.
I try to configure it following many thread on stackoverfow, but nothgin work. I try with forkMode none or something else, it work but i loose coverage because jaccoco need fork to work. So i'm stuck.
What can i do to help me to debug this problem?
I don't understand why build failed when another one is building because for me Jenkins work on different working folder, no? so why the problem appear when i'have multiple build in parallel?
thanks for help
I find an hs_err_pid.log in jenkins near source code and i see out of memory! i see that my test was launch with -Xmx1500Mo and problem occured when i launched multiple branch/pr, so jenkins use all of the memory and failed all build during fork...i decrease -Xmx and all seems to work.

xl-deploy: Getting HTTP error code : 500 error

I am getting this error while running "mvn clean xldeploy:import"
Failed to execute goal com.xebialabs.xldeploy:xldeploy-maven-plugin:5.1.0:import (default-cli) on project gsp.tms.app: Execution default-cli of goal com.xebialabs.xldeploy:xldeploy-maven-plugin:5.1.0:import failed: Failed : HTTP error code : 500 -> [Help 1]
How to fix it?
May be checking log file located at XLDeploy server under "XLD_INSTALL_HOME/log/deployit.log" at time of executing this gives more details,
This error can happen for multiple reasons for example due to unknown type definition needed by package being imported which could happen because of missing plugin in XLDeploy it self.
Another thing you can do is to try to import this package from XLDeploy UI and see if there are any errors during import.

SonarQube - Unable to load component class

I keep receiving this issue (Build failure) when I add a random exclude in SonarQube.
I don't know why this occurs and it still throws a build failure irrespective of what what I exclude.
This used to work before I upgraded SonarQube from 7.4 to 7.5.
[ERROR] Failed to execute goal
org.sonarsource.scanner.maven:sonar-maven-plugin:3.5.0.1254:sonar
(default-cli) on project root: Unable to load component class
org.sonar.scanner.phases.AbstractPhaseExecutor: Unable to load
component class
org.sonar.scanner.issue.ignore.scanner.IssueExclusionsLoader: Unable
to load component class
org.sonar.scanner.issue.ignore.pattern.IssueExclusionPatternInitializer:
Exclusions > Issues : Invalid format. The first field does not define
a resource pattern: ,squid:S00119,* -> [Help 1]
Fixed my issue by adding in SonarQube, not only the squid:S00119 but also the what file pattern to search for. I only added squid:S00119 and that is why it wasn't enough. You need also to specify what file.

Sonar.Branch parameter is throwing error in SonarQube 5.0

People,
With new SonarQube version for C# plugin -Dsonar.branch=X parameter is throwing error. The error is as follows:-
Sonar failed with error: 'ERROR: Error during Sonar runner executionERROR: Unable to execute SonarERROR: Caused by: Fail to decorate 'org.sonar.api.resources.File#56b0f44f[key=Aspects/MethodPerformanceAttribute.cs,deprecatedKey=Aspects/MethodPerformanceAttribute.cs,path=Aspects/MethodPerformanceAttribute.cs,dir=Aspects,filename=MethodPerformanceAttribute.cs,language=C#]'ERROR: Caused by: Resource org.sonar.api.resources.File#56b0f44f[key=Aspects/MethodPerformanceAttribute.cs,deprecatedKey=Aspects/MethodPerformanceAttribute.cs,path=Aspects/MethodPerformanceAttribute.cs,dir=Aspects,filename=MethodPerformanceAttribute.cs,language=C#] was not found in InputPath cacheERROR
This error goes away and sonar run is succeessful if i remove the -Dsonar.branch parameter. Can someone provide more information on this.
This issue has been solved in SonarQube 5.1, see http://jira.codehaus.org/browse/SONAR-6250 for additional details.

sonarqube 4.1.2: unable to evict preview database

After performing a successful analysis, we are seeing a failure "Unable to evict preview database: /batch_bootstrap/evict?project=10020". This is followed by the summary:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar (default-cli) on project XXX: Can not execute SonarQube analysis: Unable to evict preview database: /batch_bootstrap/evict?project=10020: Fail to execute request [code=400, url=https://XXX/batch_bootstrap/evict?project=10020]: Fail to download [https://XXX/batch_bootstrap/evict?project=10020]. Response code: 400 -> [Help 1]
This is running on SLES11SP1, Java 1.7, maven 3.3. I've tried increasing memory (MAVEN_OPTS="-Xms4096m -Xmx8092m -XX:MaxPermSize=4096m") and changing ulimit for files (8192) but have not seen any change in failure.
Any hints? What is the code 400?
You should publish the properties files with the analysis configuration, and the log file complete.
Regards.

Resources