Not able to connect to sonarqube server using sonarlint version 4.0.0.201810170711

sonarlint

(Ravi Bharathi Krishnan) #1
  • versions:
    Sonarlint - 4.0.0.201810170711
    Eclipse - Eclipse Java EE IDE for Web Developers - Version: Photon Release (4.8.0) - Build id: 20180619-1200

  • error observed
    Not able to create a connection to the sonarqube server suing “Connect to a sonarqube server” wizard. Able to go thru all the steps till the last one and on the last steps clicking “Finish” button not closing the connection wizard.

  • steps to reproduce

    1. Open SonarLint Bindings tab
    2. Click “Connect to a sonarqube server”
    3. Select “Sonarqube” and click next
    4. Give your companies sonarqube server link “https://sonarqube.<your_company>.com”
    5. Give your credentials (either user name/password or token)
    6. Give a connection name
    7. At the last step, click “Finish” and observe connection dialog not getting closed, clicking “cancel” only closes the dialog and no connection is established
  • potential workaround
    NONE


(Gilbert Rebhan) #2

Hi,
AFAIK, the SLE 4.0 plugin is only released internal, but not available yet for download at https://www.sonarlint.org/eclipse/ - means not released official.
Seems you use some development version !?
Regards,
Gilbert


(Ravi Bharathi Krishnan) #3

I got software update notification in my eclipse and I updated to the new version. I did not know that it is internal version


(Gilbert Rebhan) #4

Hi,
ok that’s interesting. We use https://sonarsource.bintray.com/SonarLint-for-Eclipse/releases/ as update site
which has 3.6.0 as latest version, there’s no 4.x
Does the Sonarlint console view / verbose ouput reveal something useful ?
Regards,
Gilbert


(Ravi Bharathi Krishnan) #5

No errors on the console / verbose output


(Gilbert Rebhan) #6

Hi,
what is the URL of your updatesite ?
Regards,
Gilbert


(Ravi Bharathi Krishnan) #7

Hi Gilbert,
This is the update site URL I am using http://marketplace.eclipse.org/content/sonarlint

regards
Ravi Bharathi


(Gilbert Rebhan) #8

Hi,
we can’t use the Eclipse marketplace, all of our Eclipse plugins are updated via Sonatype Nexus P2 proxy.
I’m a bit confused, as also at https://www.sonarsource.com/resources/product-news/ and here in the community forum there is no news about the release of SLE 4.0 ?!
From the comments at http://marketplace.eclipse.org/content/sonarlint it seems you’re not the only one with that problem related to Eclipse Photon (4.8).
Hope this gets cleared up by the Sonarlint team soon, as we’ve planned to update to SLE 4.0 under Eclipse Photon as soon as it is official available. With SLE 3.6.0 there are no problems in Eclipse Photon.
Regards,
Gilbert


(Ravi Bharathi Krishnan) #9

Thanks for the clarity, I will downgrade to 3.6.

I feel Sonarlint team need to fix also the link to sonarlint plugin, please see this link “https://www.sonarlint.org/eclipse/” where it says Sonarlint 3.6 is release and refers to eclipse marketplace to download the plugin. But Eclipse marketplace has 4.0 version, which is causing the issue.

Even “https://www.sonarlint.org/eclipse/” site also downloads only 4.0, please refer the image below.

image

Do you know to configure eclipse to refer to official sonarlint release site?


(Janos Gyerik) #10

To avoid further confusion, I confirm 4.0 is indeed released. We’re just awaiting the official announcement, to be soon followed by the website update.

As for your issue, I don’t know what could be the problem, yet.

When something goes wrong at that step, we would expect to see either a pop-up with an error message + details, or messages on the SonarLint Console. You mentioned earlier in this thread that you see nothing on the console. Do you confirm that you looked at the SonarLint Console? (The label “SonarLint Console” should be visible at the top of this console.)


(Xavier Bourguignon) #11

Download site has changed some weeks ago (see Download site has changed!), update site is now https://binaries.sonarsource.com/SonarLint-for-Eclipse/releases/


(Gilbert Rebhan) #12

Hi Xavier,
thanks for the hint, totally missed that.
Regards,
Gilbert


(Julien Henry) #13

Hi @Ravi_Bharathi

I just gave a try and this is working fine for me. The wizard is closing and immediately starts another wizard to bind projects:

May I ask you to open the Eclipse “Error Log” view. In case of exception in the background, you should see an entry, and opening it you should also have a stacktrace.

Thanks


(Ravi Bharathi Krishnan) #14

Hi @Julien_HENRY,
After reinstalling Sonarlint from the update site “https://binaries.sonarsource.com/SonarLint-for-Eclipse/releases/” I am able to get pass the finish button and new dialog opened to add the projects to bind. Now I get below error when binding the project.

Below error I got first time while adding the project

null
org.eclipse.core.jobs
Error
Thu Oct 25 14:13:54 GMT+05:30 2018
An internal error occurred during: “Update SonarLint binding data from ‘sonarqube..com’”.

java.lang.NoClassDefFoundError: org/sonar/api/batch/Sensor
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at org.sonar.classloader.ClassRealm.loadClassFromSelf(ClassRealm.java:125)
at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:37)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
at com.mwz.sonar.scala.ScalaPlugin.define(ScalaPlugin.scala:81)
at org.sonarsource.sonarlint.core.container.global.ExtensionInstaller.install(ExtensionInstaller.java:62)
at org.sonarsource.sonarlint.core.container.global.GlobalExtensionContainer.doBeforeStart(GlobalExtensionContainer.java:35)
at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:123)
at org.sonarsource.sonarlint.core.container.storage.StorageContainer.doAfterStart(StorageContainer.java:126)
at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:125)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.start(ConnectedSonarLintEngineImpl.java:118)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$update$2(ConnectedSonarLintEngineImpl.java:176)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withRwLock(ConnectedSonarLintEngineImpl.java:325)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.update(ConnectedSonarLintEngineImpl.java:169)
at org.sonarlint.eclipse.core.internal.server.Server.updateStorage(Server.java:326)
at org.sonarlint.eclipse.core.internal.jobs.ServerUpdateJob.run(ServerUpdateJob.java:50)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)
Caused by: java.lang.ClassNotFoundException: org.sonar.api.batch.Sensor
at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
… 26 more

Below error while adding the project using project bind wizard

null
org.sonarlint.eclipse.core
Error
Thu Oct 25 14:24:01 GMT+05:30 2018
Unable to update binding data from ‘sonarqube..com’

java.lang.IllegalStateException: Cannot stop. Current container state was: CONSTRUCTED
at org.sonarsource.sonarlint.shaded.org.picocontainer.lifecycle.DefaultLifecycleState.stopping(DefaultLifecycleState.java:72)
at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.stop(DefaultPicoContainer.java:794)
at org.sonarsource.sonarlint.core.container.ComponentContainer.stopComponents(ComponentContainer.java:156)
at org.sonarsource.sonarlint.core.container.storage.StorageContainer.stopComponents(StorageContainer.java:133)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.stop(ConnectedSonarLintEngineImpl.java:297)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$update$2(ConnectedSonarLintEngineImpl.java:170)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withRwLock(ConnectedSonarLintEngineImpl.java:325)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.update(ConnectedSonarLintEngineImpl.java:169)
at org.sonarlint.eclipse.core.internal.server.Server.updateStorage(Server.java:326)
at org.sonarlint.eclipse.core.internal.jobs.ServerUpdateJob.run(ServerUpdateJob.java:50)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)


(Julien Henry) #15

The first error is caused by the community Scala plugin. The problem is that they are using the same plugin key as our upcoming official Scala plugin, so SonarLint is confused.

Can I ask you what is the version of your SonarQube server, to better evaluate our options?

The second error is probably a consequence of the first one.


(Ravi Bharathi Krishnan) #16

@Julien_HENRY
We are using SonarQube server Version 6.7.3 (build 38370)


(Julien Henry) #17

I created a ticket to fix that:
https://jira.sonarsource.com/browse/SLE-290

In the meantime, your options are:

  • uninstall this plugin from SonarQube
  • revert to the previous SonarLint version

(Gilbert Rebhan) #18

Hi Julien,
i confirm the errors @Ravi_Bharathi detected.
Our Environment = SQ 5.6.6 and 7.3, Eclipse Photon and Oxygen, Win 7
*** We have no Scala plugin installed ! ***

When updating from SLE 3.6.0 to 4.0.0 on Eclipse Photon (dark theme) several problems occured:

Problem 1
after the update the SLE views could not be loaded
before update

sleviewsbefore

after update

sleviewsafter

Stacktrace

org.eclipse.core.runtime.CoreException: Plug-in org.sonarlint.eclipse.ui was unable to load class org.sonarlint.eclipse.ui.internal.views.issues.OnTheFlyIssuesView.
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:197)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:179)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:931)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:60)
at org.eclipse.ui.internal.registry.ViewDescriptor.createView(ViewDescriptor.java:59)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:101)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPart(CompatibilityPart.java:302)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:340)
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.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:1005)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:970)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:137)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:412)

Closing the view tabs and open via Window / Show View… didn’t help. So i closed Eclipse deleted the .sonarlint folder of the workspace and started Eclipse again, now the views can be opened, but

Problem 2
Because of deleting the .sonarlint folder before, i have to update the bindings. But one of the SQ 5.6.6 bindings doesn’t work, it remains in the status updating data…

binding_update

Trying to update this server connection results in

binding_update_error

Stacktrace

java.lang.NoClassDefFoundError: org/sonar/api/batch/events/SensorsPhaseHandler
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at org.sonar.classloader.ClassRealm.loadClassFromSelf(ClassRealm.java:125)
at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:37)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
at com.sonarsource.A.A.C.define(Unknown Source)
at org.sonarsource.sonarlint.core.container.global.ExtensionInstaller.install(ExtensionInstaller.java:62)
at org.sonarsource.sonarlint.core.container.global.GlobalExtensionContainer.doBeforeStart(GlobalExtensionContainer.java:35)
at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:123)
at org.sonarsource.sonarlint.core.container.storage.StorageContainer.doAfterStart(StorageContainer.java:126)
at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:125)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.start(ConnectedSonarLintEngineImpl.java:118)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$update$2(ConnectedSonarLintEngineImpl.java:176)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withRwLock(ConnectedSonarLintEngineImpl.java:325)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.update(ConnectedSonarLintEngineImpl.java:169)
at org.sonarlint.eclipse.core.internal.server.Server.updateStorage(Server.java:326)
at org.sonarlint.eclipse.core.internal.jobs.ServerUpdateJob.run(ServerUpdateJob.java:50)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)
Caused by: java.lang.ClassNotFoundException: org.sonar.api.batch.events.SensorsPhaseHandler
at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)

Trying to edit this connection results in

After closing this dialog and use Finish i get

select_projects

Using Add… gives

select_projects_add

Trying to delete this binding

sle_delete_binding

Stacktrace

java.lang.IllegalStateException: Cannot stop. Current container state was: CONSTRUCTED
at org.sonarsource.sonarlint.shaded.org.picocontainer.lifecycle.DefaultLifecycleState.stopping(DefaultLifecycleState.java:72)
at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.stop(DefaultPicoContainer.java:794)
at org.sonarsource.sonarlint.core.container.ComponentContainer.stopComponents(ComponentContainer.java:156)
at org.sonarsource.sonarlint.core.container.storage.StorageContainer.stopComponents(StorageContainer.java:133)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.stop(ConnectedSonarLintEngineImpl.java:297)
at org.sonarlint.eclipse.core.internal.server.Server.delete(Server.java:284)
at org.sonarlint.eclipse.ui.internal.server.DeleteServerDialog$DeleteServerJob.run(DeleteServerDialog.java:89)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)

Tried also with a fresh Eclipse Oxygen workspace, but i wasn’t even able to create any server connection.

Regards,
Gilbert


(Julien Henry) #19

Hi @Rebse

The first error (view can’t be displayed) indicates that SonarLint plugin failed at startup. To investigate, I would have needed Eclipse logs (the error you show is just a consequence).

The second error is due to an incompatible plugin. Can you provide the list + versions of your plugins in this SonarQube instance?

Thanks


(Gilbert Rebhan) #20

Hi Julien,
the first error is not dramatic.
Here the list of plugins

5.6.6

checkstyle-sonar-plugin-3.6.1.jar
java-custom-rules-1.0.7.jar
qualinsight-sonarqube-badges-3.0.1.jar
sonar-cfamily-plugin-4.14.0.9331.jar
sonar-cobertura-plugin-1.7.jar
sonar-csharp-plugin-6.6.0.3969.jar
sonar-css-plugin-3.1.jar
sonar-dependency-check-plugin-1.0.3.jar
sonar-generic-coverage-plugin-1.2.jar
sonar-governance-plugin-1.2.1.1926.jar
sonar-groovy-plugin-1.5.jar
sonar-java-plugin-4.15.0.12310.jar
sonar-javascript-plugin-3.3.0.5702.jar
sonar-jproperties-plugin-2.5.jar
sonar-json-plugin-2.2.jar
sonar-ldap-plugin-1.5.1.jar
sonar-motion-chart-plugin-1.7.jar
sonar-plsql-plugin-3.0.1.1427.jar
sonar-pmd-plugin-2.6.jar
sonar-puppet-plugin-1.4.jar
sonar-python-plugin-1.8.0.1496.jar
sonar-scm-git-plugin-1.2.jar
sonar-scm-tfvc-plugin-2.1.2.jar
sonar-softvis3d-plugin-0.8.1.jar
sonar-sonargraph-integration-2.0.1.jar
sonar-swift-plugin-3.0.0.1969.jar
sonar-text-plugin-0.5.jar
sonar-timeline-plugin-1.5.jar
sonar-typescript-plugin-1.1.0.1079.jar
sonar-web-plugin-2.5.0.476.jar
sonar-widget-lab-plugin-1.8.1.jar
sonar-xml-plugin-1.4.3.1027.jar

the second SQ 5.6.6 instance where the error occurs uses this 5 additional plugins

sonar-android-plugin-1.1.jar
sonar-rpg-plugin-2.1.0.736.jar
sonar-tsql-plugin-1.0.1.2094.jar
sonar-vbnet-plugin-4.0.0.115.jar
sonar-vb-plugin-2.2.1.886.jar

7.3

java-custom-rules-1.0.7.jar
sonar-abap-plugin-3.7.0.1603.jar
sonar-cfamily-plugin-5.1.1.10386.jar
sonar-cobol-plugin-4.3.0.3019.jar
sonar-csharp-plugin-7.7.0.7192.jar
sonar-css-plugin-1.0.2.611.jar
sonar-flex-plugin-2.4.0.1222.jar
sonar-go-plugin-1.1.0.1612.jar
sonar-html-plugin-3.0.1.1444.jar
sonar-jacoco-plugin-1.0.1.143.jar
sonar-java-plugin-5.8.0.15699.jar
sonar-javascript-plugin-5.0.0.6962.jar
sonar-kotlin-plugin-1.2.1.2009.jar
sonar-ldap-plugin-2.2.0.608.jar
sonar-php-plugin-2.14.0.3569.jar
sonar-pli-plugin-1.9.0.1349.jar
sonar-plsql-plugin-3.3.0.2273.jar
sonar-python-plugin-1.10.0.2131.jar
sonar-rpg-plugin-2.3.0.1187.jar
sonar-scm-git-plugin-1.4.1.1128.jar
sonar-security-plugin-7.3.0.1282.jar
sonar-softvis3d-plugin-1.0.1.jar
sonar-swift-plugin-4.0.0.2853.jar
sonar-tsql-plugin-1.3.0.2899.jar
sonar-typescript-plugin-1.8.0.3332.jar
sonar-vbnet-plugin-7.7.0.7192.jar
sonar-vb-plugin-2.4.0.1305.jar
sonar-xml-plugin-1.5.1.1452.jar

Regards,
Gilbert