Sonar scanner configuration issue - sonarqube

After running sonar scanner it throws error: ERROR: Error during SonarQube Scanner execution
java.lang.NoSuchMethodError: org.sonar.api.resources.Project.getAnalysisType()Lorg/sonar/api/resources/Project$AnalysisType;
at org.sonar.plugins.surefire.SurefireSensor.shouldExecuteOnProject(SurefireSensor.java:48)
I have SonarQube 7.1 and sonar-scanner-4.0.0.1744-windows installed. Both of them added to path as environment variable till bin.
The sonar-scanner.properties file contains:
sonar.projectKey=Java_Project
sonar.projectName=Java_Project
sonar.projectVersion=1.0
sonar.sources=<path of the project path>/bin
sonar.java.binaries=.
It is throwing error. Will appreciate your help

Related

Reports not getting uploaded on SonarCloud after Analysis, Throws Project not found

I'm trying to setup SonarCloud on my Azure Pipelines. I have added sonar-project.properties file in the root of my repository which contains the below parameters:
sonar.projectKey=xxxx_xxxxxxxxx
sonar.organization=xxxxx
sonar.projectName=xxxxxxxxx
sonar.projectVersion=1.0
sonar.sources=.
sonar.sourceEncoding=UTF-8
I have added a service connection as well after generating a token from SonarCloud, I'm added as member in the organization.
While running the code analysis, it analyses the code, completes the analysis and then fails with an error below:
##[error]ERROR: Error during SonarScanner execution
ERROR: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
ERROR: Error during SonarScanner execution
ERROR: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
Can someone please help me with how we can fix this ?

CNES report throws error "{"errors":[{"msg":"An error has occurred. Please contact your administrator"}]}"

I have sonarqube 7.1 and sonar-scanner-cli-3.0.2.768 installed. I have added the sonar-cnes-report.jar in the sonarqube plugins folder. After running the sonar-scanner it creates a folder "scanner-report" in root directory but it doesnot have any proper report except some pb files.
In the sonarqube web, if I select the project in the "cnes report" menu, it throws error
Please help me in this issue.

Unable to generate allure report in jenkins

getting the following error.
screenshot is also attached.
basically .bat is not getting generated.
ERROR: Step ‘Allure Report’ aborted due to exception:
java.io.IOException: Failed to rename C:\Users\dell\.jenkins\tools\ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation\allure2\allure-2.4.1 to C:\Users\dell\.jenkins\tools\ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation\allure2\allure-2.4.1.__rename
Now its working.
There is problem in allure command installation.
Maven central installer is giving error
Tried by giving link in jenkins global tool configuration and its working
Link : https://bintray.com/qameta/generic/download_file?file_path=io%2Fqameta%2Fallure%2Fallure%2F2.4.1%2Fallure-2.4.1.zip
I faced the same issue when configured with the latest version of Maven under Jenkins->Global Tool Configurations->Allure Commandline. Once i downgraded the Maven version I was able to generate allure reports successfully.
I had the same problem. In my case it was enough to delete allure-jenkins plugin from the list of plugins in Jenkins.

Error during SonarQube Scanner execution

I'm running sonar-runner inside my project folder
I have put and configured the sonar-runner.properties in my project as well. But still the execution Sonar failed. Any idea as to what could be the problem ?
If project configuration file(sonar-project-properties) is being ignored then what is the workaround. Pl suggest asap.
This error is telling you that the Scanner is not finding your project properties. That is likely because the default name of the file is not sonar-runner.properties, nor sonar-project-properties, but sonar-project.properties.

Sonar.Branch parameter is throwing error in SonarQube 5.0

People,
With new SonarQube version for C# plugin -Dsonar.branch=X parameter is throwing error. The error is as follows:-
Sonar failed with error: 'ERROR: Error during Sonar runner executionERROR: Unable to execute SonarERROR: Caused by: Fail to decorate 'org.sonar.api.resources.File#56b0f44f[key=Aspects/MethodPerformanceAttribute.cs,deprecatedKey=Aspects/MethodPerformanceAttribute.cs,path=Aspects/MethodPerformanceAttribute.cs,dir=Aspects,filename=MethodPerformanceAttribute.cs,language=C#]'ERROR: Caused by: Resource org.sonar.api.resources.File#56b0f44f[key=Aspects/MethodPerformanceAttribute.cs,deprecatedKey=Aspects/MethodPerformanceAttribute.cs,path=Aspects/MethodPerformanceAttribute.cs,dir=Aspects,filename=MethodPerformanceAttribute.cs,language=C#] was not found in InputPath cacheERROR
This error goes away and sonar run is succeessful if i remove the -Dsonar.branch parameter. Can someone provide more information on this.
This issue has been solved in SonarQube 5.1, see http://jira.codehaus.org/browse/SONAR-6250 for additional details.

Resources