6

I am using MSBuild. I have Java 8 installed.

I am running the following commands:

SonarQube.Scanner.MSBuild.exe begin /k:"ABC" /d:sonar.host.url="http://localhost:9000"  /d:sonar.login="8b839xxxxxxxxxxxxxxxxxxxxxxx6b00125bf92"  /d:sonar.verbose=true

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\msbuild.exe" /t:rebuild

SonarQube.Scanner.MSBuild.exe end /d:sonar.login="8b839xxxxxxxxxxxxxxxxxxxxxxx6b00125bf92"

The last step fails:

ERROR: Error during SonarQube Scanner execution
ERROR: The 'report' parameter is missing
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
The SonarQube Scanner did not complete successfully
12:53:21.909  Creating a summary markdown file...
12:53:21.918  Post-processing failed. Exit code: 1

The MSBuild version is greater than 14.

Java 8 is properly installed. Documentation indicates that Java 8 is adequate.

  1. Any idea on what could be wrong?
  2. Where do I add the -X switch? I tried on all 3 statements

Update :I installed Java SDK 9. Still same issue. Update :With verbose logging and using /n naming parameter:

INFO: Analysis report generated in 992ms, dir size=4 MB
INFO: Analysis reports compressed in 549ms, zip size=1 MB
INFO: Analysis report generated in C:\ABC\.sonarqube\out\.sonar\scanner-report
DEBUG: Upload report
DEBUG: POST 400 http://localhost:9000/api/ce/submit?projectKey=ABC | time=1023ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 54.833s
INFO: Final Memory: 51M/170M
INFO: ------------------------------------------------------------------------
DEBUG: Execution getVersion
DEBUG: Execution stop
ERROR: Error during SonarQube Scanner execution
ERROR: The 'report' parameter is missing
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
Process returned exit code 1
The SonarQube Scanner did not complete successfully
Creating a summary markdown file...
Post-processing failed. Exit code: 1
G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
Peter PitLock
  • 1,823
  • 7
  • 34
  • 71
  • Your `begin` doesn't include a name parameter (`/n:"Foo"`). While the error message seems unrelated to that, I think the parameter is required for MSBuild analysis, so please try adding it to eliminate that possible source of error. – G. Ann - SonarSource Team Feb 15 '18 at 13:17
  • Hi G.Ann, thanks for update, I tried with the name parameter, but still experiencing unfortunately. I've posted updated question with some more detail – Peter PitLock Feb 15 '18 at 13:25
  • FYI @Peter PitLock, I've exhausted my expertise in the subject & tagged to hopefully draw the attention of the more knowledgeable. – G. Ann - SonarSource Team Feb 15 '18 at 13:29
  • No errors if you disable the sonarqube lines? What is the version number of SonarQube.Scanner.MSBuild.exe? – Jeroen Heier Feb 15 '18 at 18:34
  • @G.Ann-SonarSourceTeam - I added to this question in the form of an answer. I will be happy to delete this content once your team has a solution. – P.Brian.Mackey Apr 17 '18 at 18:46

6 Answers6

5

I've struggled the same problem with SonarQube and I've finally found a solution: You need to restart sonar service after using evaluation token.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
nocodename
  • 1,246
  • 9
  • 15
2

Please note this isn't the answer, however I feel this feedback is valuable to getting this question answered.

  1. I can reproduce this issue in POSTMan with a POST request to:

http://localhost:9000/api/ce/submit?projectKey=myProjectKey

This returns

{
    "errors": [
        {
            "msg": "The 'report' parameter is missing"
        }
    ]
}

You can get a similar error by removing the projectKey query parameter. I tried adding a report query parameter and received the same error:

http://localhost:9000/api/ce/submit?projectKey=brian3016&report=report

Given this, I feel there is a problem with their code. It should have included a report parameter when creating the POST request, but it failed to do so.

  1. Verbose output seems to have changed from using the -X switch to /d:sonar.verbose=true. E.G.

SonarScanner.MSBuild.exe begin /k:"myProjectKey" /d:sonar.host.url="http://localhost:9000" /d:sonar.login="myLogin" /d:sonar.verbose=true

Note the verbose logging didn't give me any valuable insight.

(Also note that the documentation currently says to use SonarQube.Scanner.MSBuild.exe, but the verbose logger told me to switch to SonarScanner.MSBuild.exe)

  1. SO...how we we report this issue to someone that can fix it? Their documentation says to go to Stackoverflow. So here we are.

  2. I thought it may have been an issue with a project. So I created a new project with nothing other than the startup template Console Application. Same error.

P.Brian.Mackey
  • 43,228
  • 68
  • 238
  • 348
2

In my case SonarQube 7.9.1 (deployed with Helm to Kubernetes cluster) was missing temp directory /opt/sonarqube/temp/tc/work/Tomcat/localhost/ROOT after Helm rollback. No idea what happened to it.

Logfile /opt/sonarqube/logs/web.log inside SonarQube pod had this error:

2021.02.02 06:57:03 WARN  web[AXdZ6l6MParQCncJACv3][o.s.s.w.ServletRequest] Can't read file part for parameter report
java.io.IOException: The temporary upload location [/opt/sonarqube/temp/tc/work/Tomcat/localhost/ROOT] is not valid

The fix was to exec into pod and create the missing directory. Would like to know the reason though...

apa64
  • 1,578
  • 1
  • 17
  • 26
1

The issue is with the sonar service starting up.

First try to stop the SonarStart.bat by using Ctrl+c, and then try to open localhost:9000 ( or whichever port you configured sonar server).

If it is still opening then go to task manager and search for wrapper.exe service and stop the service. If no service is found then go to:

Task manager>Details> and stop all java.exe process. 

enter image description here

Note: If you running many Java applications, right-click the java.exe and choose goto service, and stop only those java.exe that belongs to AppX deployment.services

Now start sonarstart.bat as administrator..

enter image description here

PDHide
  • 18,113
  • 2
  • 31
  • 46
1

today i face the same error when using jenkins to scanner the code. get the error when POST /api/ce/submit and get 400 code by add the sonar.verbose=true i use the below step to check reason

  1. first to restart the sonarqube => failed
  2. check the report file size by using "du -sh" get 108m and DB server support 1G => failed
  3. login the sonar-qube server and check the access.log, web.log and another log, finally find the error reason " Processing of multipart/form-data request failed. No space left on device", so i check the server by command "df -h", some devices are used 100% => so i remove some no-using file and fix it!!!
smallfatter
  • 171
  • 1
  • 1
  • 7
  • I just had the same problem here: my Linux server ran out of disk space and Sonarqube started to produce the `report parameter is missing` error. After deleting some unused files and restarting sonarqube, everything worked normal again. – Sky Mar 17 '22 at 11:10
0

check if you have enough memory ex: free -m In my case I had to upgrade memory.

Isuru Amarathunga
  • 2,127
  • 1
  • 20
  • 20