Issue in Bitbucket Pipelines With Sonar Cloud Scanner (Typescript Code)

Services Used:

  • Bitbucket Cloud
  • Bitbucket Pipelines For CI
  • Typescript as language
    Error Encountered For Few Repos In Bitbucket Pipelines:

We have integrated many of our bitbucket repositories on sonar cloud. We scan our code in bitbucket pipelines using official bitbucket sonar pipes. But we get below error in some of our repositories. We have even enabled debug mode but not able to find anything.

13:05:34.338 INFO: Load quality profiles (done) | time=164ms
13:05:34.344 INFO: Load active rules
13:05:34.483 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmb&ps=500&p=1 | time=139ms
13:05:34.682 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmq&ps=500&p=1 | time=104ms
13:05:34.788 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmX&ps=500&p=1 | time=100ms
13:05:34.903 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmc&ps=500&p=1 | time=114ms
13:05:35.063 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmW&ps=500&p=1 | time=121ms
13:05:35.194 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmV&ps=500&p=1 | time=111ms
13:05:35.316 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmZ&ps=500&p=1 | time=114ms
13:05:35.501 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlme&ps=500&p=1 | time=170ms
13:05:35.674 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmS&ps=500&p=1 | time=102ms
13:05:35.794 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmU&ps=500&p=1 | time=114ms
13:05:35.902 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlma&ps=500&p=1 | time=103ms
13:05:36.016 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmh&ps=500&p=1 | time=113ms
13:05:36.139 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmg&ps=500&p=1 | time=119ms
13:05:36.281 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmp&ps=500&p=1 | time=140ms
13:05:40.051 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlms&ps=500&p=1 | time=3754ms
13:05:40.855 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmr&ps=500&p=1 | time=790ms
13:05:41.001 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlml&ps=500&p=1 | time=144ms
13:05:41.128 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmf&ps=500&p=1 | time=126ms
13:05:41.239 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmj&ps=500&p=1 | time=109ms
13:05:41.419 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmY&ps=500&p=1 | time=178ms
13:05:41.540 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmR&ps=500&p=1 | time=116ms
13:05:41.690 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmm&ps=500&p=1 | time=147ms
13:05:41.803 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmi&ps=500&p=1 | time=109ms
13:05:41.930 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmk&ps=500&p=1 | time=125ms
13:05:42.046 DEBUG: GET 200 https://sonarcloud.io/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AWqg2FeXcMoWyatDOlmT&ps=500&p=1 | time=111ms
13:05:42.054 INFO: Load active rules (done) | time=7710ms
13:05:42.082 INFO: Organization key: ORGANISATION_NAME
13:05:42.083 INFO: Branch name: alpha, type: short living
13:05:42.094 INFO: SCM collecting changed files in the branch
13:05:42.110 DEBUG: readpipe [git, --version],/usr/bin
13:05:42.127 DEBUG: readpipe may return 'git version 2.11.0'
13:05:42.128 DEBUG: remaining output:
13:05:42.128 DEBUG: readpipe [git, config, --system, --edit],/usr/bin
13:05:42.132 DEBUG: readpipe may return '/etc/gitconfig'
13:05:42.132 DEBUG: remaining output:
13:05:42.245 INFO: ------------------------------------------------------------------------
13:05:42.245 INFO: EXECUTION FAILURE
13:05:42.245 INFO: ------------------------------------------------------------------------
13:05:42.245 INFO: Total time: 37.623s
13:05:42.287 INFO: Final Memory: 19M/77M
13:05:42.287 INFO: ------------------------------------------------------------------------
13:05:42.287 ERROR: Error during SonarQube Scanner execution
13:05:42.288 ERROR: Unable to load component class org.sonar.scanner.scan.filesystem.ProjectFileIndexer
13:05:42.288 ERROR: Caused by: Unable to load component class org.sonar.scanner.scan.filesystem.FileIndexer
13:05:42.288 ERROR: Caused by: Unable to load component class org.sonar.scanner.scan.filesystem.MetadataGenerator
13:05:42.288 ERROR: Caused by: Unable to load component class org.sonar.scanner.scan.filesystem.StatusDetection
13:05:42.288 ERROR: Caused by: Unable to load component class org.sonar.scanner.scm.ScmChangedFiles
13:05:42.288 ERROR:
13:05:42.288 ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
✖ SonarCloud analysis failed.
1 Like

Hi @Alpesh_Jain,

Welcome to our community !

On the repositories that are in error, were you able to get some successful analysis or does this error raises at first analysis ?
Could you also please share the bitbucket-pipelines.yml of one of the repository that is in error?

Thanks,
Cheers,

We were not able to scan even once. Same yml config works for few other repositories but fails in 3 repositories. Below is bitbucket-pipelines.yml config that we are using:

steps:

        - step: &sonarqube
            name: Build & Test project against Sonarqube
            caches:
               - sonar
            script:
               - npm install
               - pipe: sonarsource/sonarcloud-scan:1.0.1
               - pipe: sonarsource/sonarcloud-quality-gate:0.1.3
                 variables:
                 SONAR_TOKEN: ${SONAR_TOKEN}
1 Like

Is your build using a shallow clone of the Git repository?

No, We are using clone depth full.

clone:
  depth: full

Hi @Alpesh_Jain, unfortunately I’m still not able to reproduce this failure :frowning:

Would it be possible to send us a zip of the repository (the smallest one where you see this behavior) in a private thread? (I will send you the invite, if this option is acceptable to you.)