Errors Occur When Processing Analysis Report in Background

Bellow is our situation:

  • ALM used: Bitbucket Cloud
  • CI system used: Jenkins
  • Scanner command used when applicable (private details masked)
  • Languages of the repository: Java/XML
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
    Error Details: Report Server [Project Analysis]
    
    Error Message
    
      There was an issue whilst processing the report. Please contact support with the Project Analysis ID: AYscySxrfNe0A8mJ04Dm.
    
  • Steps to reproduce
    1. In a maven project execute this command to build jars:
      mvn clean verify
    2. Execute this command to summit the sonar scans:
      export JAVA_HOME='/lib/jvm/java-17-openjdk-amd64' \
      SONAR_SCANNER_OPTS='-Xms4g -Xmx16g -XX:+HeapDumpOnOutOfMemoryError'
      mvn -pl '!jrsrmi' org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
      -Dsonar.projectKey=logianalytics_jreport-server -Dsonar.token=$SONAR_TOKEN \
      -Dsonar.scm.exclusions.disabled=true -Dsonar.projectName='Report Server'
      
    3. After finishing the scan submit go to the background tasks page of the scanned project on the SonarCloud and wait a while for the backend task to finish.
    4. Background task finished with the above error.

Hello @jessehwong,

Thank you for reaching out. Does this issue persist if you re-run the analysis on the same long branch?
If yes, I would ask you to provide me with your project and organization keys via private message (I’ll ping you there).

Regards,
Nawar

Hi Nawar,

Yes it is still persisting after 3 times re-run after this ticket created:

And they are all the same kind of errors:

There was an issue whilst processing the report. Please contact support with the Project Analysis ID: AYsomX_aQzXlumzKeZLy.
There was an issue whilst processing the report. Please contact support with the Project Analysis ID: AYs7Yqn6U0yiejpNw68T.
There was an issue whilst processing the report. Please contact support with the Project Analysis ID: AYs8Uxqjjvc5iLeDGJN2.

For the project and organization keys of ours, I’ll send them to you via email.

Thanks and looking forward to you reply,
Jesse Hwong

Hi, and thanks for your patience!

After investigating on your issues, we noticed several things.
The report processing fails because a lot of files have been moved and added to your project since the last successful analysis.
As a record, we have ~5000 files in the database for your project, from the last successful processing, and the latest report came with more than 12000 files.
Many of the files have a high number of lines of code (more than 1000).
Internally, SonarCloud detects the moved files, and the issue you experienced highlighted a bug within our product. We are working on a fix.

In the meantime, and to help you maximize the value you get from SonarCloud, I have some suggestions:

  • Make sure that no generated code is included in the analysis scope.
    Code generators often generate really long files, with a really high number of issues that are useless to see and fix on SonarCloud since this code is usually not meant to be read and updated manually.
    Here is the documentation to configure the Analysis scope.

  • I also noticed that in this project, only the main branch is analyzed. At Sonar, we believe in the Clean as You Code methodology, to make sure that all the new code produced by the team matches the quality requirements defined for the project. The first step of this methodology is to analyze the pull requests or short branches of your project. This comes with no additional cost, so I’d suggest having a look at the Clean as You Code methodology page, and at the branch analysis page.

4 Likes

Thanks for your detailed explanation, Claire. We have another question, so, we have both Java codes and public html codes (html, css, js etc) in the same bitbucket repository. We want to scan both, how can we achieve this goal on a single sonar cloud project? It seems that we can only create one sonar cloud project from one bitbucket repository.

Regards,
Jesse Hwong

Hi!

No problem at all: our scanner scans all the languages at the same time, so the analysis should contain your Java and your HTML code if the analysis scope is properly configured, without any further configuration on your side.
If you want to have different quality gates for the HTML and Java code, you could have a look at the monorepository feature (ie. how to bind several SonarCloud projects with the same BitBucket repository, with pull request decoration from all of them on the relevant files). Documentation is here.

Hey again @jessehwong

We deployed a fix today, could you please get back to us after the next analyses of your project to confirm if everything is fine now?

Hi Claire,

We met the same in this analysis: AYtnvC6JaZTCDMb2Cpik.

Hi,

Thanks @jessehwong for your patience.
We will continue to investigate and keep you posted.

Hi @jessehwong

We tried another approach and deployed a new fix attempt yesterday.
Could you keep us posted again?

Thanks in advance,
Claire

Hi Claire,

We’ve triggered another scan: AYuS90ZGWC8wZXj83sUg, and this time it seems work normally:

Thank you so much,

Jesse

1 Like

Thanks a lot for getting back to us @jessehwong !

Have a nice day,
Claire

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