Sonarqube : The 'report' parameter is missing

12,166

Solution 1

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.

Solution 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...

Solution 3

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.

Solution 4

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!!!

Solution 5

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

Share:
12,166
Peter PitLock
Author by

Peter PitLock

Updated on June 28, 2022

Comments

  • Peter PitLock
    Peter PitLock almost 2 years

    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
      G. Ann - SonarSource Team about 6 years
      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.
    • Peter PitLock
      Peter PitLock about 6 years
      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
    • G. Ann - SonarSource Team
      G. Ann - SonarSource Team about 6 years
      FYI @Peter PitLock, I've exhausted my expertise in the subject & tagged to hopefully draw the attention of the more knowledgeable.
    • Jeroen Heier
      Jeroen Heier about 6 years
      No errors if you disable the sonarqube lines? What is the version number of SonarQube.Scanner.MSBuild.exe?
    • yairr
      yairr about 6 years
      @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.
  • Sky
    Sky about 2 years
    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.