SourceMeter plugin for SonarQube 4.4 errors due to analyse.xml issue. Has anyone been able to resolve this? - sonarqube

I am evaluating SourceMeter plugin for SonarQube using SonarQube 4.4 and the plugin i downloaded from the SourceMeter website https://www.sourcemeter.com/download/. While i try to execute the code review for a Java project, it always gives me an error in the following line of the analyze.xml.
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: The following error occurred while executing this line:
E:\CI\SourceMeter-Java-6.0-x64-windows\analyze.xml:479: exec returned: 255
ERROR: Caused by: exec returned: 255
Line number 479 is as follows.
Could you please help me understand what could be the probable cause of this issue?

Tried the same (?) in this environment:
Windows 7
Maven built project
SonarQube
The problem seems to arise from Windows not treating quotes any special yielding problems when trying to start a java process:
"C:\dev\maven\repository\org\eclipse\persistence\javax.persistence\2.1.0\javax.persistence-2.1.0.jar" kann syntaktisch an dieser Stelle nicht verarbeitet werden. (meaning something like syntax error)
This is raised in some executeJANScript.bat containing the lines
set JOPTIONS="-j:|-cp ".;C:\dev\maven\repository\org\eclipse\persistence\javax.persistence\2.1.0\javax.persistence-2.1.0.jar;C:\..."" where the outer quotes should be omitted.

Related

Failed to start JFrog Open Source artifactory on Mac OS

I am trying to set-up JFrog OSS on mac-os. I followed all the instructions listed on the below installation page:
https://www.jfrog.com/confluence/display/JFROG/Installing+Artifactory#InstallingArtifactory-Mac(Darwin)Installation
But on starting the artifactory using command $JFROG_HOME/artifactory/app/bin/artifactoryctl as mentioned in Step-5 of above link, below error is appearing. Any clue of the fix?
$ $JFROG_HOME/artifactory/app/bin/artifactoryctl
/opt/jfrog/artifactory/app/bin/installerCommon.sh: line 2850: syntax error near unexpected token `>'
/opt/jfrog/artifactory/app/bin/installerCommon.sh: line 2850: ` JF_PRODUCT_HOME=${homeDir} ${VALIDATE_BINARY} run ${DIAGNOSTICSYAMLFILEPATH} &>>$SYSTEM_DIAGNOSTICS_LOG_FILE'
[ERROR] Unable to source /opt/jfrog/artifactory/app/bin/installerCommon.sh, please check if the adnansohail user has permissions to perform this action
Thanks for raising this. This is found and fixed in Artifactory 7.12. Please upgrade the version and try out.

Sonarqube : The 'report' parameter is missing

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.
Any idea on what could be wrong?
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
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.
Please note this isn't the answer, however I feel this feedback is valuable to getting this question answered.
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.
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)
SO...how we we report this issue to someone that can fix it? Their documentation says to go to Stackoverflow. So here we are.
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.
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...
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.
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..
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
first to restart the sonarqube => failed
check the report file size by using "du -sh" get 108m and DB server support 1G => failed
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!!!
check if you have enough memory
ex: free -m
In my case I had to upgrade memory.

Sencha app getting failed because of Failed creating background process and error occured

Sencha app getting failed because of Failed creating background process and error occured.
My app was getting failed then on StackOverflow I found some answer which is all about change ruby. I tried couple of ruby versions but didn't get any luck with that.
I have ruby 2.2.2 installed and I am trying to build my app. I am getting following error. This is very annoying.
** This Failed after change ruby, and I change ruby because of the next error**
BUILD FAILED [ERR] com.sencha.exceptions.ExProcess: Failed
creating background process [ERR] java.io.IOException: Cannot run
program "ruby" (in directory
"C:\User\MasterBuild\trunk\1\1\1\1\AppName\build\temp\production\AppName\sass"):
CreateProcess error=2, The system cannot find the file specified
And these are the actual error.
[ERR] The following error occurred while executing this line:
C:\1\MasterBuild\trunk\1\1\1\1\AppName.sencha\app\build-impl.xml:284:
The following error occurred while executing this line:
C:\1\MasterBuild\trunk\1\1\1\1\AppName.sencha\app\sass-impl.xml:155:
The following error occurred while executing this line:
C:\1\MasterBuild\trunk\1\1\1\1\AppName.sencha\app\sass-impl.xml:176:
com.sencha.exceptions.ExProcess: Failed creating background process
Can anyone please give some suggestion how to fix that. Thanks for all help.

Sonar-web-frontend-helloworld execution error

I am running the hello world example
I generate the reports but when i come to run the sonar scan i get the very unhelpful exception of
-----------
09:42:56.279 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalArgumentException: 0 is not a valid line for a file
at org.sonar.api.internal.google.common.base.Preconditions.checkArgument
(Preconditions.java:145)
[![Error description][1]][1]
Seems like a bug in the plugin that you use - https://github.com/groupe-sii/sonar-web-frontend-plugin
SonarQube API clearly states that first line in a file has number 1, but plugin passes 0.

SonarQube analysis fails after upgrade to 3.7.1 rules

Using SonarQube 5.2 - just the "click and go" distribution downloaded yesterday and running under Windows. Nothing fancy.
After upgrading the "Java" rules package from the bundled 3.6 version to 3.7.1, the sonar runner then fails during analysis.
There's a long stacktrace that is revealed when running with '-e' option however there is no detail on where in the file it failed (line-number, method) or which rule failed.
I have pared down the stack-trace to what I believe are the useful bits:
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
...
Caused by: org.sonar.squidbridge.api.AnalysisException: SonarQube is unable to analyze file : 'C:\Users\robert.rusk\Documents\cvs\ip_probe\src\com\robert\splat\MyClass.java'
...
Caused by: java.lang.IndexOutOfBoundsException: index (1) must be less than size (1)
...
at org.sonar.java.checks.PrintfCheck.verifyParameters(PrintfCheck.java:173)
at org.sonar.java.checks.PrintfCheck.onMethodInvocationFound(PrintfCheck.java:112)
...
You are encoutering the following issue : https://jira.sonarsource.com/browse/SONARJAVA-1369
It happens when you have a parameter with %< during the printf check (rule squid:S2275).
Issue has been fixed (few minutes ago for the record ;) ) and should be part of next release bound to happen within the next few days.
After some investigation I now believe the error occurs because String.format is called without enough parameters (should be 2), and when I comment out this line the analysis then runs without any problems.
splatDateStr = String.format("%tFT%<tRZ", splatDate);
I guess this is the PrintfCheck that is referred to in the stack-trace.

Resources