0% analyzed indefinitely

When invoking the sonnar scanner (sonarsource/sonarcloud-scan:1.4.0) via a Bitbucket Pipeline, we see this intermittently…

INFO: Java 11.0.3 Oracle Corporation (64-bit)
INFO: Linux 5.13.0-1022-aws amd64
INFO: SONAR_SCANNER_OPTS=-Xms6G -Xmx6G
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: /opt/atlassian/pipelines/agent/build/sonar-project.properties
INFO: Analyzing on SonarQube server 9.4.0
INFO: Default locale: “en”, source code encoding: “UTF-8”
INFO: Load global settings
INFO: Load global settings (done) | time=560ms
INFO: User cache: /root/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=130ms
INFO: Load/download plugins (done) | time=31260ms
INFO: Loaded core extensions: developer-scanner
INFO: Found an active CI vendor: ‘Bitbucket Pipelines’
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=2ms
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=112ms
INFO: Detected project binding: BOUND
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=99ms
INFO: Load branch configuration
INFO: Load branch configuration (done) | time=2ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=150ms
INFO: Load active rules
INFO: Load active rules (done) | time=4066ms
INFO: Load project repositories
INFO: Load project repositories (done) | time=206ms
INFO: Indexing files…
INFO: 590 files indexed
INFO: 1 file ignored because of inclusion/exclusion patterns
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for java: Sonar way
INFO: Quality profile for json: Sonar way
INFO: Quality profile for plsql: Sonar way
INFO: Quality profile for xml: Sonar way
INFO: Quality profile for yaml: Sonar way
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=111ms
INFO: Sensor JavaSensor [java]
INFO: Configured Java source version (sonar.java.source): none
INFO: JavaClasspath initialization
INFO: JavaClasspath initialization (done) | time=158ms
INFO: JavaTestClasspath initialization
INFO: JavaTestClasspath initialization (done) | time=4ms
INFO: erver-side caching is not enabled. The Java analyzer will not try to leverage data from a previous analysis.
INFO: Using ECJ batch to parse 438 Main java source files with batch size 322 KB.
INFO: Starting batch processing.
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed

We eventually have to stop the pipeline as it’s been running for 32 m 30 s and it’s eating away at our build minutes. Why is it ‘stuck’? How can we further diagnose this issue?

Hello @jgreyling,

Is this the full content of the log? I see a mangled line in what you pasted.

INFO: erver-side caching is not enabled...

Have you tried using the sonarscanner for maven or sonarscanner for gradle on your project? Did you see any difference?

Hi Dorian,

Here is the full log from the sonarsource/sonarcloud-scan:1.4.0 pipe in Bitbucket Pipelines:

+ 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_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_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_CLONE_DIR="$BITBUCKET_CLONE_DIR" \
   --env=PIPELINES_JWT_TOKEN="$PIPELINES_JWT_TOKEN" \
   --env=BITBUCKET_STEP_UUID="$BITBUCKET_STEP_UUID" \
   --env=BITBUCKET_STEP_OIDC_TOKEN="$BITBUCKET_STEP_OIDC_TOKEN" \
   --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.branch.name=${BITBUCKET_BRANCH} -Dsonar.projectVersion=${BITBUCKET_BUILD_NUMBER}" \
   --env=SONAR_SCANNER_OPTS="-Xms6G -Xmx6G" \
   --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
c99e982badff: Waiting
50c6b4dfde57: Waiting
3d3951d29cc9: Waiting
5d476eee175a: 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: Download complete
a561eaec2f8f: Verifying Checksum
a561eaec2f8f: Download complete
5d476eee175a: Verifying Checksum
5d476eee175a: Download complete
50c6b4dfde57: Verifying Checksum
50c6b4dfde57: Download complete
743f2d6c1f65: Pull complete
3d3951d29cc9: Verifying Checksum
3d3951d29cc9: Download complete
83613aeae58d: Verifying Checksum
83613aeae58d: Download 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: /opt/atlassian/pipelines/agent/build/sonar-project.properties
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=-Xms6G -Xmx6G
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: /opt/atlassian/pipelines/agent/build/sonar-project.properties
INFO: Analyzing on SonarQube server 9.4.0
INFO: Default locale: "en", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=560ms
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=130ms
INFO: Load/download plugins (done) | time=31260ms
INFO: Loaded core extensions: developer-scanner
INFO: Found an active CI vendor: 'Bitbucket Pipelines'
INFO: Detected project key '***-***_***' from 'Bitbucket Cloud Pipelines'
INFO: Detected organization key '***-***' from 'Bitbucket Cloud Pipelines'
INFO: Load project settings for component key: '***-***_***'
INFO: Load project settings for component key: '***-***_***' (done) | time=107ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=2ms
INFO: Project key: ***-***_***
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=112ms
INFO: Check ALM binding of project '***-***_***'
INFO: Detected project binding: BOUND
INFO: Check ALM binding of project '***-***_***' (done) | time=97ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=99ms
INFO: Load branch configuration
INFO: Load branch configuration (done) | time=2ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=150ms
INFO: Load active rules
INFO: Load active rules (done) | time=4066ms
INFO: Organization key: ***-***
INFO: Branch name: develop, type: long-lived
INFO: Load project repositories
INFO: Load project repositories (done) | time=206ms
INFO: Indexing files...
INFO: Project configuration:
INFO:   Excluded sources: **/build-wrapper-dump.json, ***.java
INFO: 590 files indexed
INFO: 1 file ignored because of inclusion/exclusion patterns
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for java: Sonar way
INFO: Quality profile for json: Sonar way
INFO: Quality profile for plsql: Sonar way
INFO: Quality profile for xml: Sonar way
INFO: Quality profile for yaml: Sonar way
INFO: ------------- Run sensors on module ***-***_***
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=111ms
INFO: Sensor JavaSensor [java]
INFO: Configured Java source version (sonar.java.source): none
INFO: JavaClasspath initialization
INFO: JavaClasspath initialization (done) | time=158ms
INFO: JavaTestClasspath initialization
INFO: JavaTestClasspath initialization (done) | time=4ms
INFO: Server-side caching is not enabled. The Java analyzer will not try to leverage data from a previous analysis.
INFO: Using ECJ batch to parse 438 Main java source files with batch size 322 KB.
INFO: Starting batch processing.
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed
INFO: 0% analyzed

(Sensitive information masked)

Hey there.

We wouldn’t typically recommend using sonarsource/sonarcloud-scan for analyzing Java projects – Java projects are best analyzed with the SonarScanner for Maven or SonarScanner for Gradle – depending on what build system you use.

Tutorials for analyzing your project this way can be found in your Project’s Administration > Analysis Method > Bitbucket Pipelines tutorial

Can you give this a try and see if you still face the issue?

Hi Colin,

so quick question if we use SonarScanner for Gradle instead, how can I check the quality gate? I can’t use the sonarsource/sonarcloud-quality-gate:0.1.6 without the sonarcloud-scan pipe. Will the Gradle task ‘sonarqube’ also check the status of a scan? It’s vital that we have the quality gate as part of our CI pipeline.

You can also add -Dsonar.qualitygate.wait=true to the gradle command in order to poll for the Quality Gate and issue a non-zero exit code on Quality Gate failure.