Skip to content
Latchkey

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.

SonarQube
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

  1. Scroll up to the first ERROR: line; it names the real failure.
  2. Re-run the scanner with -X (or sonar.verbose=true) for full debug output.
  3. Fix the host URL, property, or Java version it points to.
Terminal
sonar-scanner -Dsonar.host.url=$SONAR_HOST_URL -X

Provide a supported Java for the scanner

Set up the JDK the scanner version requires before running it.

.github/workflows/ci.yml
- uses: actions/setup-java@v4
  with:
    distribution: temurin
    java-version: '17'

How to prevent it

  • Set SONAR_HOST_URL and SONAR_TOKEN from secrets in the scan step.
  • Run the scanner on the Java version it supports.
  • Use -X early to surface the specific error.

Frequently asked questions

What causes ""Error during SonarScanner execution""?
A missing or mistyped SONAR_HOST_URL, or a server behind a network the runner cannot reach, makes the scanner fail to connect.
How do I fix "Error during SonarScanner execution"?
Read the ERROR line above the summary

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card