Phoenix_133
Phoenix_133

Reputation: 13

SonarLint for Eclipse Neon not connection to SonarQube server

I currently cannot connect to my SonarQube server using SonarLint in Eclipse Neon. 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

Then I add the username and password I use to login via webinterface. When pressing the button Test Connection, I get the following stacktrace inside the SonarQube console:

Unable to update data from server 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. 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...

I am working on (cat /proc/version):

Linux version 3.16.0-4-amd64 ([email protected]) (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:

I can provide the following information regarding the eclipse installation: Version: 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‌​). I can also ping my server on the provided ip. According to the webiste (sonarlint.org/eclipse), SonarLint is compatible to all SonarQube versions of 5.6 or above. 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)

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. To add the certificates, use the following online-guide: 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. Still getting the same error upon trying to connect to the Sonarqube server:

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. 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. Is this correct? If I do not provide the port 9000, error 503 is returned. I also entered a wrong IP just to see, if I get a different error message. 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.

I also tried the SonarLint-Plugin for IntelliJ and had the same problem connecting to the server.

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.

Global Permissions: (order = Administer system, Administer Quality Profiles, Administer Quality Gates, Execute Analysis, Create Projects)

Additionally, I configured the permission templates, by setting the Default template the following way: (order = Browse, See Source Code, Administer issue, Administer, Execute Analysis)

Thanks a lot for any help.

Regards, Daniel

Upvotes: 1

Views: 2731

Answers (1)

Jacopo Lanzoni
Jacopo Lanzoni

Reputation: 1316

SonarQube and SonarLint need to have compatible versions. Your SonarQube is 6.2, what about your SonarLint? I got a similar error by installing the latest SonarLint for a much older SonarQube.

Moreover, just to set aside any network issue, can you ping your SonarQube server?

Upvotes: 0

Related Questions