We are running SonarQube Community Edition Version 7.9.6 (build 41879), and Gradle SonarQube plugin 3.0 to build and scan our java projects.
Our Sonarqube server is shut down nightly to save money in cloud hosting, but after it is started in the morning all builds using the Gradle plugin fail until we restart the SQ server a second time. Then it is “happy” for the rest of the day.
We are running automated builds on Jenkins 2.263.4
We do have a relaxed policy on minimum coverage for passing code compared with the stock quality profiles (i.e. only 20% minimum coverage).
When we run the job with Gradle stacktrace turned on, we have:
java.lang.IllegalStateException: Unable to load component interface org.sonar.api.batch.rule.ActiveRules
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
at .....
java.lang.NullPointerException
at org.sonar.scanner.rule.DefaultActiveRulesLoader.readPage(DefaultActiveRulesLoader.java:102)
at ...
Nothing. The last message in our server logs is “SonarQube started successfully”. The only log that seems to be updated is the access logs. The sonar.log, es.log, and ce.log files don’t have any information past the initial startup. It’s making troubleshooting impossible.
Docker is not involved, and I can’t answer the question about DNS. How does DNS cause Sonar to fail? My team is troubleshooting blind due to the lack of application logging once the service is up and running.
My DevOps guy gave it to me in an image–at least what we got from Gradle. I couldn’t find a way to upload an image to the forum or I would have provided it. Keep in mind that Gradle does work after we restart Sonar a second time. And then it works all day until we shut down automatically for the night.
Regarding the log granularity, they are set at “INFO” at the moment, what level do you recommend to find something useful when things fail?
This problem only seems to plague us in the AM, and is currently working now. I’m trying to find a failed build in history that also has the stack trace in it, but it is taking time.
I have the robust logging on the client side, but we need the magic parameters in gradle to include the stacktrace.