SonarQube不能怪文件

时间:2018-01-24 10:32:39

标签: jenkins svn sonarqube sonarqube-scan

在使用SonarQube进行代码检查期间,我遇到了这种错误

java.lang.IllegalStateException: Error when executing blame for file some/file/in/project/file.hpp
    at org.sonar.plugins.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:85)
    at org.sonar.plugins.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:58)
    at org.sonar.scanner.scm.ScmPublisher.publish(ScmPublisher.java:85)
    at org.sonar.scanner.phases.PublishPhaseExecutor.afterSensors(PublishPhaseExecutor.java:60)
    at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:90)
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:180)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
    at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:288)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:283)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:261)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
    at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
    at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
    at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:121)
    at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:111)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
    at com.sun.proxy.$Proxy0.execute(Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
    at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
    at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
    at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
    at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: org.tmatesoft.svn.core.SVNException: svn: E204899: Cannot delete file 'C:\Path\to\project\.svn\tmp\annotate.3.tmp\annotate.tmp'
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:70)
    at org.tmatesoft.svn.core.internal.wc.SVNFileUtil.deleteFile(SVNFileUtil.java:1342)
    at org.tmatesoft.svn.core.internal.wc.SVNFileUtil.deleteAll(SVNFileUtil.java:1314)
    at org.tmatesoft.svn.core.internal.wc.SVNFileUtil.deleteAll(SVNFileUtil.java:1305)
    at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteAnnotate.run(SvnRemoteAnnotate.java:143)
    at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteAnnotate.run(SvnRemoteAnnotate.java:30)
    at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21)
    at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1235)
    at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
    at org.tmatesoft.svn.core.wc.SVNLogClient.doAnnotate(SVNLogClient.java:295)
    at org.sonar.plugins.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:83)
    ... 31 more

一些其他信息

  • 此项目已在Jenkins工作中检出。
  • 没有其他项目以同样的方式检查出现此类错误。
  • 这个项目是一个大项目,所以代码检查需要几个小时。
  • 我可以在错误消息(some/file/in/project/file.hpp)中将此文件归咎于TortoiseSVN。
  • 我正在使用SonarQube 6.7.1 LTS
  • SVN的SonarQube插件版本为1.6.0.860
  • svn --version给了我这个输出,所以它似乎是最新的:
svn, version 1.9.7 (r1800392)
   compiled Aug  8 2017, 22:14:48 on x86-microsoft-windows

Copyright (C) 2017 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/

The following repository access (RA) modules are available:

* ra_svn : Module for accessing a repository using the svn network protocol.
  - with Cyrus SASL authentication
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - using serf 1.3.9 (compiled with 1.3.9)
  - handles 'http' scheme
  - handles 'https' scheme

The following authentication credential caches are available:

* Wincrypt cache in C:\Users\User\AppData\Roaming\Subversion

我做了什么

  • 在SonarQube服务器上的“管理”下 - > SCM,我添加了凭据。
  • 在进行SonarQube检查之前,我现在正在进行svn upgrade。当我没有做svn upgrade时,出现了同样的错误。

有没有人有想法,我能做些什么来解决这个问题?

1 个答案:

答案 0 :(得分:1)

在jenkins的“ Execute SonarQube扫描仪”插件中,可以给scm禁用参数吗? -Dsonar.scm.disabled =真

如果这不起作用,则必须在sonarqube中禁用scm参数。 从项目->常规设置-> SCM->禁用SCM传感器。您必须禁用soarqube才能查找源代码。