IllegalStateException: Failed to upload report and 2 questions

Hello,

After posting my question in https://community.sonarsource.com/t/illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/69794 I learnt that I need to use compilation database in my analysis thanks to @Abbas. But I haven’t found out the correct way to use Soong and instead I generate the compilation database using ‘Bear’.

  1. First of all, will it be a problem for an Android AOSP project?

After using the compilation database, I started analyzing the code but it took too long, usually around a 3 day. Is this a normal duration depending on the project size? Moreover, I again had java.lang.OutOfMemoryError: Java heap space error.
2) Is there any documentation specifying the memory requirement for an analysis?
I am currently using a computer with 32 GB of RAM and 8 cores. Before the analysis, I specify export SONAR_SCANNER_OPTS="-Xmx28672m -XX:MaxPermSize=28672m -XX:ReservedCodeCacheSize=2048m"

Currently, the problem is having the following error after 2.5-3 days of analysis: java.lang.IllegalStateException: Failed to upload report: Failed to request http://sonar_address:9000/api/ce/submit?projectKey=correct_key_that_I_get_from_sonar.

Would you please guide me on solving the problem?

Best

Hello,
I can provide any log file if you need. I would like to have some feedback about the question.
Thank you

Hello @cppdev,

You can find documentation about hardware requirements here: Hardware Requirements. But from what you write, your configuration seems good enough.

Compilation database generated with ‘Bear’ should work with the analyzer, I don’t think the problem comes from there.

If I understood correctly, you have two kinds of errors during the analysis:

  • java.lang.OutOfMemoryError: Java heap space error
  • java.lang.IllegalStateException: Failed to upload report when the analysis stops.

Is that correct?

Could you send me the scanner logs so that I can have a look? I can send you a private message if you want.

Thank you
Amélie

Hello @Amelie ,

Sorry for late reply, our licence was expired and we completed the purchase of a new licence this week. I will run the sonar-scanner and share the results with you in the next week. Strangely, a single scan takes around 3-4 days. I would be thankful if you could show me a way depending on the scanner logs (that I will share).

Best Regards

Hello @cppdev,

That’s okay, no worry!
Unfortunately, without the logs it’s difficult to advise you what to do… One thing that could help is to reduce the scope with sonar.inclusions and/or sonar.exclusions: for example, exclude generated and third party files, and try to analyze only the code that is relevant to you.

Amélie

Hello @Amelie

I finish the sonar-scanner. After running the sonar-scanner, the terminal shows the second error while the web interface shows the first error. Would you please start a private message to let me send the logs? Which logs would you need to understand the issue?

Thank you