Disable Pull Request Analysis

We’ve been using Sonar in a very simple way at the tail end of CircleCi:

sonar-scanner -D sonar.login=$SONAR_KEY

However today, one of my projects started complaining:

INFO: Load project pull requests
INFO: Load project pull requests (done) | time=111ms
INFO: Load branch configuration
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 23.845s
INFO: Final Memory: 7M/336M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Parameter 'sonar.pullrequest.key' is mandatory for a pull request analysis

Is there a way to disable Pull Request Analysis? I never enabled this feature in the first place, and see no options in SonarCloud for this.

I did manage to get Sonar to actually do Pull Request Analysis with:

sonar-scanner \
            -Dsonar.login=$SONAR_KEY \
            -Dsonar.pullrequest.key=${CIRCLE_PULL_REQUEST##*/} \
            -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} \
            -Dsonar.pullrequest.provider=GitHub \
            -Dsonar.pullrequest.base=master \
            -Dsonar.github.repository=${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}

However not every commit is via a PR – sometimes a tiny change is committed directly to a branch and that causes Sonar to error out and then CircleCi fails.

Thanks!

1 Like

Hi Clark,

Sorry for the late response. You are right, just running

sonar-scanner -Dsonar.login=$SONAR_KEY

should be enough. Could you share the full logs so we can investigate more?

Preferably while debug logs are activated:

sonar-scanner -X -Dsonar.login=$SONAR_KEY

Thanks,
Tom

1 Like

This started when were using sonar-scanner-cli-4.0.0.1744-linux.zip. In debugging this, I changed to sonar-scanner-cli-4.2.0.1873-linux.zip but the issue persisted.

My workaround was as follows – functional, but ugly:

if [ -z "${CIRCLE_PULL_REQUEST##*/}" ]
            then
              echo "Running Sonar..."
              sonar-scanner -X -Dsonar.login=${SONAR_KEY}
            else
              echo "Running Sonar PR analysis..."
              sonar-scanner -X \
                -Dsonar.login=$SONAR_KEY \
                -Dsonar.pullrequest.key=${CIRCLE_PULL_REQUEST##*/} \
                -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} \
                -Dsonar.pullrequest.provider=GitHub \
                -Dsonar.pullrequest.base=master \
                -Dsonar.github.repository=${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}
            fi

Regardless, I just re-ran this to grab the logs you requested and it magically succeeded. This has been doing this for at least 2 weeks and across multiple projects of ours.

That is weird, but I’m glad it is working as expected now.

We recently added detection of CircleCi environment variables in the scanner itself, so your workaround should not have been necessary. The scanner contains that logic.

Could you share the logs of a past job that failed with ERROR: Parameter 'sonar.pullrequest.key' is mandatory for a pull request analysis ? I will have a look to see what was going on.

Thanks,
Tom

I think this is one:

Running Sonar PR analysis...
16:41:38.033 INFO: Scanner configuration file: /home/circleci/repo/sonar-scanner-4.2.0.1873-linux/conf/sonar-scanner.properties
16:41:38.035 INFO: Project root configuration file: /home/circleci/repo/sonar-project.properties
16:41:38.062 INFO: SonarQube Scanner 4.2.0.1873
16:41:38.062 INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
16:41:38.062 INFO: Linux 4.15.0-1043-aws amd64
16:41:38.192 DEBUG: keyStore is : 
16:41:38.192 DEBUG: keyStore type is : pkcs12
16:41:38.192 DEBUG: keyStore provider is : 
16:41:38.192 DEBUG: init keystore
16:41:38.193 DEBUG: init keymanager of type SunX509
16:41:38.308 DEBUG: Create: /home/circleci/.sonar/cache
16:41:38.310 INFO: User cache: /home/circleci/.sonar/cache
16:41:38.311 DEBUG: Create: /home/circleci/.sonar/cache/_tmp
16:41:38.314 DEBUG: Extract sonar-scanner-api-batch in temp...
16:41:38.317 DEBUG: Get bootstrap index...
16:41:38.317 DEBUG: Download: https://sonarcloud.io/batch/index
16:41:39.044 DEBUG: Get bootstrap completed
16:41:39.049 DEBUG: Download https://sonarcloud.io/batch/file?name=scanner-sonarcloud-8.0.0.1404-all.jar to /home/circleci/.sonar/cache/_tmp/fileCache18227990706437697369.tmp
16:41:41.459 DEBUG: Create isolated classloader...
16:41:41.466 DEBUG: Start temp cleaning...
16:41:41.468 DEBUG: Temp cleaning done
16:41:41.469 DEBUG: Execution getVersion
16:41:41.474 INFO: SonarQube server 8.0.0
16:41:41.475 INFO: Default locale: "en", source code encoding: "UTF-8" (analysis is platform dependent)
16:41:41.475 DEBUG: Work directory: /home/circleci/repo/.scannerwork
16:41:41.476 DEBUG: Execution execute
16:41:41.662 DEBUG: SonarCloud 8.0.0.1404
16:41:41.737 INFO: Load global settings
16:41:42.336 DEBUG: GET 200 https://sonarcloud.io/api/settings/values.protobuf | time=598ms
16:41:42.363 INFO: Load global settings (done) | time=627ms
16:41:42.367 INFO: Server id: 74E9293D-AWHW8ct9-T_TB3XqouNu
16:41:42.369 DEBUG: Create : /home/circleci/.sonar/_tmp
16:41:42.370 INFO: User cache: /home/circleci/.sonar/cache
16:41:42.372 INFO: Load/download plugins
16:41:42.373 INFO: Load plugins index
16:41:42.465 DEBUG: GET 200 https://sonarcloud.io/api/plugins/installed | time=92ms
16:41:42.495 INFO: Load plugins index (done) | time=122ms
16:41:42.496 DEBUG: Download plugin 'scmgit' to '/home/circleci/.sonar/_tmp/fileCache6099004103851738425.tmp'
16:41:42.610 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=scmgit&acceptCompressions=pack200 | time=114ms
16:41:43.141 DEBUG: Unpacking plugin scmgit
16:41:43.567 DEBUG: Download plugin 'jacoco' to '/home/circleci/.sonar/_tmp/fileCache17517831712681183100.tmp'
16:41:43.658 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=jacoco&acceptCompressions=pack200 | time=90ms
16:41:43.659 DEBUG: Unpacking plugin jacoco
16:41:43.665 DEBUG: Download plugin 'license' to '/home/circleci/.sonar/_tmp/fileCache17051282970346467055.tmp'
16:41:43.758 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=license&acceptCompressions=pack200 | time=93ms
16:41:43.758 DEBUG: Unpacking plugin license
16:41:43.763 DEBUG: Download plugin 'scmmercurial' to '/home/circleci/.sonar/_tmp/fileCache17155084111145652448.tmp'
16:41:43.857 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=scmmercurial&acceptCompressions=pack200 | time=94ms
16:41:43.857 DEBUG: Unpacking plugin scmmercurial
16:41:43.863 DEBUG: Download plugin 'abap' to '/home/circleci/.sonar/_tmp/fileCache1808519399856332530.tmp'
16:41:43.954 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=abap&acceptCompressions=pack200 | time=91ms
16:41:43.968 DEBUG: Unpacking plugin abap
16:41:44.144 DEBUG: Download plugin 'sonarapex' to '/home/circleci/.sonar/_tmp/fileCache3175061085914132503.tmp'
16:41:44.240 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=sonarapex&acceptCompressions=pack200 | time=95ms
16:41:44.340 DEBUG: Unpacking plugin sonarapex
16:41:44.872 DEBUG: Download plugin 'csharp' to '/home/circleci/.sonar/_tmp/fileCache16179686043005203642.tmp'
16:41:44.967 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=csharp&acceptCompressions=pack200 | time=95ms
16:41:45.061 DEBUG: Unpacking plugin csharp
16:41:45.441 DEBUG: Download plugin 'cpp' to '/home/circleci/.sonar/_tmp/fileCache8027402770178444121.tmp'
16:41:45.534 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=cpp&acceptCompressions=pack200 | time=93ms
16:41:47.112 DEBUG: Unpacking plugin cpp
16:41:48.208 DEBUG: Download plugin 'cobol' to '/home/circleci/.sonar/_tmp/fileCache10110072003815517357.tmp'
16:41:48.300 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=cobol&acceptCompressions=pack200 | time=91ms
16:41:48.313 DEBUG: Unpacking plugin cobol
16:41:48.665 DEBUG: Download plugin 'cssfamily' to '/home/circleci/.sonar/_tmp/fileCache339934568681044990.tmp'
16:41:48.761 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=cssfamily&acceptCompressions=pack200 | time=95ms
16:41:49.130 DEBUG: Unpacking plugin cssfamily
16:41:49.540 DEBUG: Download plugin 'flex' to '/home/circleci/.sonar/_tmp/fileCache10886490432485920104.tmp'
16:41:49.633 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=flex&acceptCompressions=pack200 | time=93ms
16:41:49.637 DEBUG: Unpacking plugin flex
16:41:49.798 DEBUG: Download plugin 'go' to '/home/circleci/.sonar/_tmp/fileCache16811208631876661182.tmp'
16:41:49.891 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=go&acceptCompressions=pack200 | time=93ms
16:41:50.178 DEBUG: Unpacking plugin go
16:41:51.036 DEBUG: Download plugin 'web' to '/home/circleci/.sonar/_tmp/fileCache15584807170473701840.tmp'
16:41:51.126 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=web&acceptCompressions=pack200 | time=90ms
16:41:51.129 DEBUG: Unpacking plugin web
16:41:51.224 DEBUG: Download plugin 'javascript' to '/home/circleci/.sonar/_tmp/fileCache17505837624206673174.tmp'
16:41:51.320 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=javascript&acceptCompressions=pack200 | time=95ms
16:41:51.516 DEBUG: Unpacking plugin javascript
16:41:52.119 DEBUG: Download plugin 'java' to '/home/circleci/.sonar/_tmp/fileCache4860003099836314876.tmp'
16:41:52.212 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=java&acceptCompressions=pack200 | time=93ms
16:41:52.310 DEBUG: Unpacking plugin java
16:41:53.323 DEBUG: Download plugin 'kotlin' to '/home/circleci/.sonar/_tmp/fileCache2112723663629579761.tmp'
16:41:53.417 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=kotlin&acceptCompressions=pack200 | time=93ms
16:41:53.522 DEBUG: Unpacking plugin kotlin
16:41:54.415 DEBUG: Download plugin 'php' to '/home/circleci/.sonar/_tmp/fileCache5157374836021756464.tmp'
16:41:54.506 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=php&acceptCompressions=pack200 | time=90ms
16:41:54.540 DEBUG: Unpacking plugin php
16:41:55.154 DEBUG: Download plugin 'plsql' to '/home/circleci/.sonar/_tmp/fileCache12936899220315354312.tmp'
16:41:55.245 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=plsql&acceptCompressions=pack200 | time=90ms
16:41:55.253 DEBUG: Unpacking plugin plsql
16:41:55.531 DEBUG: Download plugin 'python' to '/home/circleci/.sonar/_tmp/fileCache4749145574458572420.tmp'
16:41:55.624 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=python&acceptCompressions=pack200 | time=93ms
16:41:55.637 DEBUG: Unpacking plugin python
16:41:56.000 DEBUG: Download plugin 'ruby' to '/home/circleci/.sonar/_tmp/fileCache6028232249616652271.tmp'
16:41:56.091 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=ruby&acceptCompressions=pack200 | time=91ms
16:41:56.195 DEBUG: Unpacking plugin ruby
16:41:57.547 DEBUG: Download plugin 'sonarscala' to '/home/circleci/.sonar/_tmp/fileCache16319418944367850314.tmp'
16:41:57.638 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=sonarscala&acceptCompressions=pack200 | time=91ms
16:41:58.195 DEBUG: Unpacking plugin sonarscala
16:41:59.704 DEBUG: Download plugin 'swift' to '/home/circleci/.sonar/_tmp/fileCache9291846351551861182.tmp'
16:41:59.797 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=swift&acceptCompressions=pack200 | time=93ms
16:41:59.808 DEBUG: Unpacking plugin swift
16:42:00.088 DEBUG: Download plugin 'typescript' to '/home/circleci/.sonar/_tmp/fileCache1333995024879215848.tmp'
16:42:00.180 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=typescript&acceptCompressions=pack200 | time=92ms
16:42:00.275 DEBUG: Unpacking plugin typescript
16:42:00.408 DEBUG: Download plugin 'tsql' to '/home/circleci/.sonar/_tmp/fileCache6446058814974592978.tmp'
16:42:00.516 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=tsql&acceptCompressions=pack200 | time=108ms
16:42:00.527 DEBUG: Unpacking plugin tsql
16:42:00.790 DEBUG: Download plugin 'vbnet' to '/home/circleci/.sonar/_tmp/fileCache5130653388525892350.tmp'
16:42:00.881 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=vbnet&acceptCompressions=pack200 | time=91ms
16:42:00.899 DEBUG: Unpacking plugin vbnet
16:42:01.310 DEBUG: Download plugin 'xml' to '/home/circleci/.sonar/_tmp/fileCache235720412920678468.tmp'
16:42:01.403 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=xml&acceptCompressions=pack200 | time=93ms
16:42:01.412 DEBUG: Unpacking plugin xml
16:42:01.666 DEBUG: Download plugin 'security' to '/home/circleci/.sonar/_tmp/fileCache2780757325631536792.tmp'
16:42:01.757 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=security&acceptCompressions=pack200 | time=91ms
16:42:01.770 DEBUG: Unpacking plugin security
16:42:02.001 DEBUG: Download plugin 'securitycsharpfrontend' to '/home/circleci/.sonar/_tmp/fileCache17626010709973268244.tmp'
16:42:02.094 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=securitycsharpfrontend&acceptCompressions=pack200 | time=93ms
16:42:02.287 DEBUG: Unpacking plugin securitycsharpfrontend
16:42:02.433 DEBUG: Download plugin 'securityjavafrontend' to '/home/circleci/.sonar/_tmp/fileCache13644152870711743639.tmp'
16:42:02.527 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=securityjavafrontend&acceptCompressions=pack200 | time=94ms
16:42:02.623 DEBUG: Unpacking plugin securityjavafrontend
16:42:02.699 DEBUG: Download plugin 'securityphpfrontend' to '/home/circleci/.sonar/_tmp/fileCache11943388529479366386.tmp'
16:42:02.799 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=securityphpfrontend&acceptCompressions=pack200 | time=99ms
16:42:02.894 DEBUG: Unpacking plugin securityphpfrontend
16:42:02.983 INFO: Load/download plugins (done) | time=20611ms
16:42:03.176 DEBUG: Plugins:
16:42:03.176 DEBUG:   * SonarCSS 1.1.1.1010 (cssfamily)
16:42:03.176 DEBUG:   * SonarPLSQL 3.4.1.2576 (plsql)
16:42:03.176 DEBUG:   * SonarScala 1.7.0.883 (sonarscala)
16:42:03.176 DEBUG:   * SonarC# 7.17.0.9346 (csharp)
16:42:03.176 DEBUG:   * Vulnerability Analysis 8.0.0-M1.5391 (security)
16:42:03.176 DEBUG:   * SonarJava 5.14.0.18788 (java)
16:42:03.176 DEBUG:   * SonarHTML 3.2.0.2082 (web)
16:42:03.176 DEBUG:   * SonarFlex 2.5.1.1831 (flex)
16:42:03.176 DEBUG:   * SonarXML 2.0.1.2020 (xml)
16:42:03.176 DEBUG:   * SonarTS 2.0.0.4283 (typescript)
16:42:03.176 DEBUG:   * SonarVB 7.17.0.9346 (vbnet)
16:42:03.176 DEBUG:   * SonarSwift 4.1.0.3087 (swift)
16:42:03.176 DEBUG:   * SonarCFamily 6.4.0.11646 (cpp)
16:42:03.176 DEBUG:   * SonarPython 1.16.0.4432 (python)
16:42:03.176 DEBUG:   * JaCoCo 1.0.2.475 (jacoco)
16:42:03.176 DEBUG:   * Mercurial 1.1.2 (scmmercurial)
16:42:03.176 DEBUG:   * SonarGo 1.7.0.883 (go)
16:42:03.176 DEBUG:   * SonarKotlin 1.7.0.883 (kotlin)
16:42:03.177 DEBUG:   * SonarTSQL 1.4.0.3334 (tsql)
16:42:03.177 DEBUG:   * SonarApex 1.7.0.883 (sonarapex)
16:42:03.177 DEBUG:   * SonarJS 6.0.0.9595 (javascript)
16:42:03.177 DEBUG:   * SonarRuby 1.7.0.883 (ruby)
16:42:03.177 DEBUG:   * Vulnerability Rules for C# 8.0.0-M1.5391 (securitycsharpfrontend)
16:42:03.177 DEBUG:   * Vulnerability Rules for Java 8.0.0-M1.5391 (securityjavafrontend)
16:42:03.177 DEBUG:   * License for SonarLint 8.0.0.1404 (license)
16:42:03.177 DEBUG:   * SonarCOBOL 4.4.0.3403 (cobol)
16:42:03.177 DEBUG:   * Git 1.10.0.1876 (scmgit)
16:42:03.177 DEBUG:   * SonarPHP 3.2.0.4868 (php)
16:42:03.177 DEBUG:   * SonarABAP 3.8.0.2034 (abap)
16:42:03.177 DEBUG:   * Vulnerability Rules for PHP 8.0.0-M1.5391 (securityphpfrontend)
16:42:03.197 INFO: Loaded core extensions: developer-scanner
16:42:03.216 DEBUG: Installed core extension: developer-scanner
16:42:03.627 INFO: Process project properties
16:42:03.632 DEBUG: Process project properties (done) | time=5ms
16:42:03.632 INFO: Execute project builders
16:42:03.632 DEBUG: Execute project builder: org.sonar.plugins.csharp.CSharpGlobalProtobufFileProcessor
16:42:03.634 DEBUG: Execute project builder: org.sonar.plugins.vbnet.VbNetGlobalProtobufFileProcessor
16:42:03.635 INFO: Execute project builders (done) | time=3ms
16:42:03.637 INFO: Project key: lead-out-app-service
16:42:03.637 INFO: Base dir: /home/circleci/repo
16:42:03.637 INFO: Working dir: /home/circleci/repo/.scannerwork
16:42:03.637 DEBUG: Project global encoding: UTF-8, default locale: en
16:42:03.638 DEBUG: Creating module hierarchy
16:42:03.638 DEBUG:   Init module 'lead-out-app-service'
16:42:03.638 DEBUG:     Base dir: /home/circleci/repo
16:42:03.638 DEBUG:     Working dir: /home/circleci/repo/.scannerwork
16:42:03.639 DEBUG:     Module global encoding: UTF-8, default locale: en
16:42:03.641 INFO: Load project settings for component key: 'lead-out-app-service'
16:42:03.782 DEBUG: GET 200 https://sonarcloud.io/api/settings/values.protobuf?component=lead-out-app-service | time=141ms
16:42:03.783 INFO: Load project settings for component key: 'lead-out-app-service' (done) | time=142ms
16:42:03.830 INFO: Load project branches
16:42:03.925 DEBUG: GET 200 https://sonarcloud.io/api/project_branches/list?project=lead-out-app-service | time=95ms
16:42:03.931 INFO: Load project branches (done) | time=101ms
16:42:03.933 INFO: Load projects for organization 'specialized'
16:42:06.565 DEBUG: GET 200 https://sonarcloud.io/api/alm_integration/list_repositories?organization=specialized | time=2632ms
16:42:06.571 INFO: Load projects for organization 'specialized' (done) | time=2638ms
16:42:06.573 INFO: Load project pull requests
16:42:06.677 DEBUG: GET 200 https://sonarcloud.io/api/project_pull_requests/list?project=lead-out-app-service | time=103ms
16:42:06.680 INFO: Load project pull requests (done) | time=107ms
16:42:06.681 INFO: Load branch configuration
16:42:06.682 DEBUG: Found manual configuration of branch/PR analysis. Skipping automatic configuration.
16:42:06.688 INFO: ------------------------------------------------------------------------
16:42:06.688 INFO: EXECUTION FAILURE
16:42:06.688 INFO: ------------------------------------------------------------------------
16:42:06.688 INFO: Total time: 28.672s
16:42:06.729 INFO: Final Memory: 7M/280M
16:42:06.729 INFO: ------------------------------------------------------------------------
16:42:06.729 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore
	at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
	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)
	at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
	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.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1034)
	at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1026)
	at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1003)
	at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
	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(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	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)
Caused by: java.lang.IllegalStateException: Unable to load component interface org.sonar.scanner.scan.branch.BranchConfiguration
	at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
	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)
	at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
	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:63)
	... 34 more
Caused by: Parameter 'sonar.pullrequest.key' is mandatory for a pull request analysis
Exited with code 1

Hi Clark,

What I can deduce from this line

Found manual configuration of branch/PR analysis. Skipping automatic configuration.

in the logs is that a sonar.branch or sonar.pullrequest property was set somewhere. In your case (running on CircleCi) you can omit all manual configuration.

Please let me know if the issue ever returns, I would be glad to take another look.

Tom

Will do. And I am not sure what to say as we’ve never used that feature, ever, I assure you those properties have not ever been set. Plus, it’s a bit odd that this started happening on multiple projects of ours all at the same time.

Is there anything in our cloud account that controls/relates to this? Could someone have ticked a box somewhere to enable this feature? I looked around and didn’t find anything.

Thanks for taking a look.

Yes you are right, and that does warrant some extra investigation.
Could you share the content of your sonar-project.properties file?

The last log file you shared starts with Running Sonar PR analysis..., this means that it was using your workaround that supplied some sonar.pullrequest properties. Would it be possible to share the full logs of the first failure you encountered 15 days ago?

No there is no way to disable/enable this behaviour in the UI.

Thanks,
Tom

sonar.projectKey=myapp
sonar.host.url=https://sonarcloud.io
sonar.organization=mycompany
# sonar.login=${SONAR_KEY}
sonar.sources=app
sonar.exclusions=app/assets/**/*,app/controllers/admin/**/*,app/controllers/debug/**/*,app/views/**/*

And then it was run in Circle with command in my initial post. Which was not with the debug flag and so the output is as I pasted in my first message (not terribly helpful).

Regardless, the problem has gone away. I’ll re-post here if it crops up again. I’ll go back and enable this on some of the other apps and see what happens.