AYyMxs5nSh50RW6yOlXY

We have a project which was imported in 2022 from github. We since changed the default branch and continued using the github actions for scanning feature branches. I have now updated the default branch in Sonarcloud, but this just continues to show a message “not computed” and does not provide a way for the default branch to be re-scanned. There is the code displayed above where it states the analysis failed. Your help would be appreciated.

Hi @amura

All my apologies - I realized that while this thread made its way to my team, with the holidays in the middle, no one answered you.

We are actively investigating this issue.
From the first elements, it seems related to the change of the default branch.

To investigate further, I would need a few more elements from you.

  1. Could you give me a screenshot of the Branches page of your project on SonarCloud? This one: https://sonarcloud.io/project/branches_list?id=<your-project-key>

  2. Could you give me the name of the default branch in GitHub and the name of the previous default branch?

  3. And to finish, could you clarify which analysis method you are using? You mention GitHub Actions, and I have conflicting evidence on my side, so I would like to be sure to understand how you run the SonarScanner - or maybe are you using Automatic Analysis?
    You can check if Automatic analysis is enabled on SonarCloud, on this page:
    https://sonarcloud.io/project/analysis_method?id=<your-project-key>

Thanks in advance,
Claire

Hi Claire,

I have since moved on from the last position and attempted to delete the project and re-import this back in to sonarcloud. So the following is the situation now.

*I deleted the project from sonarcloud, and re-imported this again. I am seeing the attached screen shot when I go to the page. Everything it disabled and I am unable to click on branches.

  • The default branch is “release”. The previous default should have been “master”.
  • I don’t seem to be authorized to access that page showing the analysis method. We have a github action that runs with PRs and within the repository we have the project key setup to match what is shown in sonarcloud.

Thanks for getting back to me.

Now that you re-created the project, the branch inconsistency should have disappeared.

Under the Administration menu at the bottom of the left bar, do you have the “Analysis method” menu?
And under that same Administration menu, do you have the Background Tasks menu, and would you be able to post here the ID of one of the tasks for the main branch?

Also, on the main branch of your project, how is the Sonar Scanner launched? Also a Github action? Could you give me the logs of the execution?

Hi Claire,
Under the project > administration menu option, I only see Quality profiles and Quality gates. No analysis method menu or Background tasks menu.

On the main branch (release), the github action is running and producing the following logs (project key matches what is shown on information menu):

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

INFO: Project root configuration file: /github/workspace/sonar-project.properties

INFO: SonarScanner 5.0.1.3006

INFO: Java 17.0.8 Alpine (64-bit)

INFO: Linux 6.2.0-1018-azure amd64

INFO: User cache: /opt/sonar-scanner/.sonar/cache

INFO: Analyzing on SonarCloud

INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)

INFO: Load global settings

INFO: Load global settings (done) | time=467ms

INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu

INFO: User cache: /opt/sonar-scanner/.sonar/cache

INFO: Loading required plugins

INFO: Load plugins index

INFO: Load plugins index (done) | time=362ms

INFO: Load/download plugins

INFO: Load/download plugins (done) | time=1096ms

INFO: Found an active CI vendor: 'Github Actions'

INFO: Load project settings for component key: '<project key>'

INFO: Process project properties

INFO: Project key: <project key>

INFO: Base dir: /github/workspace

INFO: Working dir: /github/workspace/.scannerwork

INFO: Load project branches

INFO: Load project branches (done) | time=360ms

INFO: Check ALM binding of project '<project key>'

INFO: Detected project binding: NONEXISTENT

INFO: Check ALM binding of project '<project key>' (done) | time=348ms

INFO: Load project pull requests

INFO: Load project pull requests (done) | time=329ms

INFO: Load branch configuration

INFO: Github event: pull_request

INFO: Auto-configuring pull request 6891

INFO: ------------------------------------------------------------------------

INFO: EXECUTION FAILURE

INFO: ------------------------------------------------------------------------

INFO: Total time: 7.542s

ERROR: Error during SonarScanner execution

INFO: Final Memory: 9M/37M

INFO: ------------------------------------------------------------------------

ERROR: Could not find a default branch for project with key '<project key>'. Make sure project exists.

ERROR:

ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

Thanks for the logs!

I see those lines that seem highly suspicious to me:

INFO: Github event: pull_request
INFO: Auto-configuring pull request 6891

If I understand correctly, those logs come from the analysis of the release branch, which should be the default branch of your project.
This branch should be analyzed as a long branch, not as a pull request.

I think there is a flaw in the GitHub Action triggers, that triggers on the release branch as a Pull Request and not as a branch. On long branches, the trigger should be on push, not on pull request.

I suggest to have a look at your GitHub Action configuration and to follow one of our in product tutorials or documentation to configure it.

Once the release branch is analyzed successfully and displayed on SonarCloud, you’ll have to adjust 2 things in the configuration on the Branches page:

1/ On the top-right corner, adjust the long-lived branches pattern to match what are the long branches on your project (in opposition of short-lived branches and pull requests).

2/ If necessary, rename the Main Branch to release to match your repository configuration.

Hope that helps,
Claire

Hi Claire,

Thank you so much for. your assistance. I will look into the issues you highlighted and let you know if I have any more problems. This has been very helpful.

Allan

Hi Claire

In the process of updating the github action to ensure it only runs sonar cloud on push to release branch, I also realised that indeed the action also ran as expected (push on release). The following is the log from this action. So from your description I would have expected that release branch to have been analyzed.


Run sonarsource/sonarcloud-github-action@master

/usr/bin/docker run --name d667b8bb4ce1c5904d5cae52178aa5adb3d5_a032ee --label 62d667 --workdir /github/workspace --rm -e "SONAR_TOKEN" -e "GITHUB_TOKEN" -e "INPUT_ARGS" -e "INPUT_PROJECTBASEDIR" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true --entrypoint "/entrypoint.sh" -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/puk-portal/puk-portal":"/github/workspace" 62d667:b8bb4ce1c5904d5cae52178aa5adb3d5

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

INFO: Project root configuration file: /github/workspace/sonar-project.properties

INFO: SonarScanner 5.0.1.3006

INFO: Java 17.0.8 Alpine (64-bit)

INFO: Linux 6.2.0-1018-azure amd64

INFO: User cache: /opt/sonar-scanner/.sonar/cache

INFO: Analyzing on SonarCloud

INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)

INFO: Load global settings

INFO: Load global settings (done) | time=282ms

INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu

INFO: User cache: /opt/sonar-scanner/.sonar/cache

INFO: Loading required plugins

INFO: Load plugins index

INFO: Load plugins index (done) | time=252ms

INFO: Load/download plugins

INFO: Load/download plugins (done) | time=1255ms

INFO: Found an active CI vendor: 'Github Actions'

INFO: Load project settings for component key: '<project-key>'

INFO: Process project properties

INFO: Project key: <project-key>

INFO: Base dir: /github/workspace

INFO: Working dir: /github/workspace/.scannerwork

INFO: Load project branches

INFO: Load project branches (done) | time=446ms

INFO: Check ALM binding of project '<project-key>'

INFO: Detected project binding: NONEXISTENT

INFO: Check ALM binding of project '<project-key>' (done) | time=201ms

INFO: Load project pull requests

INFO: Load project pull requests (done) | time=196ms

INFO: Load branch configuration

INFO: Github event: push

INFO: Auto-configuring branch release

INFO: ------------------------------------------------------------------------

INFO: EXECUTION FAILURE

INFO: ------------------------------------------------------------------------

INFO: Total time: 5.853s

INFO: Final Memory: 9M/37M

INFO: ------------------------------------------------------------------------

ERROR: Error during SonarScanner execution

ERROR: Could not find a default branch for project with key '<project-key>'. Make sure project exists.

ERROR:

ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

Hi Claire

The github action has been updated and I believe everything is now setup as you suggested. Still the same status showing on our dashboard in sonarcloud where everything is disabled and just stuck with the message about the project being available when it’s been analyzed. Any guidance on this issue?

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

INFO: Project root configuration file: /github/workspace/sonar-project.properties

INFO: SonarScanner 5.0.1.3006

INFO: Java 17.0.8 Alpine (64-bit)

INFO: Linux 6.2.0-1018-azure amd64

INFO: User cache: /opt/sonar-scanner/.sonar/cache

INFO: Analyzing on SonarCloud

INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)

INFO: Load global settings

INFO: Load global settings (done) | time=383ms

INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu

INFO: User cache: /opt/sonar-scanner/.sonar/cache

INFO: Loading required plugins

INFO: Load plugins index

INFO: Load plugins index (done) | time=370ms

INFO: Load/download plugins

INFO: Load/download plugins (done) | time=1323ms

INFO: Found an active CI vendor: 'Github Actions'

INFO: Load project settings for component key: '<project key>'

INFO: Process project properties

INFO: Project key: <project key>

INFO: Base dir: /github/workspace

INFO: Working dir: /github/workspace/.scannerwork

INFO: Load project branches

INFO: Load project branches (done) | time=355ms

INFO: Check ALM binding of project '<project key>'

INFO: Detected project binding: NONEXISTENT

INFO: Check ALM binding of project '<project key>' (done) | time=334ms

INFO: Load project pull requests

INFO: Load project pull requests (done) | time=352ms

INFO: Load branch configuration

INFO: Github event: push

INFO: Auto-configuring branch release

INFO: ------------------------------------------------------------------------

INFO: EXECUTION FAILURE

INFO: ------------------------------------------------------------------------

INFO: Total time: 7.321s

INFO: Final Memory: 9M/37M

ERROR: Error during SonarScanner execution

ERROR: Could not find a default branch for project with key '<project key>'. Make sure project exists.

ERROR:

ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

INFO: ------------------------------------------------------------------------

On a newly created project, it is really surprising.
Could you double-check check the Project key is properly configured and correct?

Could you call this URL with your project key and post here the response, please?

https://sonarcloud.io/api/project_branches/list?project=

Could you also enable the debug logs and post here the complete result? Please use the Code formatting option to keep it readable.

To enable the debug logs, you can add this option to the action:

args: >
      -Dsonar.verbose=true

This is the response:
{“branches”:[{“name”:“release”,“isMain”:true,“type”:“LONG”,“status”:{“bugs”:0,“vulnerabilities”:0,“codeSmells”:0}}]}

I will queue up another build with the debug enabled and post the response here when it’s complete

Hi @amura

Did you have a chance to get the debug logs?
The response of the project_branches API is what I expected. This is good.

Just as a heads-up, I’ll be out of the office for the following week, so no response from me should be expected before Feb 13th.

Have a nice day,
Claire

Hi @Claire_Villard I will get that information over to you either later today or early tomorrow.

Thanks for getting back to me, and good day to you too.

Allan

@Claire_Villard details of last run as follows:

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

INFO: Project root configuration file: /github/workspace/sonar-project.properties

17:45:04.670 INFO: SonarScanner 5.0.1.3006

17:45:04.678 INFO: Java 17.0.8 Alpine (64-bit)

17:45:04.678 INFO: Linux 6.2.0-1019-azure amd64

17:45:04.818 DEBUG: keyStore is :

17:45:04.819 DEBUG: keyStore type is : pkcs12

17:45:04.819 DEBUG: keyStore provider is :

17:45:04.819 DEBUG: init keystore

17:45:04.819 DEBUG: init keymanager of type SunX509

17:45:04.926 DEBUG: Create: /opt/sonar-scanner/.sonar/cache

17:45:04.929 INFO: User cache: /opt/sonar-scanner/.sonar/cache

17:45:04.930 DEBUG: Create: /opt/sonar-scanner/.sonar/cache/_tmp

17:45:04.934 DEBUG: Extract sonar-scanner-api-batch in temp...

17:45:04.938 DEBUG: Get bootstrap index...

17:45:04.938 DEBUG: Download: https://sonarcloud.io/batch/index

17:45:05.480 DEBUG: Get bootstrap completed

17:45:05.483 DEBUG: Download https://sonarcloud.io/batch/file?name=scanner-sonarcloud-8.0.0.52441-all.jar to /opt/sonar-scanner/.sonar/cache/_tmp/fileCache39058579484378334.tmp

17:45:06.777 DEBUG: Create isolated classloader...

17:45:06.787 DEBUG: Start temp cleaning...

17:45:06.794 DEBUG: Temp cleaning done

17:45:06.794 INFO: Analyzing on SonarCloud

17:45:06.794 INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)

17:45:06.794 DEBUG: Work directory: /github/workspace/.scannerwork

17:45:06.795 DEBUG: Execution execute

17:45:07.048 DEBUG: Scanner max available memory: 1816133632

17:45:07.055 DEBUG: SonarCloud 10.3.0.1951

17:45:07.253 INFO: Load global settings

17:45:07.616 DEBUG: GET 200 https://sonarcloud.io/api/settings/values.protobuf | time=360ms

17:45:07.626 INFO: Load global settings (done) | time=373ms

17:45:07.630 INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu

17:45:07.637 DEBUG: Create : /opt/sonar-scanner/.sonar/_tmp

17:45:07.637 INFO: User cache: /opt/sonar-scanner/.sonar/cache

17:45:07.643 INFO: Loading required plugins

17:45:07.644 INFO: Load plugins index

17:45:07.923 DEBUG: GET 200 https://sonarcloud.io/api/plugins/installed | time=279ms

17:45:07.959 INFO: Load plugins index (done) | time=315ms

17:45:07.960 INFO: Load/download plugins

17:45:07.961 DEBUG: Download plugin 'iac' to '/opt/sonar-scanner/.sonar/_tmp/fileCache7218568443024934401.tmp'

17:45:08.056 DEBUG: GET 200 https://scanner.sonarcloud.io/plugins/iac/versions/2b35f8603fcd7ae8df5b9f9526f3c7cf.jar | time=95ms

17:45:08.303 DEBUG: Download plugin 'jacoco' to '/opt/sonar-scanner/.sonar/_tmp/fileCache8663487073375475149.tmp'

17:45:08.310 DEBUG: GET 200 https://scanner.sonarcloud.io/plugins/jacoco/versions/04bba36a445c3713a632aa358be2f99c.jar | time=7ms

17:45:08.312 DEBUG: Download plugin 'java' to '/opt/sonar-scanner/.sonar/_tmp/fileCache14682804595459592338.tmp'

17:45:08.319 DEBUG: GET 200 https://scanner.sonarcloud.io/plugins/java/versions/6fd8f23996fb5cd77ceb99668fec85fb.jar | time=6ms

17:45:08.562 DEBUG: Download plugin 'license' to '/opt/sonar-scanner/.sonar/_tmp/fileCache1375613607186718427.tmp'

17:45:08.568 DEBUG: GET 200 https://scanner.sonarcloud.io/plugins/license/versions/f74610eab75801c9c236ef881521ccb8.jar | time=6ms

17:45:08.571 DEBUG: Download plugin 'python' to '/opt/sonar-scanner/.sonar/_tmp/fileCache1951460785731833038.tmp'

17:45:08.579 DEBUG: GET 200 https://scanner.sonarcloud.io/plugins/python/versions/5f511b3bd768412fb7dad531eb8cbe98.jar | time=8ms

17:45:08.771 DEBUG: Download plugin 'text' to '/opt/sonar-scanner/.sonar/_tmp/fileCache9796593385596915008.tmp'

17:45:08.779 DEBUG: GET 200 https://scanner.sonarcloud.io/plugins/text/versions/bbbf271a293060d39ba3ef68fcc0496c.jar | time=7ms

17:45:08.860 DEBUG: Download plugin 'xml' to '/opt/sonar-scanner/.sonar/_tmp/fileCache7219953787562977063.tmp'

17:45:08.868 DEBUG: GET 200 https://scanner.sonarcloud.io/plugins/xml/versions/dc7530956473c81946456a4a3587ff22.jar | time=8ms

17:45:08.896 INFO: Load/download plugins (done) | time=936ms

17:45:08.897 DEBUG: Plugins not loaded because they are optional: [abap, sonarapex, csharp, cpp, cobol, dbd, dbdjavafrontend, dbdpythonfrontend, flex, go, web, javascript, kotlin, php, pli, plsql, rpg, ruby, sonarscala, swift, tsql, vbnet, vb, security, securitycsharpfrontend, securityjsfrontend, securityjavafrontend, securityphpfrontend, securitypythonfrontend]

17:45:08.936 DEBUG: Plugins loaded:

17:45:08.936 DEBUG: * License for SonarLint 8.0.0.52441 (license)

17:45:08.937 DEBUG: * Python Code Quality and Security 4.14.0.14263 (python)

17:45:08.937 DEBUG: * Java Code Quality and Security 7.29.0.34131 (java)

17:45:08.937 DEBUG: * XML Code Quality and Security 2.10.0.4108 (xml)

17:45:08.937 DEBUG: * JaCoCo 1.3.0.1538 (jacoco)

17:45:08.937 DEBUG: * IaC Code Quality and Security 1.26.0.8471 (iac)

17:45:08.938 DEBUG: * Text Code Quality and Security 2.8.0.1635 (text)

17:45:09.239 DEBUG: GET 200 https://sonarcloud.io/api/server/version | time=300ms

17:45:09.241 DEBUG: Updated analysis started with a difference of -98 milliseconds

17:45:09.251 DEBUG: Started at Thu Feb 01 17:45:07 GMT 2024

17:45:09.556 INFO: Found an active CI vendor: 'Github Actions'

17:45:09.567 INFO: Load project settings for component key: '<projectkey>'

17:45:09.843 DEBUG: GET 404 https://sonarcloud.io/api/settings/values.protobuf?component=<projectkey> | time=276ms

17:45:09.847 INFO: Process project properties

17:45:09.848 DEBUG: Process project properties (done) | time=1ms

17:45:09.851 INFO: Project key: <projectkey>

17:45:09.851 INFO: Base dir: /github/workspace

17:45:09.851 INFO: Working dir: /github/workspace/.scannerwork

17:45:09.851 DEBUG: Project global encoding: UTF-8, default locale: en_US

17:45:09.853 DEBUG: Creating module hierarchy

17:45:09.853 DEBUG: Init module '<projectkey>'

17:45:09.854 DEBUG: Base dir: /github/workspace

17:45:09.854 DEBUG: Working dir: /github/workspace/.scannerwork

17:45:09.854 DEBUG: Module global encoding: UTF-8, default locale: en_US

17:45:09.858 INFO: Load project branches

17:45:10.135 DEBUG: GET 404 https://sonarcloud.io/api/project_branches/list?project=<projectkey> | time=277ms

17:45:10.136 DEBUG: Could not process project branches - continuing without it

17:45:10.137 INFO: Load project branches (done) | time=279ms

17:45:10.141 INFO: Check ALM binding of project '<projectkey>'

17:45:10.417 DEBUG: GET 404 https://sonarcloud.io/api/alm_integration/is_project_bound?project=<projectkey> | time=275ms

17:45:10.419 INFO: Detected project binding: NONEXISTENT

17:45:10.419 INFO: Check ALM binding of project '<projectkey>' (done) | time=278ms

17:45:10.422 INFO: Load project pull requests

17:45:10.697 DEBUG: GET 404 https://sonarcloud.io/api/project_pull_requests/list?project=<projectkey> | time=274ms

17:45:10.697 DEBUG: Could not process project pull requests - continuing without it

17:45:10.700 INFO: Load project pull requests (done) | time=278ms

17:45:10.702 INFO: Load branch configuration

17:45:10.703 INFO: Github event: push

17:45:10.711 INFO: Auto-configuring branch release

17:45:10.718 INFO: ------------------------------------------------------------------------

17:45:10.718 INFO: EXECUTION FAILURE

17:45:10.719 INFO: ------------------------------------------------------------------------

17:45:10.720 INFO: Total time: 6.081s

17:45:10.775 INFO: Final Memory: 8M/37M

17:45:10.776 INFO: ------------------------------------------------------------------------

17:45:10.777 ERROR: Error during SonarScanner 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:52)

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:122)

at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)

at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:125)

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:57)

at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:51)

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:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:568)

at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)

at jdk.proxy1/jdk.proxy1.$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:126)

at org.sonarsource.scanner.cli.Main.execute(Main.java:81)

at org.sonarsource.scanner.cli.Main.main(Main.java:62)

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:52)

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:50)

... 34 more

Caused by: Could not find a default branch for project with key '<projectkey>'. Make sure project exists.

17:45:10.786 ERROR:

17:45:10.786 ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

Thank you very much!

I see a lot of 404 in the API calls.
This is not normal at all.
I suspect the Sonar token and/or the project may not be correctly configured, or the sonar token may not come from a user with the appropriate permissions.

I would suggest going to the menu under Administration - Analysis Method (if you don’t have access to this menu, then someone with the required project permissions should do that), and following the setup tutorial for GitHub Actions again. Along the process, you should also check that the Sonar token is valid and comes from a user with the Analysis permission on this project.

Hope that helps,
Claire

1 Like

Hi @Claire_Villard

Once again thanks for your help. I will go through everything end to end as you suggested as I only inherited this code base. So it’s looking more and more like it was not setup correctly in the first place.

Best regards

Allan

1 Like