Jenkins +Sonar +ANT+Cactus +hangs at clean snapshot

555 Views Asked by At

I'm having problem running Sonar analysis through Jenkins. Using a Post Step with "Invoke Standalone Sonar Analysis" to start a Sonar Runner task. I can see the result from the analysis in the dashboard but the build in Jenkins never ends. It seems that the cleanup task in Sonar hangs. I am using H2 database and CANNOT change to other databases.

Jenkins is installed in Linux machine and is Sonar version is 3.7.4

How to resolve that clean snapshot hang part?

2

There are 2 best solutions below

0
On

H2 is not recommended for production as in sonar documentation stated. But if you are not awared of the history of sonar analysis, you can do the following (keep on using H2):

In Linux:

  1. Stop sonar: service sonar stop
  2. Delete sonar*.db under /opt/sonar/data
  3. Start sonar again: service sonar start
  4. Then run analysis again.

It should work, good luck.

5
On

H2 database is not supported for production environments (but you seem to be aware of this fact). Furthermore, it is preventing you from upgrading to a recent version of SonarQube, since database migrations are not supported either on H2.

That being said, and if losing your project history is not important, you can try to switch to a recent SQ server and runner (respectively 4.4 and 2.4 as of writing), as there were quite a few improvements and bug fixes since last year.