Error: Not Authorized, but only for pull requests. Other scans successful

Template for a good new topic, formatted with Markdown:

  • ALM used: Azure DevOps
  • CI system used: Azure DevOps
  • Scanner command used when applicable: N/A using Azure DevOps connector
  • Languages of the repository: C#

This was working before, don’t know if something changed on sonar cloud?
The analyze task is successful for branch builds, both master and non master branches. The scan for the PR’s fail with the noted error about authorization.
How can we drill further for specific root cause ? How could some scans be authorized and some not ?
All the scans mentioned are for the same repository.

Errors from log appended at end.

Thanks,
Tyrone
2021-01-14T21:18:24.2947766Z ##[error]21:18:24.292 ERROR: Error during SonarScanner execution
2021-01-14T21:18:24.2949327Z 21:18:24.292 ERROR: Error during SonarScanner execution
2021-01-14T21:18:24.2953886Z ##[error]java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore
2021-01-14T21:18:24.2955461Z java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore
2021-01-14T21:18:24.2988769Z ##[error]at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:52)
2021-01-14T21:18:24.3009435Z at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:52)
2021-01-14T21:18:24.3012735Z ##[error]at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
2021-01-14T21:18:24.3014411Z at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
2021-01-14T21:18:24.3016621Z at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
2021-01-14T21:18:24.3017374Z at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
2021-01-14T21:18:24.3019549Z ##[error]at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
2021-01-14T21:18:24.3020883Z at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
2021-01-14T21:18:24.3021408Z at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
2021-01-14T21:18:24.3023405Z ##[error]at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
2021-01-14T21:18:24.3024703Z at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
2021-01-14T21:18:24.3025191Z at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
2021-01-14T21:18:24.3026213Z ##[error]at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
2021-01-14T21:18:24.3027140Z at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
2021-01-14T21:18:24.3028496Z ##[error]at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
2021-01-14T21:18:24.3038861Z at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
2021-01-14T21:18:24.3039731Z ##[error]at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
2021-01-14T21:18:24.3040443Z at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
2021-01-14T21:18:24.3041099Z ##[error]at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
2021-01-14T21:18:24.3041696Z at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
2021-01-14T21:18:24.3042430Z ##[error]at org.picocontainer.DefaultPicoContainer.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1034)
2021-01-14T21:18:24.3043141Z at org.picocontainer.DefaultPicoContainer.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1034)
2021-01-14T21:18:24.3044179Z ##[error]at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1026)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1003)
2021-01-14T21:18:24.3044981Z at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1026)
2021-01-14T21:18:24.3045380Z at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1003)
2021-01-14T21:18:24.3046833Z ##[error]at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:122)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:126)
2021-01-14T21:18:24.3048047Z at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
2021-01-14T21:18:24.3048538Z at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:122)
2021-01-14T21:18:24.3048943Z at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
2021-01-14T21:18:24.3049357Z at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:126)
2021-01-14T21:18:24.3053772Z ##[error]at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52)
at org.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 org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
2021-01-14T21:18:24.3056599Z at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
2021-01-14T21:18:24.3057004Z at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
2021-01-14T21:18:24.3057419Z at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58)
2021-01-14T21:18:24.3057742Z at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52)
2021-01-14T21:18:24.3058103Z at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
2021-01-14T21:18:24.3058732Z at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2021-01-14T21:18:24.3059077Z at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2021-01-14T21:18:24.3059503Z at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2021-01-14T21:18:24.3059850Z at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2021-01-14T21:18:24.3060210Z at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
2021-01-14T21:18:24.3060522Z at com.sun.proxy.$Proxy0.execute(Unknown Source)
2021-01-14T21:18:24.3060806Z at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
2021-01-14T21:18:24.3061179Z at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
2021-01-14T21:18:24.3061485Z at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
2021-01-14T21:18:24.3061781Z at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
2021-01-14T21:18:24.3062048Z at org.sonarsource.scanner.cli.Main.main(Main.java:61)
2021-01-14T21:18:24.3063139Z ##[error]Caused by: java.lang.IllegalStateException: Unable to load component interface org.sonar.scanner.scan.branch.BranchConfiguration
2021-01-14T21:18:24.3064572Z Caused by: java.lang.IllegalStateException: Unable to load component interface org.sonar.scanner.scan.branch.BranchConfiguration
2021-01-14T21:18:24.3065679Z ##[error]at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:52)
2021-01-14T21:18:24.3066643Z at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:52)
2021-01-14T21:18:24.3067566Z ##[error]at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
2021-01-14T21:18:24.3068230Z at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
2021-01-14T21:18:24.3069119Z ##[error]at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
2021-01-14T21:18:24.3069868Z at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
2021-01-14T21:18:24.3070940Z ##[error]at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
2021-01-14T21:18:24.3071605Z at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
2021-01-14T21:18:24.3072435Z ##[error]at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
2021-01-14T21:18:24.3073127Z at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
2021-01-14T21:18:24.3076935Z ##[error]at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
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)
… 34 more
Caused by: Not authorized. Please check the properties sonar.login and sonar.password.
2021-01-14T21:18:24.3079478Z at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
2021-01-14T21:18:24.3079922Z at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
2021-01-14T21:18:24.3080328Z at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
2021-01-14T21:18:24.3080781Z at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
2021-01-14T21:18:24.3081229Z at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
2021-01-14T21:18:24.3081869Z at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
2021-01-14T21:18:24.3082239Z at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
2021-01-14T21:18:24.3082614Z at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
2021-01-14T21:18:24.3082981Z at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
2021-01-14T21:18:24.3083415Z at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:50)
2021-01-14T21:18:24.3083706Z … 34 more
2021-01-14T21:18:24.3083951Z Caused by: Not authorized. Please check the properties sonar.login and sonar.password.
2021-01-14T21:18:24.4006735Z Process returned exit code 1

Hi @trexx00

Is that possible for you to share the full log of a PR analysis, with debug mode enabled ? I can PM you for that if needed.

I need to see where it’s failing exactly.

Thanks !

OK, Will do. I thought that what I included was full. It is the full output for the Analyze step.
The language of the error has changes a bit, though I’ve not changed the scan parameters. I suspect the same root cause of access.
So Please PM me and I’ll send the full content.

Thank you.

We are experiencing the exact same symptoms since yesterday (2021-02-17) around 15 CET. Was there any solution to this?

  • Our setup: Azure DevOps with the sonarcloud extension, using service connection for auth.
  • Works just fine for manually triggered jobs in azure, but fails for auto-triggered PR builds
  • Sonar analyze step fails with the logg below (note that the "Load branch configuration does not complete)

Log:

Hi,
No solution yet. Still working with @mickaelcaro to resolve it. More clues still needed.
The error language change was what it was no longer finding the pull request id’s. That happened with no changes to the pipelines.