How to get a copy of the sonarscanner analysis files?

How can I get a copy of the files being submitted by the sonarscanner utility to the SonarQube server?

INFO: CPD Executor Calculating CPD for 20 files
INFO: CPD Executor CPD calculation finished (done) | time=183ms
INFO: Analysis report generated in 295ms, dir size=252.2 kB
INFO: Analysis report compressed in 1531ms, zip size=89.7 kB

We have an issue in the Windows build nodes wherein it can start the scan (thus the sonarqube host is reachable) but fails in the submission step. I am hoping to get a copy of the compressed report and the instructions on how to manually submit it so that I can give it to the support team who would have access to the build nodes and can replicate the issue.

I dont see any parameters in the documentation to control these, and even in local instances that I interrupt I dont see any similar files.

Any pointers to these is greatly appreciated. Thanks.

This answer[1] on how to use the submit api mentions a .sonar/scanner-report directory but I dont see that being created in my test runs using sonar-scanner-cli-4.7.0.2747-linux. The $HOME/.sonar directory only contains cache and _tmp where _tmp is empty, and cache contains jars and zipfiles. The workspace .scannework directory is also empty.

[1] How to use submit api(api/ce/submit) construct the request by myself - #2 by ganncamp

Hey there.

sonar.scanner.keepReport=true can be used so that the report isn’t deleted – and you’ll find it in the .scannerwork directory.

15:30:03.459 INFO: Analysis report generated in /Users/colin/source/test-backdate-behavior/.scannerwork/scanner-report

…and I think it would be useful if you shared what failure is happening in the submission step.

1 Like

Thank you.

The error as far as I know is in the OS or network layer as I can run the same scan from a network different than the build node network. I need a copy of the report and a sample of the submit request so I can provide it to the team that has access to the build node network and use it for diagnosis/monitoring.