Sonarlint throws IllegalStateException when Finish is pressed on the Bind to SonarQube wizard

Errors about not being able to connect to SonarQube were being displayed in Eclipse. I decided to delete my existing connection and reconnect to SonarQube, but the SonarQube binding wizard would not complete at the last step. I restarted Eclipse using consolelog and debug options:

.\eclipse\jee-2020-09\eclipse\eclipse.exe -consolelog -debug

When clicking Finish at the end of the wizard an exception was thrown and visible in the console log window (exception displayed below). I know my login credentials are good because I can go the web page https://sonarqube.di2e.net/ and authenticate with those same credentials to get access.

Using:

  • Windows 10 Enterprise
  • SonarQube version SonarLint for Eclipse 5.4.0.22606
  • Eclipse IDE for Enterprise Java Developers (includes Incubating components)
    Version: 2020-09 (4.17.0) Build id: 20200910-1200

Steps to reproduce:

  1. In open Eclipse project, Open Bind to SonarQube wizard by:
    right clicking project > SonarLint > Bind to SonarQube or SonarCloud
  2. Select SonarQube, then select Next
  3. Enter URL https://sonarqube.di2e.net/ …then select Next
  4. Select 'Username + Password" …then select Next
  5. Enter Username and Pazssword …then select Next
  6. Ensure the connection name is displayed in the box, mine is sonarqube.di2e.net …then select Next
    6.Configuraton completed should be displayed along with a message indicating success
  7. Click Finish to complete the wizard.
  8. Observe that the wizard doesn’t respond when clicking Finish

This problem also happens when using a token instead of username/password to authenticate.

What is happening is that Sonarlint is throwing an exception:

!ENTRY org.eclipse.ui 4 0 2021-03-15 18:36:33.714
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.IllegalStateException: Unable to store connection credentials in secure storage: No password provided.
        at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacadeManager.storeCredentials(ConnectedEngineFacadeManager.java:272)
        at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacadeManager.addServer(ConnectedEngineFacadeManager.java:257)
        at org.sonarlint.eclipse.ui.internal.binding.wizard.connection.ServerConnectionWizard.performFinish(ServerConnectionWizard.java:217)
        at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:832)
        at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:472)
        at org.eclipse.jface.dialogs.Dialog.lambda$0(Dialog.java:619)
        at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:84)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
        at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4195)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1037)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4012)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3612)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
        at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:153)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
Caused by: org.eclipse.equinox.security.storage.StorageException: No password provided.
        at org.eclipse.equinox.internal.security.storage.SecurePreferences.put(SecurePreferences.java:242)
        at org.eclipse.equinox.internal.security.storage.SecurePreferencesWrapper.put(SecurePreferencesWrapper.java:128)
        at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacadeManager.storeCredentials(ConnectedEngineFacadeManager.java:268)
        ... 33 more

Hi @clinthelton

The error is related to the Eclipse secure storage. This is a place where Eclipse plugins like SonarLint can safely write credentials. This feature is OS dependent.
Seems Eclipse was unable to open the secure storage because the master password has not been provided.
Maybe you could check in Eclipse settings if the storage is readable (in the content tab), and possibly reset it if it was corrupted (but you will have to re-enter all your passwords):

Thanks, Julien.

The secure.storage file is readable and writeable. The Security > Secure Storage properties tab I have appears to match with what you sent me. I’ve attached a screenshot of my Contents tab. Is there supposed to be a master password entry for SonarQube on the Secure Storage tab?

Thanks,

Clint

I went ahead and deleted my master password for sonarlint and reattempted to create a connection to SonarQube. It worked that time. Instructions from below were also helpful. I just now ran across them after searching quite a bit on the forums for this answer. Thanks again!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.