We got the same problem. Running and PAT token reset with full access does not help. The only option found is to skip the Sonar steps for WHOLE solution before fix get delivered. Weâre going to track it status.
however â+â represents a space in query string, so it will be " ORGNAME" which is not necessarily wrong if sonar handles it. From our side we are sending it without space. Maybe this is related to root cause. Please check it
For people having the issue of the extra â+â in the organization query parameter, this seems to be a different issue than the original â/api/v2â issue.
I guess there is an extra space added somewhere, and I would like to understand the root cause to decide on the best fix.
Can you please describe your scanner setup? For example, are you using the SonarQube Cloud Azure Devops Extension? What is your scanner flavor (e.g. .NET, CLI, Maven)? How do you pass the Organization to the scanner?
From what I could gather - we are using SonarScanner for MSBuild 10.1.2 (.NET), SonarQube Cloud Azure Devops Extension is in use (I have tried both SonarCloudAnalyze@2 and 3).
About how the Organization is passed - I am not sure, I have checked the sonarcloud page - there is âOrganization bindingâ setup, maybe this? I have also checked the General tab there - both organization name and key does not have that + sign added.
but this is probably not your exact situation, because I think yaml is trimming strings by default.
Other common ways to pass the organization are:
passing command line parameters: dotnet <path to SonarScanner.MSBuild.dll> begin /k:"project-key" /o:"<organization>" but here again, I suppose you would have noticed if there is an extra space.
setting it in sonar-project.properties file (when using the Scanner CLI). Here it might be more possible to let a leading space slip.
where âparameters.organizantionNameâ is defaulted with organization name (lets say âxxxâ, no plus sign here) value and is not modified by other yaml that is using that template.
âUPDATE - it was noticed that sonar.organization from âextraPropertiesâ was passed with extra " " here, so instead of
Caused by: java.lang.IllegalStateException: Unable to load active rules
##[error]at org.sonar.scanner.rule.DefaultActiveRulesLoader.load(DefaultActiveRulesLoader.java:52)
at org.sonar.scanner.rule.ActiveRulesProvider.load(ActiveRulesProvider.java:58)
at org.sonar.scanner.rule.ActiveRulesProvider.provide(ActiveRulesProvider.java:49)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at org.sonar.scanner.rule.DefaultActiveRulesLoader.load(DefaultActiveRulesLoader.java:52)
at org.sonar.scanner.rule.ActiveRulesProvider.load(ActiveRulesProvider.java:58)
at org.sonar.scanner.rule.ActiveRulesProvider.provide(ActiveRulesProvider.java:49)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
##[error]at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)
at org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:39)
at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:113)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:50)
... 50 more
Caused by: com.sonarsource.scanner.engine.webapi.client.HttpException: Error 404 on https://api.sonarcloud.io/analysis/active-rules?organization=+***-cloud-key-a42w31&project=project-name :
at com.sonarsource.scanner.engine.webapi.client.BaseResponse.failIfNotSuccessful(BaseResponse.java:22)
at org.sonar.scanner.http.DefaultScannerWsClient.failIfUnauthorized(DefaultScannerWsClient.java:82)
at org.sonar.scanner.http.DefaultScannerWsClient.call(DefaultScannerWsClient.java:55)
at org.sonar.scanner.rule.DefaultActiveRulesLoader.load(DefaultActiveRulesLoader.java:48)
... 67 more
Thanks for the updated error log. Iâve moved this to the thread I split off about errors from having + prepended to the org id. Weâre actively working on this.