SonarQube "Error during SonarScanner execution" in CI
This is the scanner's final summary line after any fatal error. The actual problem (an unreachable host, a bad property, an unsupported Java version, or an unparseable report) appears in the ERROR lines immediately above it.
What this error means
The build ends with "ERROR: Error during SonarScanner execution" preceded by a more specific ERROR line such as a connection failure or a property validation error.
ERROR: SonarQube server [https://sonar.example.com] can not be reached
ERROR: Error during SonarScanner execution
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.Common causes
The Sonar host is unreachable or SONAR_HOST_URL is wrong
A missing or mistyped SONAR_HOST_URL, or a server behind a network the runner cannot reach, makes the scanner fail to connect.
An unsupported Java version or bad property
Recent scanners require a specific Java (17 or 21); an old JRE, or an invalid property value, aborts execution.
How to fix it
Read the ERROR line above the summary
- Scroll up to the first
ERROR:line; it names the real failure. - Re-run the scanner with
-X(orsonar.verbose=true) for full debug output. - Fix the host URL, property, or Java version it points to.
sonar-scanner -Dsonar.host.url=$SONAR_HOST_URL -XProvide a supported Java for the scanner
Set up the JDK the scanner version requires before running it.
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'How to prevent it
- Set
SONAR_HOST_URLandSONAR_TOKENfrom secrets in the scan step. - Run the scanner on the Java version it supports.
- Use
-Xearly to surface the specific error.