Java error when running some analysis

Enviroments:

  • Operating system: Windows 11 (WSL2 - using Ubuntu 22.08)
  • Visual Studio Code Version: 1.88.1
  • SonarLint plugin version: 4.4.2
  • Java Version: “21.0.2” 2024-01-16 LTS
  • Programming language you’re coding in: Typescript
  • Is connected mode used: yes
    • Connected to SonarQube: 10.3.0.82913

Problem

Whenever I have to analyze a file or receive some analysis information from the sonnarqube server this error occurs

[Debug - 18:14:19.784] Parsing /workspaces/v2/custom/react/components/BarraDeVantagens/BarraDeVantagens.tsx with @typescript-eslint/parser
[Debug - 18:14:19.785] Saving issue for rule no-unnecessary-type-assertion on file /workspaces/v2/custom/react/components/BarraDeVantagens/BarraDeVantagens.tsx at line 37
[Debug - 18:14:19.785] Initializing metadata of file file:///workspaces/v2/custom/react/components/BarraDeVantagens/BarraDeVantagens.tsx
[Debug - 18:14:19.786] Adding quick fix for issue no-unnecessary-type-assertion at line 37
[Debug - 18:14:19.790] Saving issue for rule rules-of-hooks on file /workspaces/v2/custom/react/components/BarraDeVantagens/BarraDeVantagens.tsx at line 45
[Debug - 18:14:19.793] Saving issue for rule mouse-events-a11y on file /workspaces/v2/custom/react/components/BarraDeVantagens/BarraDeVantagens.tsx at line 84
[Info  - 18:14:19.805] 1/1 source file has been analyzed
[Info  - 18:14:19.805] Hit the cache for 0 out of 1
[Info  - 18:14:19.805] Miss the cache for 1 out of 1: RUNTIME_API_INCOMPATIBLE [1/1]
[Debug - 18:14:19.805] 'JavaScript inside YAML analysis' skipped because there is no related files in the current project
[Debug - 18:14:19.805] 'JavaScript inside HTML analysis' skipped because there is no related files in the current project
[Debug - 18:14:19.805] Execute Sensor: CSS Rules
[Info  - 18:14:19.805] No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
[Debug - 18:14:19.805] Execute Sensor: IaC Docker Sensor
[Info  - 18:14:19.806] 0 source files to be analyzed
[Info  - 18:14:19.812] 0/0 source files have been analyzed
[Debug - 18:14:19.812] 'CFamily' skipped because there is no related files in the current project
[Error - 18:14:19.816] Analysis failed
java.util.concurrent.CompletionException: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.
	at java.base/java.util.concurrent.CompletableFuture.reportJoin(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.join(Unknown Source)
	at org.sonarsource.sonarlint.ls.connected.ServerIssueTrackerWrapper.matchAndTrackIssues(ServerIssueTrackerWrapper.java:88)
	at org.sonarsource.sonarlint.ls.connected.ServerIssueTrackerWrapper.lambda$matchAndTrack$2(ServerIssueTrackerWrapper.java:74)
	at java.base/java.util.Optional.ifPresent(Unknown Source)
	at org.sonarsource.sonarlint.ls.connected.ServerIssueTrackerWrapper.matchAndTrack(ServerIssueTrackerWrapper.java:69)
	at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.lambda$analyzeConnected$31(AnalysisTaskExecutor.java:532)
	at java.base/java.util.HashMap.forEach(Unknown Source)
	at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.lambda$analyzeConnected$32(AnalysisTaskExecutor.java:530)
	at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.analyzeWithTiming(AnalysisTaskExecutor.java:564)
	at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.analyzeConnected(AnalysisTaskExecutor.java:528)
	at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.lambda$analyzeSingleModuleNonExcluded$19(AnalysisTaskExecutor.java:359)
	at java.base/java.util.Optional.map(Unknown Source)
	at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.analyzeSingleModuleNonExcluded(AnalysisTaskExecutor.java:359)
	at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.analyzeSingleModule(AnalysisTaskExecutor.java:314)
	at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.analyze(AnalysisTaskExecutor.java:232)
	at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.analyze(AnalysisTaskExecutor.java:197)
	at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.lambda$analyze$2(AnalysisTaskExecutor.java:165)
	at java.base/java.util.HashMap.forEach(Unknown Source)
	at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.analyze(AnalysisTaskExecutor.java:165)
	at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.run(AnalysisTaskExecutor.java:137)
	at org.sonarsource.sonarlint.ls.AnalysisScheduler.lambda$analyzeAsync$1(AnalysisScheduler.java:261)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:209)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193)
	at org.sonarsource.sonarlint.core.rpc.protocol.SingleThreadedMessageConsumer.lambda$new$0(SingleThreadedMessageConsumer.java:51)
	... 5 more

[Warn  - 18:14:19.817] Future computation completed with an exception

Hello @Marlon_Passos, welcome to Sonar Community! :wave: :sonar:

Thanks for the report and the logs. Would you be able to provide full SonarLint logs, starting from when you load the workspace folder? The logs should start with something like

Executing /usr/bin/java -jar /Users/sophio.japharidze/.vscode/extensions/sonarsource.sonarlint-vscode-4.4.2/server/sonarlint-ls.jar

EDIT: Also, a small Java reproducer where you face such failures would be super helpful! :bowing_woman:

Thanks in advance,
Sophio :bowing_woman: