SonarLint analysis failed: Unable to load component class org.sonarsource.sonarlint.core.analyzer.sensor.SensorExecutor

@Julien_HENRY Here’s the logs after opening a file in VSCode:

Server excluded sources: 
  **/*.test.js
Server included tests: 
  **/*.test.js
Analysis triggered on file:///Users/darren/Workspace/Dragonfly/authsrv.onboardmd.com/src/logger.js with configuration: 
[
  projectKey: wearedragonfly_onboardmd-authsrv
  baseDir: /Users/darren/Workspace/Dragonfly/authsrv.onboardmd.com
  workDir: /Users/darren/Workspace/Dragonfly/authsrv.onboardmd.com/.sonarlint
  extraProperties: {}
  inputFiles: [
    file:///Users/darren/Workspace/Dragonfly/authsrv.onboardmd.com/src/logger.js (UTF-8)
  ]
]

Available languages:
  * C => "c"
  * C++ => "cpp"
  * Objective-C => "objc"
  * Python => "py"
  * Kotlin => "kotlin"
  * T-SQL => "tsql"
  * Apex => "apex"
  * JavaScript => "js"
  * PL/SQL => "plsql"
  * Ruby => "ruby"
  * Scala => "scala"
  * Java => "java"
  * COBOL => "cobol"
  * HTML => "web"
  * JSP => "jsp"
  * XML => "xml"
  * PHP => "php"
  * TypeScript => "ts"
  * ABAP => "abap"
Start analysis
Declared extensions of language C were converted to c: **/*.disabled
Declared extensions of language C++ were converted to cpp: **/*.disabled
Declared extensions of language Objective-C were converted to objc: **/*.disabled
Declared extensions of language Python were converted to py: **/*.py
Declared extensions of language Kotlin were converted to kotlin: **/*.kt
Declared extensions of language T-SQL were converted to tsql: **/*.tsql
Declared extensions of language Apex were converted to apex: **/*.cls,**/*.trigger
Declared extensions of language JavaScript were converted to js: **/*.js,**/*.jsx,**/*.vue
Declared extensions of language PL/SQL were converted to plsql: **/*.sql,**/*.tab,**/*.pkb
Declared extensions of language Ruby were converted to ruby: **/*.rb
Declared extensions of language Scala were converted to scala: **/*.scala
Declared extensions of language Java were converted to java: **/*.java,**/*.jav
Declared extensions of language COBOL were converted to cobol: 
Declared extensions of language HTML were converted to web: **/*.html,**/*.xhtml,**/*.cshtml,**/*.vbhtml,**/*.aspx,**/*.ascx,**/*.rhtml,**/*.erb,**/*.shtm,**/*.shtml
Declared extensions of language JSP were converted to jsp: **/*.jsp,**/*.jspf,**/*.jspx
Declared extensions of language XML were converted to xml: **/*.xml,**/*.xsd,**/*.xsl
Declared extensions of language PHP were converted to php: **/*.php,**/*.php3,**/*.php4,**/*.php5,**/*.phtml,**/*.inc
Declared extensions of language TypeScript were converted to ts: **/*.ts,**/*.tsx
Declared extensions of language ABAP were converted to abap: **/*.abap,**/*.ab4,**/*.flow,**/*.asprog
[Info  - 10:24:39 AM] Index files
Language of file 'file:///Users/darren/Workspace/Dragonfly/authsrv.onboardmd.com/src/logger.js' is set to 'js'
[Info  - 10:24:39 AM] 1 files indexed
Quality profiles:
  * abap: 'Sonar way' (65 rules)
  * apex: 'Sonar way' (29 rules)
  * c: 'Sonar way' (155 rules)
  * cobol: 'Sonar way' (29 rules)
  * cpp: 'Sonar way' (245 rules)
  * java: 'Sonar way' (362 rules)
  * js: 'Sonar way Recommended' (128 rules)
  * jsp: 'Sonar way' (0 rules)
  * kotlin: 'Sonar way' (30 rules)
  * objc: 'Sonar way' (149 rules)
  * php: 'Sonar way' (98 rules)
  * plsql: 'Sonar way' (130 rules)
  * py: 'Sonar way' (31 rules)
  * ruby: 'Sonar way' (29 rules)
  * scala: 'Sonar way' (28 rules)
  * ts: 'Sonar way recommended' (112 rules)
  * tsql: 'Sonar way' (54 rules)
  * web: 'Sonar way' (155 rules)
[Error - 10:24:39 AM] Analysis failed.
java.lang.IllegalStateException: Unable to load component class org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor
	at org.sonarsource.sonarlint.core.container.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:59)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.getComponentByType(ComponentContainer.java:258)
	at org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:132)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:125)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.execute(ComponentContainer.java:110)
	at org.sonarsource.sonarlint.core.container.storage.StorageAnalyzer.analyze(StorageAnalyzer.java:75)
	at org.sonarsource.sonarlint.core.container.storage.StorageContainerHandler.analyze(StorageContainerHandler.java:82)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$analyze$0(ConnectedSonarLintEngineImpl.java:152)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:344)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:334)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.analyze(ConnectedSonarLintEngineImpl.java:149)
	at org.sonarlint.languageserver.SonarLintLanguageServer$ConnectedAnalysisWrapper.analyze(SonarLintLanguageServer.java:735)
	at org.sonarlint.languageserver.SonarLintLanguageServer$ConnectedAnalysisWrapper.analyze(SonarLintLanguageServer.java:716)
	at org.sonarlint.languageserver.SonarLintLanguageServer.analyze(SonarLintLanguageServer.java:615)
	at org.sonarlint.languageserver.SonarLintLanguageServer.didOpen(SonarLintLanguageServer.java:551)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:152)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:220)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:187)
	at org.eclipse.lsp4j.jsonrpc.Launcher$Builder.lambda$wrapMessageConsumer$0(Launcher.java:342)
	at org.eclipse.lsp4j.jsonrpc.validation.ReflectiveMessageValidator.consume(ReflectiveMessageValidator.java:76)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:192)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:99)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonarsource.sonarlint.core.analyzer.sensor.DefaultSensorContext
	at org.sonarsource.sonarlint.core.container.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:59)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
	at org.sonarsource.sonarlint.core.container.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:57)
	... 33 more
Caused by: java.lang.IllegalStateException: Unable to load component interface org.sonar.api.batch.rule.ActiveRules
	at org.sonarsource.sonarlint.core.container.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:59)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
	at org.sonarsource.sonarlint.core.container.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:57)
	... 47 more
Caused by: java.lang.IllegalStateException: Rule 'c:S1133' is already activated
	at org.sonar.api.batch.rule.internal.ActiveRulesBuilder.addRule(ActiveRulesBuilder.java:40)
	at org.sonarsource.sonarlint.core.container.storage.SonarQubeActiveRulesProvider.createNewActiveRule(SonarQubeActiveRulesProvider.java:107)
	at org.sonarsource.sonarlint.core.container.storage.SonarQubeActiveRulesProvider.provide(SonarQubeActiveRulesProvider.java:73)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:39)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:113)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
	at org.sonarsource.sonarlint.core.container.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:57)
	... 61 more

Any progress come out of your investigations? This is the very first time I tried using SonarLint with SonarCloud by the way. So there was no chance of having stale/broken sonar cloud storage/binding on my machine.

No progress, I also started from a clean storage, bound a project to your organization, and I have no issue. There is something fishy but I can’t point it out.

Would you mind sending me (privately) the content of your storage directory?

Absolutely, email? or is there a way to do that on this forum?

Nvm. I see your private message.

@dschnare I finally managed to understand the issue. This is a problem of case insensitivity of Windows file system. In the local storage, we are writing quality profiles in files having the quality profile uuid as filename. This is a problem for case insensitive FS if some uuids only differ by the case. For example:

I will create a ticket and work on a fix. Thanks for helping me understanding the root cause.

Ah. I don’t know how many times file name case sensitivity has bitten us too. Thanks for your help. I’ll wait for the fix.

I was struggling with the exact same issue this morning. I tried a lot until i saw the plugin could not delete a file in the tmp folder. As i’m still forced to work with windows 7 i let my colleague try it out who has windows 10. He had the same issue.
And then i found this forum post.
My next laptop will have a proper os, i promise, but i can’t speak for my colleagues.
I hope you guys can fix this asap. :wink:

FYI all SonarLint flavors (except Visual Studio) are affected.
I have created a tickets:
https://jira.sonarsource.com/browse/SLVSCODE-68
https://jira.sonarsource.com/browse/SLE-308
https://jira.sonarsource.com/browse/SLI-332

Seeing as this affects all IDEs across all OSX and Linux operating systems, is this going to be prioritized? hate to say it but this is the major selling feature of SonarCloud for our team.

This is a Windows only issue except if I missed something.

I’m running on OSX, a case sensitive OS. I suspect all case sensitive OSs are going to be affected by this issue.

Are you sure you are not confusing “case sensitive” and “case preserving” FS?

Still I will have a look at your storage (please give me access).

Julien - I am the one that originally created the issue and I too am running OSX so it does not appear to be limited to Windows machines.

Ah yes. I’ve double checked my file system and it’s case insensitive. My bad. So then this is an issue for all case preserving OSs, like OSX.

For what it’s worth my filesystem is APFS encrypted and is case insensitive. OSX Mojave 10.14.5 (18F132).

So yes, to sum up, we were both wrong: the issue affect all case insensitive filesystems (case preserving is not enough). I will update the ticket.

1 Like

Hi @dschnare and others,

Here is an attempt to fix the bug on VSCode. I would be grateful if you could test this artifact and report any issue:
https://repox.jfrog.io/repox/sonarsource/org/sonarsource/sonarlint/vscode/sonarlint-vscode/1.9.0-build.643/sonarlint-vscode-1.9.0-build.643.vsix

I can easily provide build of other SonarLint flavors if someone else want to test.

Thanks

I am available to test Intellij Ultimate if needed…

@romack here is a build:
https://repox.jfrog.io/repox/sonarsource/org/sonarsource/sonarlint/intellij/sonarlint-intellij/4.1.0.3234/sonarlint-intellij-4.1.0.3234.zip

Thanks