I integrated SonarCloud into Apache Creadur RAT with a separate GHA YML:
Analysis runs well on master branch, but all PRs run into broken builds, e.g.
The error log indicates an error within the SonarQube analysis:
[INFO] Load project branches
[INFO] Load project branches (done) | time=286ms
[INFO] Load project settings for component key: 'apache_creadur-rat'
[INFO] Load project settings for component key: 'apache_creadur-rat' (done) | time=237ms
Error: Error during SonarScanner Engine execution
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@1e4bccdf-org.sonar.scanner.scan.ModuleIndexer': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@1e4bccdf-org.sonar.scanner.scan.filesystem.InputComponentStore': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'BranchConfiguration' defined in org.sonar.scanner.scan.branch.BranchConfigurationProvider: Unsatisfied dependency expressed through method 'provide' parameter 0: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@1e4bccdf-com.sonarsource.branch.BranchConfigurationLoaderImpl': Unsatisfied dependency expressed through constructor parameter 1: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@1e4bccdf-com.sonarsource.branch.PrBranchConfigurationBuilder': Unsatisfied dependency expressed through constructor parameter 3: Error creating bean with name 'ProjectBindingFlag' defined in org.sonar.scanner.scan.branch.ProjectBindingFlagProvider: Unsatisfied dependency expressed through method 'provide' parameter 1: Error creating bean with name 'ProjectConfiguration' defined in org.sonar.scanner.scan.ProjectConfigurationProvider: Unsatisfied dependency expressed through method 'provide' parameter 5: Error creating bean with name 'FeatureFlagSettings' defined in org.sonar.scanner.featureflag.FeatureFlagSettingsProvider: Unsatisfied dependency expressed through method 'provide' parameter 0: Error creating bean with name 'FeatureFlags' defined in org.sonar.scanner.featureflag.FeatureFlagSettingsProvider: Failed to instantiate [org.sonar.scanner.extension.api.FeatureFlags]: Factory method 'provide' threw exception with message: Cannot invoke "java.util.Map.entrySet()" because "<parameter1>" is null
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:804)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:240)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1395)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1232)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:569)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:529)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:339)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:373)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:337)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.instantiateSingleton(DefaultListableBeanFactory.java:1221)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingleton(DefaultListableBeanFactory.java:1187)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:1123)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:987)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:627)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:209)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:189)
at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:146)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:210)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:189)
at org.sonar.scanner.bootstrap.ScannerMain.runScannerEngine(ScannerMain.java:143)
at org.sonar.scanner.bootstrap.ScannerMain.run(ScannerMain.java:58)
at org.sonar.scanner.bootstrap.ScannerMain.main(ScannerMain.java:42)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@1e4bccdf-org.sonar.scanner.scan.filesystem.InputComponentStore': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'BranchConfiguration' defined in org.sonar.scanner.scan.branch.BranchConfigurationProvider: Unsatisfied dependency expressed through method 'provide' parameter 0: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@1e4bccdf-com.sonarsource.branch.BranchConfigurationLoaderImpl': Unsatisfied dependency expressed through constructor parameter 1: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@1e4bccdf-com.sonarsource.branch.PrBranchConfigurationBuilder': Unsatisfied dependency expressed through constructor parameter 3: Error creating bean with name 'ProjectBindingFlag' defined in org.sonar.scanner.scan.branch.ProjectBindingFlagProvider: Unsatisfied dependency expressed through method 'provide' parameter 1: Error creating bean with name 'ProjectConfiguration' defined in org.sonar.scanner.scan.ProjectConfigurationProvider: Unsatisfied dependency expressed through method 'provide' parameter 5: Error creating bean with name 'FeatureFlagSettings' defined in org.sonar.scanner.featureflag.FeatureFlagSettingsProvider: Unsatisfied dependency expressed through method 'provide' parameter 0: Error creating bean with name 'FeatureFlags' defined in org.sonar.scanner.featureflag.FeatureFlagSettingsProvider: Failed to instantiate [org.sonar.scanner.extension.api.FeatureFlags]: Factory method 'provide' threw exception with message: Cannot invoke "java.util.Map.entrySet()" because "<parameter1>" is null
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:804)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:240)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1395)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1232)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:569)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:529)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:339)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:373)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:337)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1760)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1643)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:913)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
... 22 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'BranchConfiguration' defined in org.sonar.scanner.scan.branch.BranchConfigurationProvider: Unsatisfied dependency expressed through method 'provide' parameter 0: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@1e4bccdf-
Is this an application error on the side of SonarQube or is something wrong with my configuration?
Welcome to the community and thanks for this report!
Given how much is already going on in your log, I hesitate to ask this, but could you add -X to your Maven command so we get debug logging, try again, and post a pointer to new new log?
after adding ā-X -eā to the command line call the log output is cut on GitHubActions so that I can only see the first 50 lines ā¦.. thus Iām unable to see any stacktraces/more error messages.
Hah! It did that to me at first too. I went to other windows to investigate possible causes and when I came back, the rest of the log started loading. All 128,834 lines⦠before the truncation Fortunately, itās aaall there in the raw version of the log.
2026-01-09T09:11:08.6769341Z [INFO] ANALYSIS SUCCESSFUL, you can find the results at: https://sonarcloud.io/dashboard?id=apache_creadur-rat&branch=master
For reference, hereās my somewhat-cleaned-up copy of the log. log.log (5.3 MB)
What DevOps platform are we dealing with here? Itās likely that the PAT youāve set at the project level has expired. Itās used only in a PR context, which would explain why only PRs fail.
SONAR_TOKEN is passed as a project secret via GitHub. As the builds are working properly on branch master I suspected it is a problem within the GitHubAction script I linked above.
The script is taken from the sonarcloud documentation ā¦.. HTH
I tried finding the root cause again. As the analysis on branch master runs throught successfully with the same script Iām unsure if the error message is the correct cause:
2026-01-16T00:36:43.6383210Z Caused by: org.sonar.api.utils.MessageException: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator to check the permissions of the user the token belongs to
The projectKey and organisation values are passed in as parameters and the same SONAR_TOKEN is used that was issued quite recently. Any more hints where to look at?
Update: As the analysis from branch master seems to be updated I assume organization and projectId are correct:
2026-01-12T00:41:40.0621688Z [INFO] Check ALM binding of project 'apache_creadur-rat'
2026-01-12T00:41:40.0628959Z [DEBUG] --> GET https://sonarcloud.io/api/alm_integration/is_project_bound?project=apache_creadur-rat
2026-01-12T00:41:40.1627946Z [DEBUG] <-- 401 https://sonarcloud.io/api/alm_integration/is_project_bound?project=apache_creadur-rat (99ms, unknown-length body)
2026-01-12T00:41:40.1628849Z [WARNING] Failed to check if project 'apache_creadur-rat' is bound
2026-01-12T00:41:40.1629485Z [INFO] Detected project binding: ERROR
2026-01-12T00:41:40.1632305Z [INFO] Check ALM binding of project 'apache_creadur-rat' (done) | time=101ms
2026-01-12T00:41:40.1654594Z [INFO] Load project pull requests
...
2026-01-12T00:41:40.3623017Z [INFO] Load project pull requests (done) | time=196ms
2026-01-12T00:41:40.3651897Z [INFO] Load branch configuration
2026-01-12T00:41:40.3665357Z [INFO] Github event: pull_request
2026-01-12T00:41:40.3733299Z [INFO] Auto-configuring pull request 609
2026-01-12T00:41:40.3737706Z [INFO] Load branch configuration (done) | time=9ms
...
2026-01-12T00:41:40.3847961Z [INFO] Load quality profiles
...
2026-01-12T00:41:40.6704950Z [INFO] Load quality profiles (done) | time=286ms
2026-01-12T00:41:40.6925515Z [INFO] Create analysis
2026-01-12T00:41:40.7094289Z [DEBUG] Create analysis with parameters CreateAnalysisRequest[organizationKey=apache, projectKey=apache_creadur-rat, projectVersion=1.0.0-SNAPSHOT, branchName=null, pullRequestKey=609, referenceBranchId=a1990be0-1958-446f-b0b0-bbccc448338b, analysisId=null]
2026-01-12T00:41:40.7125140Z [DEBUG] --> POST https://api.sonarcloud.io/analysis/analyses (178-byte body)
2026-01-12T00:41:40.8587783Z [DEBUG] <-- 401 https://api.sonarcloud.io/analysis/analyses (145ms, 144-byte body)
2026-01-12T00:41:40.8846036Z [DEBUG] Cleanup org.eclipse.jgit.util.FS$FileStoreAttributes$$Lambda$397/0x00007f4594359c20@64469d8 during JVM shutdown
2026-01-12T00:41:40.8879274Z [ERROR] Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator to check the permissions of the user the token belongs to
A 401 is a permissions error. Either one of the three values mentioned in the error message is wrong or thereās a problem talking to GitHub. Since this part is successful:
Thanks again - as the SONAR_TOKEN is defined globally on the repository I see no way for it to differ between branches, build script is the same for all branches:
The token itself should be valid as it was generated during my first login in SonarCloud in the beginning of January 2026 and had no configuration options to select branches.
Iām not sure how a āregularā integration works, but we would like to have sonarCloud for branch master. PRs can run their analysis and show results, but should not affect the main master-branch-sonarcloud integration.
Could the problem be, that the branchName is set to null?
Iāll be honest and say this is not a point in analysis that Iāve seen problems before. Iām not sure where else to look, so Iām going to call in help. Unfortunately, they probably wonāt show up immediately.
Iām glad you came back on this thread because Iāve learned more since my last update.
It turns out a failure at this step is a permissions problem, specifically with your tokenās permissions to analyze the project (as opposed to your devOps PAT stored in SQC).
So I think the easiest first step here would be to create a new token an set it into your properties.
The error keeps being the same: Unable to create analysis. Again, this is a permissions problem. Regardless of where the token comes from, please make sure the issuing account has permissions to analyze the project.
Explicitly: it is quite possible to have admin on a project without the rights to analyze the project. It is quite possible to be a global/organization admin without rights to analyze a specific project in the organization.
Hi! Iāve tweaked the build to echo if the secret is available and it seems that the globally/organization-level secret seems only available on master-branch builds. Not sure if this is a security feature or a bug, but the branch-builds seem to fail due to a missing SONAR_TOKEN.
Would it make sense to change logging on your site to make it explicit that no token was passed to the build? A permission error (wrong token etc.) could be distinguished from a missing token (configuration error on consumer-side).
I think there are probably āSecurity Reasonsā weāve kept this obscure, but IMO it definitely be helpful if we were not. Iām going to flag this for the PMs.