GitHub Action for SonarCloud throws exception

Hello community,

I am using Java and Gradle and pushed my project to GitHub. I chose the sonarcloud workflow as an action, the free one for public repositories. I enabled verbose mode in the yaml-file because I got an error thrown, when I started analysis. Here is the full output:

INFO: Scanner configuration file: /opt/sonar-scanner/conf/

java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.bootstrap.GlobalConfiguration

( at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent( at org.picocontainer.DefaultPicoContainer.getComponent(

Caused by: Project not found. Please check the ‘sonar.projectKey’ and ‘sonar.organization’ properties, the ‘SONAR_TOKEN’ environment variable, or contact the project administrator

But I have defined all variables in the, in the buidl.gradle and also in the Yaml-File just in case I missed a place where the action could search for the properties. Also my user has execution right in SonarCloud.

Does anyone know what the issue is?


Welcome to the community!

You’ve already verified your project and organization values, so the problem is the third thing: the analysis token. Double-check how you’re setting the SONAR_TOKEN value in the environment.