Error on Publish Quality Gate Result in Azure DevOps Release pipeline - sonarqube

In my particular case I have to run the sonar analysis in the release, I can’t do it in the pipeline because it depends on the environment.
I have been using sonar in azure devops for several years but always running sonar from the pipeline
In this very special case I have to run the sonar in the release and this is where the error occurs.
Error in: Publish Quality Gate Result:
##[error]The "path" argument must be of type string. Received type undefined
enter image description here
enter image description here
Run Code Analysis: no Warning and no error:
enter image description here
if i run it manually on my pc it works fine:
sonar-scanner.bat -D"sonar.projectKey=SQLAA" -D"sonar.sources=Develop" -D"sonar.host.url=https://sssss.ssss.uuuu" -D"sonar.login=nnnnnnnnnnnn" -D"sonar.sql.dialect=tsql" -D"sonar.language=sql" -D"sonar.exclusions=DefinitionName/**" -D"sonar.scm.disabled=true" -D"sonar.verbose=true"
I use standalone scanner
is a simple release
enter image description here
It was tried as seen in the images, but it gives an error

Related

Cannot use object of type Illuminate\Support\Facades\Config as array error while running test commad with coverage report

I have one project with Laravel 9 and I am performing testing with coverage report on it, The test cases successfully passed but I'm getting the below error, and if I remove --coverage-html tmp/coverage from command it's working fine. It means this error are occurring while generating a coverage report.
Please help me to figure out this issue.
Command:
XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-html tmp/coverage
Error:
Generating code coverage report in HTML format ... Cannot use object of type Illuminate\Support\Facades\Config as array
Note: I haven't written any new test cases it has only default two test files which come with the default laravel setup.

dcl deploy : Build /scene in production mode failed

dcl deploy
secp256k1 unavailable, reverting to browser version
× Build /scene in production mode failed
Error: dcl deploy Error: Error while building the project, run "dcl help deploy" for more info.
I get this error whenever I run "dcl deploy". Moreover, I tried it with --skip-build and it works fine though the --skip-build also show an error:
√ Building scene in production mode
√ Deployment structure created.
× Invalid scene.json: should NOT have additional properties
You need to sign the content before the deployment:
√ Validating scene.json
Here are the screenshots:
enter image description here

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.

SonarQube Build Breaker plugin: Report processing did not complete successfully: FAILED

I am trying to upload reports generated by Istanbul to Sonar dashboard using a gulp task and it fails with the below error. Looks like the Build Breaker plugin in SonarQube is timing out before it can upload the report to Sonar. Any way that i can tweak this plugin?
I am using Sonar 5.3.
15:42:43.411 INFO: Analysis report generated in /workspace/{project}/.sonar/report
15:42:43.430 INFO: ------------------------------------------------------------------------
15:42:43.430 INFO: EXECUTION FAILURE
15:42:43.430 INFO: ------------------------------------------------------------------------
15:42:43.430 INFO: Total time: 5:06.287s
15:42:43.609 INFO: Final Memory: 57M/2603M
15:42:43.609 INFO: ------------------------------------------------------------------------
15:42:43.609 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Report processing did not complete successfully: FAILED
at org.sonar.plugins.buildbreaker.QualityGateBreaker.getAnalysisId(QualityGateBreaker.java:152)
at org.sonar.plugins.buildbreaker.QualityGateBreaker.execute(QualityGateBreaker.java:108)
at org.sonar.plugins.buildbreaker.QualityGateBreaker.executeOn(QualityGateBreaker.java:95)
at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:65)
at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:55)
This is a known invalid issue: #14 (he problem occurs on the server side, not in Build Breaker mechanism/logic).
Matthew DeTullio's comment:
This is because the server side background task for your project is
failing. You need to check the logs there and fix that problem first.
The report processing step is when SQ computes the quality gate
status. This plugin simply checks the status computed there, so if
processing fails this plugin will mark the analysis a failure.
In my company we found on the server side:
java.lang.OutOfMemoryError: GC overhead limit exceeded
The reason could be any error in the SonarQube processing of background task.
And the error is very generic like below
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Report processing did not complete successfully: FAILED
In my case, the server on which SonarQube is installed, ran out of disk space hence it was not able to write the logs.
So, the idea is to check sonar.log to understand whats wrong and rectify it, restart SonarQube service.
less <SONAR_INSTALL_DIR>/logs/sonar.log
2021-03-28 01:13:25,124 elasticsearch[sonarqube][management][T#3] ERROR An exception occurred processing Appender file_es org.apache.logging.log4j.core.appender.AppenderLoggingException: Error writing to stream /apps/sonarqube-8.3.0.34182/logs/es.log
Reboot the Sonar service
cd <SONAR_INSTALL_DIR>/bin
./sonar.sh stop
./sonar.sh start

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