Bitbucket Pipelines started failing "Could not find a default branch to fall back on"

  • ALM used Bitbucket Cloud
  • CI system used Bitbucket Cloud
  • Languages of the repository PHP and Android (kotlin & java)
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.6.2.2472
INFO: Java 11.0.3 Oracle Corporation (64-bit)
INFO: Linux 5.13.0-1022-aws amd64
INFO: SONAR_SCANNER_OPTS=-Xmx512m
INFO: Bitbucket Cloud Pipelines detected, no host variable set. Defaulting to sonarcloud.io.
INFO: User cache: /root/.sonar/cache
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: Analyzing on SonarQube server 8.0.0.29799
INFO: Default locale: "en", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=581ms
INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
INFO: User cache: /root/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=136ms
INFO: Load/download plugins (done) | time=31234ms
INFO: Loaded core extensions: developer-scanner
INFO: Found an active CI vendor: 'Bitbucket Pipelines'
INFO: Detected project key 'emplate_emplate-api' from 'Bitbucket Cloud Pipelines'
INFO: Detected organization key 'emplate' from 'Bitbucket Cloud Pipelines'
INFO: Load project settings for component key: 'emplate_emplate-api'
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=1ms
INFO: Project key: emplate_emplate-api
INFO: Base dir: /opt/atlassian/pipelines/agent/build
INFO: Working dir: /opt/atlassian/pipelines/agent/build/.scannerwork
INFO: Load project branches
INFO: Load project branches (done) | time=99ms
INFO: Check ALM binding of project 'emplate_emplate-api'
INFO: Detected project binding: NONEXISTENT
INFO: Check ALM binding of project 'emplate_emplate-api' (done) | time=99ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=104ms
INFO: Load branch configuration
INFO: Detected analysis for pull request '812' targeting 'develop'
INFO: Auto-configuring pull request 812
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 36.832s
INFO: Final Memory: 19M/74M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
ERROR: Could not find a default branch to fall back on.

We get the error above on multiple projects, and for both it seemed to start today or yesterday. Last known working scan on 17th (friday before weekend). It happens for both an Android project through a gradle task, and our PHP project.

The pipelines-entry for the PHP project looks like this:

            - pipe: sonarsource/sonarcloud-scan:1.4.0
              variables:
                SONAR_SCANNER_OPTS: -Xmx512m
                EXTRA_ARGS: '-Dsonar.sources=./app -Dsonar.php.tests.reportPath=./test-reports/junit.xml -Dsonar.php.coverage.reportPaths=./coverage.xml'
1 Like

Hi @hauthorn,

This error means that there is no default branch configured on SonarCloud. This is necessary for us to perform PR analysis.

Did anything change on your SonarCloud configuration? Did you change the name of your branch? Could you check if you have a main branch listed under Branches?

It looks like this - and I’m not aware of any change made to SonarCloud (like I said, it worked Friday afternoon but not Monday morning CEST).

Forgot to @TomVanBraband - and thanks for reaching out!

We’ve had to disregard our traditional quality assurance this week because of it, so any help is much appreciated to get the service working again for us.

Hello @hauthorn,

Thanks for sharing. It looks like your project config is completely correct.

This should mean that the scanner has trouble with retrieving the project config. Maybe the token used by the analysis was generated by a user that no longer has access.

Could you add -Dsonar.verbose=true to the `EXTRA_ARGS in your config and run the analysis again and share the output?

How would I be able to remedy this? Though I can’t seem to recall this happening on the 17th, there has been roster changes in the team recently. I’ve tried to look in the interface of both Bitbucket & Sonarcloud, and I haven’t found a way to re-authenticate. Do we have to delete the projects and create them again?

And the verbose output follow below:

+ docker container run \
   --volume=/opt/atlassian/pipelines/agent/build:/opt/atlassian/pipelines/agent/build \
   --volume=/opt/atlassian/pipelines/agent/ssh:/opt/atlassian/pipelines/agent/ssh:ro \
   --volume=/usr/local/bin/docker:/usr/local/bin/docker:ro \
   --volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes \
   --volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/sonarsource/sonarcloud-scan:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/sonarsource/sonarcloud-scan \
   --workdir=$(pwd) \
   --label=org.bitbucket.pipelines.system=true \
   --env=BITBUCKET_STEP_TRIGGERER_UUID="$BITBUCKET_STEP_TRIGGERER_UUID" \
   --env=BITBUCKET_REPO_FULL_NAME="$BITBUCKET_REPO_FULL_NAME" \
   --env=BITBUCKET_GIT_HTTP_ORIGIN="$BITBUCKET_GIT_HTTP_ORIGIN" \
   --env=BITBUCKET_PROJECT_UUID="$BITBUCKET_PROJECT_UUID" \
   --env=BITBUCKET_REPO_IS_PRIVATE="$BITBUCKET_REPO_IS_PRIVATE" \
   --env=BITBUCKET_WORKSPACE="$BITBUCKET_WORKSPACE" \
   --env=BITBUCKET_PR_DESTINATION_COMMIT="$BITBUCKET_PR_DESTINATION_COMMIT" \
   --env=BITBUCKET_REPO_OWNER_UUID="$BITBUCKET_REPO_OWNER_UUID" \
   --env=BITBUCKET_BRANCH="$BITBUCKET_BRANCH" \
   --env=BITBUCKET_REPO_UUID="$BITBUCKET_REPO_UUID" \
   --env=BITBUCKET_PROJECT_KEY="$BITBUCKET_PROJECT_KEY" \
   --env=BITBUCKET_REPO_SLUG="$BITBUCKET_REPO_SLUG" \
   --env=CI="$CI" \
   --env=BITBUCKET_PR_ID="$BITBUCKET_PR_ID" \
   --env=BITBUCKET_REPO_OWNER="$BITBUCKET_REPO_OWNER" \
   --env=BITBUCKET_STEP_RUN_NUMBER="$BITBUCKET_STEP_RUN_NUMBER" \
   --env=BITBUCKET_BUILD_NUMBER="$BITBUCKET_BUILD_NUMBER" \
   --env=BITBUCKET_GIT_SSH_ORIGIN="$BITBUCKET_GIT_SSH_ORIGIN" \
   --env=BITBUCKET_PIPELINE_UUID="$BITBUCKET_PIPELINE_UUID" \
   --env=BITBUCKET_COMMIT="$BITBUCKET_COMMIT" \
   --env=BITBUCKET_PR_DESTINATION_BRANCH="$BITBUCKET_PR_DESTINATION_BRANCH" \
   --env=BITBUCKET_CLONE_DIR="$BITBUCKET_CLONE_DIR" \
   --env=PIPELINES_JWT_TOKEN="$PIPELINES_JWT_TOKEN" \
   --env=BITBUCKET_STEP_UUID="$BITBUCKET_STEP_UUID" \
   --env=BITBUCKET_DOCKER_HOST_INTERNAL="$BITBUCKET_DOCKER_HOST_INTERNAL" \
   --env=DOCKER_HOST="tcp://host.docker.internal:2375" \
   --env=BITBUCKET_PIPE_SHARED_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes" \
   --env=BITBUCKET_PIPE_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/sonarsource/sonarcloud-scan" \
   --env=EXTRA_ARGS="-Dsonar.verbose=true -Dsonar.sources=./app -Dsonar.php.tests.reportPath=./test-reports/junit.xml -Dsonar.php.coverage.reportPaths=./coverage.xml" \
   --env=SONAR_SCANNER_OPTS="-Xmx512m" \
   --env=SONAR_TOKEN="${SONAR_TOKEN}" \
   --add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \
   sonarsource/sonarcloud-scan:1.4.0
Unable to find image 'sonarsource/sonarcloud-scan:1.4.0' locally
1.4.0: Pulling from sonarsource/sonarcloud-scan
743f2d6c1f65: Pulling fs layer
5c14188d0980: Pulling fs layer
84a54a21b0f2: Pulling fs layer
d9d1bc98b287: Pulling fs layer
c99e982badff: Pulling fs layer
50c6b4dfde57: Pulling fs layer
a561eaec2f8f: Pulling fs layer
ea88b09234a3: Pulling fs layer
83613aeae58d: Pulling fs layer
5d476eee175a: Pulling fs layer
3d3951d29cc9: Pulling fs layer
d9d1bc98b287: Waiting
a561eaec2f8f: Waiting
ea88b09234a3: Waiting
83613aeae58d: Waiting
5d476eee175a: Waiting
3d3951d29cc9: Waiting
c99e982badff: Waiting
50c6b4dfde57: Waiting
84a54a21b0f2: Verifying Checksum
84a54a21b0f2: Download complete
5c14188d0980: Verifying Checksum
5c14188d0980: Download complete
743f2d6c1f65: Verifying Checksum
743f2d6c1f65: Download complete
d9d1bc98b287: Verifying Checksum
d9d1bc98b287: Download complete
c99e982badff: Verifying Checksum
c99e982badff: Download complete
ea88b09234a3: Verifying Checksum
ea88b09234a3: Download complete
a561eaec2f8f: Verifying Checksum
a561eaec2f8f: Download complete
5d476eee175a: Verifying Checksum
5d476eee175a: Download complete
3d3951d29cc9: Verifying Checksum
3d3951d29cc9: Download complete
50c6b4dfde57: Verifying Checksum
50c6b4dfde57: Download complete
83613aeae58d: Verifying Checksum
83613aeae58d: Download complete
743f2d6c1f65: Pull complete
5c14188d0980: Pull complete
84a54a21b0f2: Pull complete
d9d1bc98b287: Pull complete
c99e982badff: Pull complete
50c6b4dfde57: Pull complete
a561eaec2f8f: Pull complete
ea88b09234a3: Pull complete
83613aeae58d: Pull complete
5d476eee175a: Pull complete
3d3951d29cc9: Pull complete
Digest: sha256:8b3690666e34b17bbab84370e569151742f06f21575fbe05e5c066c160b7c968
Status: Downloaded newer image for sonarsource/sonarcloud-scan:1.4.0
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
05:37:00.813 INFO: SonarScanner 4.6.2.2472
05:37:00.814 INFO: Java 11.0.3 Oracle Corporation (64-bit)
05:37:00.814 INFO: Linux 5.13.0-1022-aws amd64
05:37:00.814 INFO: SONAR_SCANNER_OPTS=-Xmx512m
05:37:00.819 INFO: Bitbucket Cloud Pipelines detected, no host variable set. Defaulting to sonarcloud.io.
05:37:00.996 DEBUG: keyStore is : 
05:37:00.996 DEBUG: keyStore type is : pkcs12
05:37:00.996 DEBUG: keyStore provider is : 
05:37:00.996 DEBUG: init keystore
05:37:00.996 DEBUG: init keymanager of type SunX509
05:37:01.122 DEBUG: Create: /root/.sonar/cache
05:37:01.123 INFO: User cache: /root/.sonar/cache
05:37:01.123 DEBUG: Create: /root/.sonar/cache/_tmp
05:37:01.125 DEBUG: Extract sonar-scanner-api-batch in temp...
05:37:01.128 DEBUG: Get bootstrap index...
05:37:01.128 DEBUG: Download: https://sonarcloud.io/batch/index
05:37:01.929 DEBUG: Get bootstrap completed
05:37:01.933 DEBUG: Download https://sonarcloud.io/batch/file?name=scanner-sonarcloud-8.0.0.29915-all.jar to /root/.sonar/cache/_tmp/fileCache5398376062397507270.tmp
05:37:03.979 DEBUG: Create isolated classloader...
05:37:03.991 DEBUG: Start temp cleaning...
05:37:03.998 DEBUG: Temp cleaning done
05:37:03.998 INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
05:37:03.999 INFO: Project root configuration file: NONE
05:37:04.001 DEBUG: Execution getVersion
05:37:04.016 INFO: Analyzing on SonarQube server 8.0.0.29915
05:37:04.016 INFO: Default locale: "en", source code encoding: "UTF-8" (analysis is platform dependent)
05:37:04.017 DEBUG: Work directory: /opt/atlassian/pipelines/agent/build/.scannerwork
05:37:04.018 DEBUG: Execution execute
05:37:04.325 DEBUG: SonarCloud 9.6.1.114
05:37:04.618 INFO: Load global settings
05:37:05.253 DEBUG: GET 200 https://sonarcloud.io/api/settings/values.protobuf | time=632ms
05:37:05.262 INFO: Load global settings (done) | time=644ms
05:37:05.268 INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
05:37:05.281 DEBUG: Create : /root/.sonar/_tmp
05:37:05.281 INFO: User cache: /root/.sonar/cache
05:37:05.286 INFO: Load/download plugins
05:37:05.286 INFO: Load plugins index
05:37:05.387 DEBUG: GET 200 https://sonarcloud.io/api/plugins/installed | time=101ms
05:37:05.439 INFO: Load plugins index (done) | time=153ms
05:37:05.441 DEBUG: Download plugin 'abap' to '/root/.sonar/_tmp/fileCache13201094855830049662.tmp'
05:37:05.632 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=abap&acceptCompressions=pack200 | time=191ms
05:37:05.999 DEBUG: Unpacking plugin abap
05:37:06.357 DEBUG: Download plugin 'sonarapex' to '/root/.sonar/_tmp/fileCache11791595127974743385.tmp'
05:37:06.458 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=sonarapex&acceptCompressions=pack200 | time=100ms
05:37:06.592 DEBUG: Unpacking plugin sonarapex
05:37:07.124 DEBUG: Download plugin 'csharp' to '/root/.sonar/_tmp/fileCache4540092510949862271.tmp'
05:37:07.222 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=csharp&acceptCompressions=pack200 | time=98ms
05:37:07.424 DEBUG: Unpacking plugin csharp
05:37:08.136 DEBUG: Download plugin 'cpp' to '/root/.sonar/_tmp/fileCache9744128248827672632.tmp'
05:37:08.237 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=cpp&acceptCompressions=pack200 | time=101ms
05:37:11.460 DEBUG: Unpacking plugin cpp
05:37:14.350 DEBUG: Download plugin 'cobol' to '/root/.sonar/_tmp/fileCache2930148091215419466.tmp'
05:37:14.448 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=cobol&acceptCompressions=pack200 | time=97ms
05:37:14.457 DEBUG: Unpacking plugin cobol
05:37:14.893 DEBUG: Download plugin 'config' to '/root/.sonar/_tmp/fileCache2107363043108244611.tmp'
05:37:14.989 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=config&acceptCompressions=pack200 | time=96ms
05:37:14.990 DEBUG: Unpacking plugin config
05:37:14.995 DEBUG: Download plugin 'dbd' to '/root/.sonar/_tmp/fileCache15570734989650845182.tmp'
05:37:15.092 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=dbd&acceptCompressions=pack200 | time=96ms
05:37:15.100 DEBUG: Unpacking plugin dbd
05:37:15.357 DEBUG: Download plugin 'dbdjavafrontend' to '/root/.sonar/_tmp/fileCache15828387694223181007.tmp'
05:37:15.456 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=dbdjavafrontend&acceptCompressions=pack200 | time=99ms
05:37:15.561 DEBUG: Unpacking plugin dbdjavafrontend
05:37:15.679 DEBUG: Download plugin 'dbdpythonfrontend' to '/root/.sonar/_tmp/fileCache16563675500788876359.tmp'
05:37:15.778 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=dbdpythonfrontend&acceptCompressions=pack200 | time=98ms
05:37:15.883 DEBUG: Unpacking plugin dbdpythonfrontend
05:37:16.019 DEBUG: Download plugin 'flex' to '/root/.sonar/_tmp/fileCache14052924648651728716.tmp'
05:37:16.117 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=flex&acceptCompressions=pack200 | time=98ms
05:37:16.125 DEBUG: Unpacking plugin flex
05:37:16.344 DEBUG: Download plugin 'go' to '/root/.sonar/_tmp/fileCache16048163904579071801.tmp'
05:37:16.442 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=go&acceptCompressions=pack200 | time=97ms
05:37:16.752 DEBUG: Unpacking plugin go
05:37:17.452 DEBUG: Download plugin 'web' to '/root/.sonar/_tmp/fileCache16224629691518093910.tmp'
05:37:17.549 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=web&acceptCompressions=pack200 | time=97ms
05:37:17.552 DEBUG: Unpacking plugin web
05:37:17.644 DEBUG: Download plugin 'iac' to '/root/.sonar/_tmp/fileCache11620827421927203882.tmp'
05:37:17.742 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=iac&acceptCompressions=pack200 | time=96ms
05:37:17.746 DEBUG: Unpacking plugin iac
05:37:17.866 DEBUG: Download plugin 'jacoco' to '/root/.sonar/_tmp/fileCache7755461409176995315.tmp'
05:37:17.965 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=jacoco&acceptCompressions=pack200 | time=99ms
05:37:17.965 DEBUG: Unpacking plugin jacoco
05:37:17.969 DEBUG: Download plugin 'java' to '/root/.sonar/_tmp/fileCache10281784777423723662.tmp'
05:37:18.067 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=java&acceptCompressions=pack200 | time=97ms
05:37:18.367 DEBUG: Unpacking plugin java
05:37:20.675 DEBUG: Download plugin 'javascript' to '/root/.sonar/_tmp/fileCache17119889537648447824.tmp'
05:37:20.773 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=javascript&acceptCompressions=pack200 | time=98ms
05:37:21.967 DEBUG: Unpacking plugin javascript
05:37:22.991 DEBUG: Download plugin 'kotlin' to '/root/.sonar/_tmp/fileCache17831412876552682334.tmp'
05:37:23.087 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=kotlin&acceptCompressions=pack200 | time=96ms
05:37:23.878 DEBUG: Unpacking plugin kotlin
05:37:28.462 DEBUG: Download plugin 'license' to '/root/.sonar/_tmp/fileCache8903247259293028327.tmp'
05:37:28.559 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=license&acceptCompressions=pack200 | time=97ms
05:37:28.560 DEBUG: Unpacking plugin license
05:37:28.563 DEBUG: Download plugin 'php' to '/root/.sonar/_tmp/fileCache15052773752258330632.tmp'
05:37:28.661 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=php&acceptCompressions=pack200 | time=98ms
05:37:28.680 DEBUG: Unpacking plugin php
05:37:29.300 DEBUG: Download plugin 'plsql' to '/root/.sonar/_tmp/fileCache4302744509814750098.tmp'
05:37:29.397 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=plsql&acceptCompressions=pack200 | time=97ms
05:37:29.405 DEBUG: Unpacking plugin plsql
05:37:29.671 DEBUG: Download plugin 'python' to '/root/.sonar/_tmp/fileCache15133932948609237635.tmp'
05:37:29.769 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=python&acceptCompressions=pack200 | time=97ms
05:37:29.962 DEBUG: Unpacking plugin python
05:37:30.870 DEBUG: Download plugin 'ruby' to '/root/.sonar/_tmp/fileCache14072446300634114793.tmp'
05:37:30.967 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=ruby&acceptCompressions=pack200 | time=97ms
05:37:31.257 DEBUG: Unpacking plugin ruby
05:37:33.018 DEBUG: Download plugin 'sonarscala' to '/root/.sonar/_tmp/fileCache8278773098470833658.tmp'
05:37:33.116 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=sonarscala&acceptCompressions=pack200 | time=97ms
05:37:33.605 DEBUG: Unpacking plugin sonarscala
05:37:34.889 DEBUG: Download plugin 'swift' to '/root/.sonar/_tmp/fileCache1211609745823108857.tmp'
05:37:34.986 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=swift&acceptCompressions=pack200 | time=96ms
05:37:34.992 DEBUG: Unpacking plugin swift
05:37:35.157 DEBUG: Download plugin 'tsql' to '/root/.sonar/_tmp/fileCache14131019992714553075.tmp'
05:37:35.254 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=tsql&acceptCompressions=pack200 | time=97ms
05:37:35.261 DEBUG: Unpacking plugin tsql
05:37:35.510 DEBUG: Download plugin 'text' to '/root/.sonar/_tmp/fileCache16104442390369106814.tmp'
05:37:35.606 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=text&acceptCompressions=pack200 | time=96ms
05:37:35.607 DEBUG: Unpacking plugin text
05:37:35.615 DEBUG: Download plugin 'vbnet' to '/root/.sonar/_tmp/fileCache3231490185016209314.tmp'
05:37:35.713 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=vbnet&acceptCompressions=pack200 | time=97ms
05:37:35.738 DEBUG: Unpacking plugin vbnet
05:37:36.217 DEBUG: Download plugin 'security' to '/root/.sonar/_tmp/fileCache11812603649534407041.tmp'
05:37:36.315 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=security&acceptCompressions=pack200 | time=98ms
05:37:36.707 DEBUG: Unpacking plugin security
05:37:37.399 DEBUG: Download plugin 'securitycsharpfrontend' to '/root/.sonar/_tmp/fileCache12415013409765629967.tmp'
05:37:37.497 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=securitycsharpfrontend&acceptCompressions=pack200 | time=98ms
05:37:37.508 DEBUG: Unpacking plugin securitycsharpfrontend
05:37:37.557 DEBUG: Download plugin 'securityjsfrontend' to '/root/.sonar/_tmp/fileCache11190872209176761940.tmp'
05:37:37.654 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=securityjsfrontend&acceptCompressions=pack200 | time=97ms
05:37:37.660 DEBUG: Unpacking plugin securityjsfrontend
05:37:37.688 DEBUG: Download plugin 'securityjavafrontend' to '/root/.sonar/_tmp/fileCache4321022560171803531.tmp'
05:37:37.786 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=securityjavafrontend&acceptCompressions=pack200 | time=98ms
05:37:38.286 DEBUG: Unpacking plugin securityjavafrontend
05:37:38.724 DEBUG: Download plugin 'securityphpfrontend' to '/root/.sonar/_tmp/fileCache16870607011091529162.tmp'
05:37:38.822 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=securityphpfrontend&acceptCompressions=pack200 | time=97ms
05:37:38.931 DEBUG: Unpacking plugin securityphpfrontend
05:37:39.073 DEBUG: Download plugin 'securitypythonfrontend' to '/root/.sonar/_tmp/fileCache1385928403091164467.tmp'
05:37:39.170 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=securitypythonfrontend&acceptCompressions=pack200 | time=97ms
05:37:39.282 DEBUG: Unpacking plugin securitypythonfrontend
05:37:39.418 DEBUG: Download plugin 'xml' to '/root/.sonar/_tmp/fileCache12365091347627338199.tmp'
05:37:39.514 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=xml&acceptCompressions=pack200 | time=96ms
05:37:39.521 DEBUG: Unpacking plugin xml
05:37:39.792 INFO: Load/download plugins (done) | time=34506ms
05:37:40.089 DEBUG: Plugins:
05:37:40.090 DEBUG:   * IaC Code Quality and Security 1.7.0.2012 (iac)
05:37:40.090 DEBUG:   * PL/SQL Code Quality and Security 3.7.0.4372 (plsql)
05:37:40.090 DEBUG:   * Scala Code Quality and Security 1.10.0.3710 (sonarscala)
05:37:40.090 DEBUG:   * C# Code Quality and Security 8.40.0.48530 (csharp)
05:37:40.090 DEBUG:   * Vulnerability Analysis 9.5.1.16463 (security)
05:37:40.090 DEBUG:   * Java Code Quality and Security 7.12.1.29810 (java)
05:37:40.090 DEBUG:   * HTML Code Quality and Security 3.6.0.3106 (web)
05:37:40.090 DEBUG:   * Flex Code Quality and Security 2.7.0.2865 (flex)
05:37:40.090 DEBUG:   * XML Code Quality and Security 2.5.0.3376 (xml)
05:37:40.090 DEBUG:   * Text file Code Quality and Security 1.1.0.282 (text)
05:37:40.090 DEBUG:   * VB.NET Code Quality and Security 8.40.0.48530 (vbnet)
05:37:40.090 DEBUG:   * Swift Code Quality and Security 4.6.0.5406 (swift)
05:37:40.091 DEBUG:   * CFamily Code Quality and Security 6.34.0.48468 (cpp)
05:37:40.091 DEBUG:   * Python Code Quality and Security 3.15.1.9817 (python)
05:37:40.091 DEBUG:   * Dataflow Bug Detection Rules for Python 1.3.0.1749 (dbdpythonfrontend)
05:37:40.091 DEBUG:   * Dataflow Bug Detection 1.3.0.1749 (dbd)
05:37:40.091 DEBUG:   * Go Code Quality and Security 1.10.0.3710 (go)
05:37:40.091 DEBUG:   * JaCoCo 1.1.1.1157 (jacoco)
05:37:40.091 DEBUG:   * Kotlin Code Quality and Security 2.9.0.1147 (kotlin)
05:37:40.091 DEBUG:   * Dataflow Bug Detection Rules for Java 1.3.0.1749 (dbdjavafrontend)
05:37:40.091 DEBUG:   * T-SQL Code Quality and Security 1.6.0.4844 (tsql)
05:37:40.091 DEBUG:   * Apex Code Quality and Security 1.10.0.3710 (sonarapex)
05:37:40.091 DEBUG:   * JavaScript/TypeScript/CSS Code Quality and Security 9.3.0.18033 (javascript)
05:37:40.091 DEBUG:   * Ruby Code Quality and Security 1.10.0.3710 (ruby)
05:37:40.091 DEBUG:   * Vulnerability Rules for C# 9.5.1.16463 (securitycsharpfrontend)
05:37:40.091 DEBUG:   * Vulnerability Rules for Java 9.5.1.16463 (securityjavafrontend)
05:37:40.092 DEBUG:   * License for SonarLint 8.0.0.29915 (license)
05:37:40.092 DEBUG:   * Vulnerability Rules for JS 9.5.1.16463 (securityjsfrontend)
05:37:40.092 DEBUG:   * COBOL Code Quality 5.0.0.5433 (cobol)
05:37:40.092 DEBUG:   * Vulnerability Rules for Python 9.5.1.16463 (securitypythonfrontend)
05:37:40.092 DEBUG:   * PHP Code Quality and Security 3.23.1.8766 (php)
05:37:40.092 DEBUG:   * ABAP Code Quality and Security 3.10.0.3628 (abap)
05:37:40.092 DEBUG:   * Configuration detection fot Code Quality and Security 1.2.0.267 (config)
05:37:40.092 DEBUG:   * Vulnerability Rules for PHP 9.5.1.16463 (securityphpfrontend)
05:37:40.187 DEBUG: GET 200 https://sonarcloud.io/api/server/version | time=95ms
05:37:40.189 DEBUG: Updated analysis started with a difference of -49 milliseconds
05:37:40.198 DEBUG: Started at Tue Jun 28 05:37:05 UTC 2022
05:37:40.242 INFO: Loaded core extensions: developer-scanner
05:37:40.268 DEBUG: Installed core extension: com.sonarsource.branch.DeveloperScannerCoreExtension@22d6cac2
05:37:40.719 INFO: Found an active CI vendor: 'Bitbucket Pipelines'
05:37:40.825 DEBUG: GET 200 https://sonarcloud.io/api/alm_integration/show_project?almId=bitbucketcloud&almRepoId=%257Bf0e7098a-02c8-4617-9e3b-fc7b3aafeafd%257D | time=99ms
05:37:40.829 INFO: Detected project key 'emplate_emplate-api' from 'Bitbucket Cloud Pipelines'
05:37:40.830 INFO: Detected organization key 'emplate' from 'Bitbucket Cloud Pipelines'
05:37:40.834 INFO: Load project settings for component key: 'emplate_emplate-api'
05:37:40.935 DEBUG: GET 404 https://sonarcloud.io/api/settings/values.protobuf?component=emplate_emplate-api | time=100ms
05:37:40.939 INFO: Process project properties
05:37:40.945 DEBUG: Process project properties (done) | time=6ms
05:37:40.946 INFO: Execute project builders
05:37:40.946 DEBUG: Execute project builder: org.sonar.plugins.csharp.CSharpGlobalProtobufFileProcessor
05:37:40.947 DEBUG: Execute project builder: org.sonar.plugins.vbnet.VbNetGlobalProtobufFileProcessor
05:37:40.947 INFO: Execute project builders (done) | time=1ms
05:37:40.949 INFO: Project key: emplate_emplate-api
05:37:40.949 INFO: Base dir: /opt/atlassian/pipelines/agent/build
05:37:40.949 INFO: Working dir: /opt/atlassian/pipelines/agent/build/.scannerwork
05:37:40.949 DEBUG: Project global encoding: UTF-8, default locale: en
05:37:40.950 DEBUG: Creating module hierarchy
05:37:40.950 DEBUG:   Init module 'emplate_emplate-api'
05:37:40.951 DEBUG:     Base dir: /opt/atlassian/pipelines/agent/build
05:37:40.951 DEBUG:     Working dir: /opt/atlassian/pipelines/agent/build/.scannerwork
05:37:40.951 DEBUG:     Module global encoding: UTF-8, default locale: en
05:37:41.015 INFO: Load project branches
05:37:41.114 DEBUG: GET 404 https://sonarcloud.io/api/project_branches/list?project=emplate_emplate-api | time=98ms
05:37:41.114 DEBUG: Could not process project branches - continuing without it
05:37:41.115 INFO: Load project branches (done) | time=100ms
05:37:41.117 INFO: Check ALM binding of project 'emplate_emplate-api'
05:37:41.217 DEBUG: GET 404 https://sonarcloud.io/api/alm_integration/is_project_bound?project=emplate_emplate-api | time=100ms
05:37:41.217 INFO: Detected project binding: NONEXISTENT
05:37:41.217 INFO: Check ALM binding of project 'emplate_emplate-api' (done) | time=100ms
05:37:41.219 INFO: Load project pull requests
05:37:41.321 DEBUG: GET 404 https://sonarcloud.io/api/project_pull_requests/list?project=emplate_emplate-api | time=101ms
05:37:41.321 DEBUG: Could not process project pull requests - continuing without it
05:37:41.322 INFO: Load project pull requests (done) | time=103ms
05:37:41.324 INFO: Load branch configuration
05:37:41.325 INFO: Detected analysis for pull request '817' targeting 'develop'
05:37:41.326 INFO: Auto-configuring pull request 817
05:37:41.336 INFO: ------------------------------------------------------------------------
05:37:41.336 INFO: EXECUTION FAILURE
05:37:41.336 INFO: ------------------------------------------------------------------------
05:37:41.336 INFO: Total time: 40.568s
05:37:41.379 INFO: Final Memory: 20M/80M
05:37:41.379 INFO: ------------------------------------------------------------------------
05:37:41.379 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:128)
	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)
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 to fall back on.
05:37:41.382 ERROR: 
05:37:41.382 ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
e[31m✖ SonarCloud analysis failed. (exit code = 1)e[0m

Thanks for sharing.
This is the culprit:
05:37:41.114 DEBUG: GET 404 https://sonarcloud.io/api/project_branches/list?project=emplate_emplate-api | time=98ms. A 404 in this context means something happened to the token that was configured with the analysis. Re-generating the token should fix the analysis and passing the new token to the analysis should fix your issue. See this page on how to generate a new token.

Of course the error message you got was not clear and did not indicate the actual problem. I created a ticket to tackle this.

To be more precise, it seems like the token that was used for the analysis is still valid. The user that generated the token does not have Execute analysis rights on the project anymore.

Thank you @TomVanBraband - that was indeed a confusing error message.

Where do I put this token, given that this is a project “bound” to Bitbucket? I see no place in the UI to enter it. Do I override something in the pipeline definition itself?

Yes, on Bitbucket you have probably set-up an environment variable named SONAR_TOKEN.
You can find this under your project settings > Repository variables in the Bitbucket UI.

Thank you so much! Everything seems to be working again.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.