Error on startup: An internal error occurred during: "Backend initialization"

Please provide

  • Operating system: openSUSE Tumbleweed/Linux
  • SonarLint plugin version: SonarLint for Eclipse 7.13.0.80073 org.sonarlint.eclipse.feature.feature.group SonarSource
  • Programming language you’re coding in: N/A
  • Is connected mode used: No

And a thorough description of the problem / question:

On each startup I see the following error pop-up

An internal error occurred during: “Backend initialization”.

The full stack trace is

java.lang.IllegalStateException: Unable to initialize the SonarLint Backend
	at org.sonarlint.eclipse.core.internal.backend.SonarLintBackendService$1.run(SonarLintBackendService.java:119)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.util.concurrent.ExecutionException: org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.http.ConnectionAwareHttpClientProvider': Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'provideHttpClientProvider' defined in org.sonarsource.sonarlint.core.spring.SonarLintSpringAppConfig: Bean instantiation via factory method failed; nested exception is org.sonarsource.sonarlint.shaded.org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.sonarsource.sonarlint.core.http.HttpClientProvider]: Factory method 'provideHttpClientProvider' threw exception; nested exception is java.lang.IllegalArgumentException: Could not create TrustStore because certificate is absent
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
	at org.sonarlint.eclipse.core.internal.backend.SonarLintBackendService$1.run(SonarLintBackendService.java:117)
	... 1 more
Caused by: org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.http.ConnectionAwareHttpClientProvider': Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'provideHttpClientProvider' defined in org.sonarsource.sonarlint.core.spring.SonarLintSpringAppConfig: Bean instantiation via factory method failed; nested exception is org.sonarsource.sonarlint.shaded.org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.sonarsource.sonarlint.core.http.HttpClientProvider]: Factory method 'provideHttpClientProvider' threw exception; nested exception is java.lang.IllegalArgumentException: Could not create TrustStore because certificate is absent
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
	at org.sonarsource.sonarlint.shaded.org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:920)
	at org.sonarsource.sonarlint.shaded.org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
	at org.sonarsource.sonarlint.core.SonarLintBackendImpl.lambda$initialize$2(SonarLintBackendImpl.java:60)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'provideHttpClientProvider' defined in org.sonarsource.sonarlint.core.spring.SonarLintSpringAppConfig: Bean instantiation via factory method failed; nested exception is org.sonarsource.sonarlint.shaded.org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.sonarsource.sonarlint.core.http.HttpClientProvider]: Factory method 'provideHttpClientProvider' threw exception; nested exception is java.lang.IllegalArgumentException: Could not create TrustStore because certificate is absent
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
	... 20 more
Caused by: org.sonarsource.sonarlint.shaded.org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.sonarsource.sonarlint.core.http.HttpClientProvider]: Factory method 'provideHttpClientProvider' threw exception; nested exception is java.lang.IllegalArgumentException: Could not create TrustStore because certificate is absent
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
	... 34 more
Caused by: java.lang.IllegalArgumentException: Could not create TrustStore because certificate is absent
	at nl.altindag.ssl.util.internal.ValidationUtils.lambda$requireNotEmpty$2(ValidationUtils.java:47)
	at nl.altindag.ssl.util.internal.ValidationUtils.requireNotEmpty(ValidationUtils.java:52)
	at nl.altindag.ssl.util.internal.ValidationUtils.requireNotEmpty(ValidationUtils.java:47)
	at nl.altindag.ssl.util.KeyStoreUtils.createTrustStore(KeyStoreUtils.java:177)
	at nl.altindag.ssl.util.KeyStoreUtils.loadSystemKeyStores(KeyStoreUtils.java:219)
	at nl.altindag.ssl.util.TrustManagerUtils.createTrustManagerWithSystemTrustedCertificates(TrustManagerUtils.java:89)
	at nl.altindag.ssl.SSLFactory$Builder.withSystemTrustMaterial(SSLFactory.java:210)
	at org.sonarsource.sonarlint.core.http.HttpClientProvider.<init>(HttpClientProvider.java:63)
	at org.sonarsource.sonarlint.core.spring.SonarLintSpringAppConfig.provideHttpClientProvider(SonarLintSpringAppConfig.java:156)
	at org.sonarsource.sonarlint.core.spring.SonarLintSpringAppConfig$$EnhancerBySpringCGLIB$$804720a9.CGLIB$provideHttpClientProvider$6(<generated>)
	at org.sonarsource.sonarlint.core.spring.SonarLintSpringAppConfig$$EnhancerBySpringCGLIB$$804720a9$$FastClassBySpringCGLIB$$1784ff26.invoke(<generated>)
	at org.sonarsource.sonarlint.shaded.org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
	at org.sonarsource.sonarlint.shaded.org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
	at org.sonarsource.sonarlint.core.spring.SonarLintSpringAppConfig$$EnhancerBySpringCGLIB$$804720a9.provideHttpClientProvider(<generated>)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
	... 35 more

I saw similar messages for the IDEA plug-in, but nothing for Eclipse so I raiswed a new topic.

Thanks!

Hi @rombert,

thanks for reaching out. This version of SonarLint for Eclipse differs from the most recent IntelliJ IDEA version released regarding the certificate retrieval logic, of which some community threads can be found.
For Linux we’re taking a look at /etc/ssl/certs to find certificates, does any certificate exist for you in that folder?
The issue might also come from SonarLint for Eclipse not being up-to-date yeat (this is planned for the upcoming release). Would it be possible for you to test, when using SonarLint for IntelliJ, if the error persists on this IDE as well?

Best,
Tobias

Hi Tobias and thanks for the response.

There are plenty of entries in /etc/ssl/certs on my machine. I don’t have access to IntelliJ IDEA though and I won’t be able to test it.

Do you have an ETA for the next Eclipse SonarLint release?

Thanks,
Robert

Hi @rombert,

the upcoming version of SonarLint for Eclipse is to be released on September 4th.
In the meantime, I’d like to check if there is possibly something else happening. Could you please provide me with some more information:

  • Which Eclipse version and flavor are you using?
  • Is there more to the stack trace than that, that you can share with me?
  • Is there something on the SonarLint Console you can share with me? You can enable additional logs via the Console viewSonarLint ConsoleGear symbol → Enable Verbose output and Analysis logs (then restart the IDE and the logs should be filled)
  • Are you running Eclipse as your user or as root?
  • Are you locked behind a proxy?

Best and thanks for getting back,
Tobias

Hi Tobias,

  • I am using Eclipse 4.28 for Java Web and EE Developers + a couple of custom plug-ins
  • That is the complete stack trace
  • I don’t see anything interesting in the console after the restart, it’s mostly
    • Startup/plug-in extracted
    • Trigger: STARTUP followed by analysis configuration
    • Starting standalone SonarLint engine 7.13.0.80073… followed by more ‘Plugin extracted’
    • Lots of ‘Skipping section …, content is empty’
    • ‘Start analysis’ and information about checks, properties, skipped server-side caching/change analysis
    • 1/1 source file has been analyzed
  • I am running Eclipse as my user
  • I am not behind a proxy

Thanks,
Robert

Hi @rombert,

thanks for the quick response. Nothing out of the ordinary as it seems, but one thing is odd: Just a few hours ago THIS thread popped-up as well, therefore I have to ask:
Since when is the issue occurring? It seems you both use openSUSE Tumbleweed and if I’m not mistaken they work with continuous/rolling releases, so maybe (of course I’m not sure about it) it has sth. do with changes on the OS side? For now, I can only guess regarding that issue but it sounds odd nevertheless.

Best,
Tobias

Hi Tobias,

You’re right, Tumbleweed is a rolling release, but I don’t recall when this started, sorry.

What I can tell you is that I locally ran (within Eclipse) a code sample very similar to GitHub - Hakky54/sslcontext-kickstart: 🔐 A lightweight high level library for configuring a http client or server based on SSLContext or other properties such as TrustManager, KeyManager or Trusted Certificates to communicate over SSL TLS for one way authentication or two way authentication provided by the SSLFactory. Support for Java, Scala and Kotlin based clients with examples. Available client examples are: Apache HttpClient, OkHttp, Spring RestTemplate, Spring WebFlux WebClient Jetty and Netty, the old and the new JDK HttpClient, the old and the new Jersey Client, Google HttpClient, Unirest, Retrofit, Feign, Methanol, Vertx, Scala client Finagle, Featherbed, Dispatch Reboot, AsyncHttpClient, Sttp, Akka, Requests Scala, Http4s Blaze, Kotlin client Fuel, http4k Kohttp and Ktor. Also gRPC, WebSocket and ElasticSearch examples are included, which I think is what SonarLint uses, and that worked just fine.

Thanks,
Robert

Thanks for the cross-linking, the 2 issues seem the same, yes.
What I can say also is that the same error occurs with OpenSuSE 15.4 (so not a rolling release).

Thanks, @rombert for replying. Yes, we are using that library and are also in contact with the maintainer. Please give us some time to investigate further and I/we get back to you!

3 Likes

This problem is gone for me as of version 8.0.0.80153 .

Thanks for the fix, much appreciated!

1 Like