SonarQube scanner tekton task /tekton/task/sonarqube-scanner in default configuration is throwing following exception while scanning project in Go:
step-sonar-scan
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /workspace/source/sonar-project.properties
INFO: SonarScanner 4.6.2.2472
INFO: Java 11.0.14 Alpine (64-bit)
INFO: Linux 5.14.0-427.50.1.el9_4.x86_64 amd64
INFO: User cache: /opt/sonar-scanner/.sonar/cache
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /workspace/source/sonar-project.properties
INFO: Analyzing on SonarQube server 2025.1.0.102418
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1.078s
INFO: Final Memory: 3M/40M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.UnsupportedClassVersionError: /sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/java.URLClassLoader.defineClass(URLClassLoader.java:555)
at java.base/java.URLClassLoader$1.run(URLClassLoader.java:458)
at java.base/java.URLClassLoader$1.run(URLClassLoader.java:452)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.URLClassLoader.findClass(URLClassLoader.java:451)
at .sonarsource.scanner.api.internal.IsolatedClassloader.loadClass(IsolatedClassloader.java:82)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at .sonarsource.scanner.api.internal.batch.DefaultBatchFactory.createBatch(DefaultBatchFactory.java:32)
at .sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at .sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at .sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at .sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at .sonarsource.scanner.cli.Main.execute(Main.java:112)
at .sonarsource.scanner.cli.Main.execute(Main.java:75)
at .sonarsource.scanner.cli.Main.main(Main.java:61)
SonarQube scanner tekton task https://hub.tekton.dev/tekton/task/sonarqube-scanner in default configuration is throwing following exception while scanning project in Go:
step-sonar-scan
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /workspace/source/sonar-project.properties
INFO: SonarScanner 4.6.2.2472
INFO: Java 11.0.14 Alpine (64-bit)
INFO: Linux 5.14.0-427.50.1.el9_4.x86_64 amd64
INFO: User cache: /opt/sonar-scanner/.sonar/cache
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /workspace/source/sonar-project.properties
INFO: Analyzing on SonarQube server 2025.1.0.102418
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1.078s
INFO: Final Memory: 3M/40M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.UnsupportedClassVersionError: /sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/java.URLClassLoader.defineClass(URLClassLoader.java:555)
at java.base/java.URLClassLoader$1.run(URLClassLoader.java:458)
at java.base/java.URLClassLoader$1.run(URLClassLoader.java:452)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.URLClassLoader.findClass(URLClassLoader.java:451)
at .sonarsource.scanner.api.internal.IsolatedClassloader.loadClass(IsolatedClassloader.java:82)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at .sonarsource.scanner.api.internal.batch.DefaultBatchFactory.createBatch(DefaultBatchFactory.java:32)
at .sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at .sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at .sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at .sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at .sonarsource.scanner.cli.Main.execute(Main.java:112)
at .sonarsource.scanner.cli.Main.execute(Main.java:75)
at .sonarsource.scanner.cli.Main.main(Main.java:61)
Share
Improve this question
asked Feb 12 at 20:14
GasGas
18.1k4 gold badges47 silver badges99 bronze badges
1 Answer
Reset to default 0AFter investigation, it looks like the default image used in the task is no longer working with the latest server version:
- name: SONAR_SCANNER_IMAGE
description: "The sonarqube scanner CLI image which will run the scan"
default: "docker.io/sonarsource/sonar-scanner-cli:4.6@sha256:7a976330a8bad1beca6584c1c118e946e7a25fdc5b664d5c0a869a6577d81b4f"
after changing to latest (at this moment) image:
- name: SONAR_SCANNER_IMAGE
value: "docker.io/sonarsource/sonar-scanner-cli:11.2
scan went ok.
In addition it was required to use provide sonar.token
in properties instead of SONAR_LOGIN_KEY
and SONAR_PASSWORD_KEY
params.