简体   繁体   English

SonarLint for Eclipse Neon无法连接到SonarQube服务器

[英]SonarLint for Eclipse Neon not connection to SonarQube server

I currently cannot connect to my SonarQube server using SonarLint in Eclipse Neon. 我目前无法使用Eclipse Neon中的SonarLint连接到我的SonarQube服务器。 Installation details can be found at the bottom of this post. 安装细节可以在本文的底部找到。

After opening the view to add the SonarQube server via Menu/Window/Show View/Other/SonarQube Servers , I entered the url of my webinterface: http://10.231.83.124:9000 打开视图以通过菜单/窗口/显示视图/其他/ SonarQube服务器添加SonarQube服务器后 ,我输入了我的网络界面的URL: http://10.231.83.124:9000//10.231.83.124:9000

Then I add the username and password I use to login via webinterface. 然后我添加用于通过webinterface登录的用户名和密码。 When pressing the button Test Connection , I get the following stacktrace inside the SonarQube console: 当按下Test Connection按钮时,我在SonarQube控制台中获得以下堆栈跟踪:

Unable to update data from server xxx: 无法从服务器xxx更新数据:

java.lang.IllegalStateException
    at org.sonarsource.sonarlint.core.container.connected.SonarLintWsClient.handleError(SonarLintWsClient.java:123)
    at org.sonarsource.sonarlint.core.container.connected.validate.ServerVersionAndStatusChecker.fetchServerInfos(ServerVersionAndStatusChecker.java:102)
    at org.sonarsource.sonarlint.core.container.connected.validate.ServerVersionAndStatusChecker.checkVersionAndStatus(ServerVersionAndStatusChecker.java:61)
    at org.sonarsource.sonarlint.core.container.connected.validate.ServerVersionAndStatusChecker.checkVersionAndStatus(ServerVersionAndStatusChecker.java:51)
    at org.sonarsource.sonarlint.core.WsHelperImpl.validateConnection(WsHelperImpl.java:48)
    at org.sonarsource.sonarlint.core.WsHelperImpl.validateConnection(WsHelperImpl.java:43)
    at org.sonarlint.eclipse.core.internal.server.Server.testConnection(Server.java:323)
    at org.sonarlint.eclipse.ui.internal.server.wizard.ServerConnectionTestJob.run(ServerConnectionTestJob.java:44)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

As I could not find any information regarding my issue on the net, I am now hoping for some help by posting my issue online. 由于我无法在网上找到有关我的问题的任何信息,我现在希望通过在线发布我的问题获得一些帮助。 I can provide the following additional background information: 我可以提供以下附加背景信息:

eclipse.buildId=4.6.1.M20160907-1200
java.version=1.8.0_111
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -data file:/opt/workspace/ -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product

I could not install SonarLint via Marketplace due to an error stating, that the content was not available. 由于错误说明内容不可用,我无法通过市场安装SonarLint。 This is, why I then manually downloaded the zip-file from https://bintray.com/sonarsource/SonarLint-for-Eclipse/releases/3.0.0 and installed the plugin into Eclipse using Menu/Help/Install New Software... 这就是为什么然后我从https://bintray.com/sonarsource/SonarLint-for-Eclipse/releases/3.0.0手动下载zip文件并使用Menu / Help / Install New Software将插件安装到Eclipse中。 。

I am working on (cat /proc/version): 我正在研究(cat / proc / version):

Linux version 3.16.0-4-amd64 (debian-kernel@lists.debian.org) (gcc version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19)

The SonarQube server version is: v6.2 The server has the following plugin versions installed (Menu > Administratoion > System > Update Center > Installed: SonarQube服务器版本为:v6.2服务器安装了以下插件版本(菜单>管理员>系统>更新中心>已安装:

  • C# 5.5.1.522 C#5.5.1.522
  • Git 1.2 Git 1.2
  • Java 4.3.0.7717 Java 4.3.0.7717
  • JavaScript 2.18.0.3454 JavaScript 2.18.0.3454
  • SVN 1.3 SVN 1.3

I can provide the following information regarding the eclipse installation: Version: Neon.1a Release (4.6.1) Build id: 20161007-1200 我可以提供有关eclipse安装的以下信息: 版本:Neon.1a Release(4.6.1)Build id:20161007-1200

The version of SonarLint is 3.0.0.201704111237 (see above download link: bintray.com/sonarsource/SonarLint-for-Eclipse/releases/3.0.0‌​). SonarLint的版本是3.0.0.201704111237(参见上面的下载链接:bintray.com/sonarsource/SonarLint-for-Eclipse/releases/3.0.0)。 I can also ping my server on the provided ip. 我也可以在提供的ip上ping我的服务器。 According to the webiste (sonarlint.org/eclipse), SonarLint is compatible to all SonarQube versions of 5.6 or above. 根据网站(sonarlint.org/eclipse),SonarLint与5.6或更高版本的所有SonarQube版本兼容。 Also checked my Java version being used: java version "1.8.0_111" Java(TM) SE Runtime Environment (build 1.8.0_111-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode) 还检查了我正在使用的Java版本:java版本“1.8.0_111”Java(TM)SE运行时环境(版本1.8.0_111-b14)Java HotSpot(TM)64位服务器VM(版本25.111-b14,混合模式)

org.eclipse.equinox.p2.core.ProvisionException: Unable to read repository at sonarsource.bintray.com/SonarLint-for-Eclipse/releases/3.0.0‌​/…. ...Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

The problem seems to be missing certificates in the JVM. 问题似乎是缺少JVM中的证书。 To add the certificates, use the following online-guide: connect2id.com/blog/importing-ca-root-cert-into-jvm-trust-st‌​ore 要添加证书,请使用以下在线指南:connect2id.com/blog/importing-ca-root-cert-into-jvm-trust-st ore

After fixing the certificate issue, I deinstalled the plugin and reinstalled it using Eclipse Marketplace. 修复证书问题后,我卸载了该插件并使用Eclipse Marketplace重新安装它。 Still getting the same error upon trying to connect to the Sonarqube server: 尝试连接Sonarqube服务器时仍然遇到相同的错误:

Starting SonarLint for Eclipse 3.0.0.201704111237 SonarLint analysis of file /participant/pom.xml... Starting standalone SonarLint engine 3.0.0.201704111237... Found 0 issue(s) SonarLint analysis of file /participant/src/test/java/de/mycompany/services/an/Particip‌​antTest.java... Found 0 issue(s) SonarLint analysis of project participant (3 files)... Found 3 issue(s) java.lang.IllegalStateException [...]

Uninstalled eclipse, reinstalled ecilpse neon 3 instead of 1a and installed plugin SonarLint via Marketplace. 卸载eclipse,重新安装ecilpse neon 3而不是1a,并通过Marketplace安装插件SonarLint。 Same issue again after hitting the button "Test connection": It starts listing the files and then it generates a stacktrace in the console as initially posted and shown in the last comment of mine. 按下“测试连接”按钮后再次出现相同问题:它开始列出文件,然后在控制台中生成最初发布的堆栈跟踪,并显示在我的最后一条评论中。

When setting up the server to connect to, I enter the port as part of the URL: 10.20.30.40:9000. 设置要连接的服务器时,我输入端口作为URL的一部分:10.20.30.40:9000。 Is this correct? 这个对吗? If I do not provide the port 9000, error 503 is returned. 如果我不提供端口9000,则返回错误503。 I also entered a wrong IP just to see, if I get a different error message. 如果我收到不同的错误消息,我也输入了一个错误的IP只是为了看。 I got the same error again - no difference. 我再次遇到同样的错误 - 没有区别。 It seems as if the server is not there at all, but I can ping the server. 似乎服务器根本就不存在,但我可以ping服务器。

I also tried the SonarLint-Plugin for IntelliJ and had the same problem connecting to the server. 我还尝试了IntelliJ的SonarLint-Plugin,并且在连接服务器时遇到了同样的问题。

The permissions on my SonarQube server is setup as follows: I added a new group myGroup to the existing ones called Anyone and sonar-administrators. 我的SonarQube服务器上的权限设置如下:我将一个新组myGroup添加到名为“任意”和“声纳管理员”的现有组中。

Global Permissions: (order = Administer system, Administer Quality Profiles, Administer Quality Gates, Execute Analysis, Create Projects) 全局权限:(订单=管理系统,管理质量配置文件,管理质量门,执行分析,创建项目)

  • Anyone: 0,0,0,1,0 任何人:0,0,0,1,0
  • sonar-administrators: 1,1,1,1,1 声纳管理员:1,1,1,1,1
  • myGroup: 0,0,0,1,0 myGroup:0,0,0,1,0

Additionally, I configured the permission templates, by setting the Default template the following way: (order = Browse, See Source Code, Administer issue, Administer, Execute Analysis) 此外,我通过以下方式设置默认模板来配置权限模板:(顺序=浏览,请参阅源代码,管理问题,管理,执行分析)

  • Project creators: 1,1,1,1,1 项目创建者:1,1,1,1,1
  • Anyone: 1,0,0,0,0 任何人:1,0,0,0,0
  • sonar-administrators: 0,0,1,1,0 声纳管理员:0,0,1,1,0
  • myGroup: 1,1,0,0,1 myGroup:1,1,0,0,1

Thanks a lot for any help. 非常感谢您的帮助。

Regards, Daniel 问候,丹尼尔

SonarQube and SonarLint need to have compatible versions. SonarQube和SonarLint需要兼容版本。 Your SonarQube is 6.2, what about your SonarLint? 您的SonarQube是6.2,您的SonarLint怎么样? I got a similar error by installing the latest SonarLint for a much older SonarQube. 通过为更老的SonarQube安装最新的SonarLint,我遇到了类似的错误。

Moreover, just to set aside any network issue, can you ping your SonarQube server? 此外,只是为了预留任何网络问题,你能ping你的SonarQube服务器吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM