12

I following the official support of sonarqub http://docs.sonarqube.org/display/SONAR/SCM+support

and I got the error at above.

did I miss something need to config, or configure wrong

08:46:33.723 INFO - Sensor SCM Sensor...
08:46:33.897 INFO - SCM provider for this project is: git
08:46:33.898 INFO - Retrieve SCM blame information...
08:46:33.915 INFO - 632 files to be analyzed
08:46:34.377 INFO - Author: PersonIdent[Not Committed Yet, , Tue Feb 3 08:46:34 2015 +0000]
08:46:34.379 INFO - Source commit: null
08:46:34.377 INFO - Author: PersonIdent[Not Committed Yet, , Tue Feb 3 08:46:34 2015 +0000]
08:46:34.924 INFO - Source commit: null
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 1:01.699s
08:46:35.891 INFO - Author: PersonIdent[Not Committed Yet, , Tue Feb 3 08:46:35 2015 +0000]
08:46:34.930 INFO - Author: PersonIdent[Not Committed Yet, , Tue Feb 3 08:46:34 2015 +0000]
08:46:35.930 INFO - Source commit: null
Final Memory: 27M/318M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to blame file

thanks very much.

Han Jubel
  • 153
  • 1
  • 1
  • 5
  • Same thing here, I even fixed the line endings (known issue), but that didn't help it. Possibly it is a side-effect from another SCM plugin or the maven library. Have you tried disabling all other SCM related plugins? – Stephan Feb 03 '15 at 15:04
  • 1
    Got it working with adding `sonar.scm.disabled=true` to my sonar.properties files for now. Perhaps that will help you until it is fixed. – Stephan Feb 04 '15 at 10:23
  • @Stephan thanks, I tried, but it doesn't work for me. – Han Jubel Feb 09 '15 at 03:59
  • 1
    @Stephan adding it to my sonar.properties file did not work (SonarQube 5.0.1). However, adding it as 'additional property' in my Jenkins Sonar configuration did. – Adriaan Koster Apr 01 '15 at 13:59
  • Where can we provide the jazz repository URL in sonar? – Nayeem Aug 19 '15 at 12:21

1 Answers1

13

This is because when running an analysis, SonarQube expects that all files should be committed.

Indeed, SonarQube assumes that when you run a standard analysis (that pushes data to the server), there should not be any uncommitted changes on a single file of the project, because this would potentially push information that won't be relevant with the real source code on the repository. That's why the analysis will fail.

This is obviously not the case when you run a preview analysis: as this kind of analysis does not push data to the server and only reports issues locally, then it's not a problem to have uncommitted changes and the analysis will therefore not fail.

I've updated the documentation to make this clearer.

  • This is also not the case for generated code unfortunately. We generate Unit Tests form Jnario code. – ILikeCoffee Feb 06 '15 at 15:21
  • 1
    SonarQube looks pretty awesome, but it's tough getting started when you are not using Jenkins for CI. Clearer documentation would be quite useful for beginners like myself. – Genti Saliu Jan 08 '16 at 16:48
  • @fabrice-sonarsource-team We use Gitlab and I am trying to have Sonar identify git as scm. I face the issue in Sonar 5.6.3 even after getting the Gitlab plugin from https://github.com/gabrie-allaigre/sonar-gitlab-plugin/ and putting in SONARQUBE_HOME/extensions/plugins and restarting SonarQube. when I point maven project to the SonarQube server with maven pom having entry, I get this error : Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.5.0.1254:sonar on project : SCM provider was set to "git" but no SCM provider found for this key. No SCM provider installed – Rahul Saini Nov 05 '18 at 12:34