I'm trying to run sonarqube to scan a java project against localhost. However, when I run mvn sonar:sonar I get this error Unrecoverable indexation failures: 1 errors among 1 requests. Check Elasticsearch logs for further details
. It asks me to look for an ElasticSearch file, which doesn't seem to be on my machine as when I look at the Sonarqube home directory this is what I see.
This is my pom configuration:
<jacoco-maven-plugin.version>0.8.7</jacoco-maven-plugin.version>
<sonar.version>3.9.0.2155</sonar.version>
<profiles>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- Edit this URL for sonarQube server -->
<sonar.host.url>http://localhost:9000/</sonar.host.url>
<sonar.login>myToken</sonar.login>
<!-- Sonar-JaCoCo properties -->
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.jacoco.reportPaths>${basedir}/target/jacoco.exec</sonar.jacoco.reportPaths>
<sonar.web.accessLogs>true</sonar.web.accessLogs>
<java.version>17</java.version>
<sonar.exclusions>**/entity/**</sonar.exclusions>
<sonar.test.exclusions>src/test/**/*</sonar.test.exclusions>
</properties>
</profile>
And here what I see when I type sonar -v
/opt/homebrew/Cellar/sonarqube/9.8.0.63668/libexec/bin/macosx-universal-64/sonar.sh
Thank you.
Update
Adding the outpute for /var/log
CodePudding user response:
"It asks me to look for an ElasticSearch file, which doesn't seem to be on my machine."
Actually, it asks you to look at the log files(!)
The default name for SonarQube's elastic search log file is es.log
. If you can't find it in "obvious" places (e.g. in the "/var/log" tree on a Linux system), you should be able to find the log file using the find
command; e.g.
$ sudo find / -name es.log\* | less
If that doesn't find the log file, you will need to look at your SonarQube installation's logging configuration to figure out where log4j is writing the file.
Once you have found the log file, read what it says. Note that there is information in the SonarQube Troubleshooting on common elastic search problems.