0

升级到 3.5.1 后,我们的 Sonar 在我们的一台从机(我们有 1 台主机和 3 台从机)中显示 INVALID HASH 错误。我发现 C:\Users\xxxxx.sonar\cache_tmp 下的所有文件大小都为零。但其他目录如 C:\Users\xxxxx.sonar\cache\1b8de6f094e072c092b4ef1b332fdbf0 仍然有文件(如 commons-dbcp-1.3.jar)并且文件是正确的。

这是错误消息,有什么建议吗?

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project XXXXXXXX: Can not execute Sonar: INVALID HASH: File C:\Users\xxxxx\.sonar\cache\_tmp\1374226573512-28 was expected to have hash 099c91d9bb47f3c7f98b0e1825f593df but was downloaded with hash d41d8cd98f00b204e9800998ecf8427e -> [Help 1]
17:36:11 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project XXXXXXXX: Can not execute Sonar
17:36:11    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
17:36:11    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
17:36:11    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
17:36:11    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
17:36:11    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
17:36:11    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
17:36:11    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
17:36:11    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
17:36:11    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
17:36:11    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
17:36:11    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
17:36:11    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
17:36:11    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
17:36:11    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
17:36:11    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
17:36:11    at java.lang.reflect.Method.invoke(Method.java:597)
17:36:11    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
17:36:11    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
17:36:11    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
17:36:11    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

添加 'SONAR_USER_HOME' 环境变量( http://docs.codehaus.org/display/SONAR/Frequently+Asked+Questions#FrequentlyAskedQuestions-INVALIDHASH)后它仍然不起作用

4

3 回答 3

0

您应该尝试删除本地缓存。文件在下载过程中损坏。常见问题解答将被更新。谢谢

于 2013-07-22T07:02:30.403 回答
0

我遇到了同样的问题,

解决方案用户主目录中存在空间问题,所以我在用户主目录中创建了一个软链接 .sonar 到 tmp 目录,它可以工作,或者你可以通过 sonar.userHome=/usr/tmp 让它工作。

在 Jenkins 上运行声纳 Qube 时出现问题

SonarQube Runner 2.3
Java 1.7.0_75 Oracle Corporation (64-bit)
Linux 2.6.32-504.12.2.el6.x86_64 amd64
INFO: Runner configuration file: NONE
INFO: Project configuration file: /usr/local/build/jenkins_home/head_fast_gradle/workbench/build/tmp/sonarRunner/sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "US-ASCII" (analysis is platform dependent)
INFO: Work directory: /usr/local/build/jenkins_home/head_fast_gradle/workbench/build/sonar
INFO: SonarQube Server 4.5.4
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 0.487s
Final Memory: 3M/481M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Fail to download libraries from server
ERROR: Caused by: INVALID HASH: File /fmac/users/bldmgr/.sonar/cache/_tmp/1432846057632-440 was expected to have hash 60dd4c0ee91e594a20faa75f80182956 but was downloaded with hash d41d8cd98f00b204e9800998ecf8427e
ERROR: 
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
:sonarRunner FAILED
于 2015-05-28T21:37:02.393 回答
0

当我检查这个网址http://mysonar:9000/sonar/api/plugins/installed时,一个插件的哈希值不正确。我重新启动了声纳服务器,并且这个 url 的哈希值被更新为正确的值。

请注意,插件的 jar 没有在服务器上修改。在我的情况下,损坏不在缓存中,而是在服务器本身中。

我使用声纳 6.7 版。

于 2019-02-20T14:59:52.537 回答