Sonarlint fail to run with PDT (8.2) installed

Please provide

  • Operating system:
    *Ubuntu 20.04
  • SonarLint plugin version:
  • SonarSource SonarLint for Eclipse 10.3.0.82013
  • Programming language you’re coding in:
  • C/ C++ , python, PHP, typescript
  • Is connected mode used:
    • Connected to SonarQube : 10.4.1.88267

And a thorough description of the problem / question:
After updating sonal lint from version 9.x to 10.3 sonarlint does not work and give errors.
The problem is due to PDT (PHP plugin) is installed in eclipse.
After uninstalling PDT sonalint start working well.
After re-installing PDT soanar lint fail again.

We use Eclipse CDT with installed pydev, pdt and wild Web Develop.

Error log at eclipse starting

Rule typescript:S6252 is enabled on the server, but not available in SonarLint

Rule typescript:S5042 is enabled on the server, but not available in SonarLint

Rule tssecurity:S3649 is enabled on the server, but not available in SonarLint

Computing file exclusion for uri ‘file:/home/afardin/git/EMS-UWP4/userapps/gavazzi/apps/cmt/src/cmt.c’

Unable to find client file for uri file:/home/afardin/git/EMS-UWP4/userapps/gavazzi/apps/cmt/src/cmt.c

Error during execution of SonarLint analysis

Error during execution of SonarLint analysis

java.lang.IllegalStateException: java.util.concurrent.ExecutionException: org.sonarsource.sonarlint.shaded.org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.

at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.run(AnalyzeProjectJob.java:317)

at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.doRun(AnalyzeProjectJob.java:165)

at org.sonarlint.eclipse.core.internal.jobs.AbstractSonarJob.run(AbstractSonarJob.java:37)

at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Caused by: java.util.concurrent.ExecutionException: org.sonarsource.sonarlint.shaded.org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.

at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)

at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096)

at org.sonarlint.eclipse.core.internal.utils.JobUtils.waitForFutureInJob(JobUtils.java:74)

at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.run(AnalyzeProjectJob.java:303)

… 3 more

Caused by: org.sonarsource.sonarlint.shaded.org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.

at org.sonarsource.sonarlint.shaded.org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:220)

at org.sonarsource.sonarlint.shaded.org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:204)

at org.sonarsource.sonarlint.core.rpc.protocol.SingleThreadedMessageConsumer.lambda$new$0(SingleThreadedMessageConsumer.java:51)

at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)

at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)

at java.base/java.lang.Thread.run(Thread.java:1583)

java.lang.IllegalStateException: java.util.concurrent.ExecutionException: org.sonarsource.sonarlint.shaded.org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.

at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.run(AnalyzeProjectJob.java:317)

at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.doRun(AnalyzeProjectJob.java:165)

at org.sonarlint.eclipse.core.internal.jobs.AbstractSonarJob.run(AbstractSonarJob.java:37)

at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Caused by: java.util.concurrent.ExecutionException: org.sonarsource.sonarlint.shaded.org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.

at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)

at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096)

at org.sonarlint.eclipse.core.internal.utils.JobUtils.waitForFutureInJob(JobUtils.java:74)

at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.run(AnalyzeProjectJob.java:303)

… 3 more

Caused by: org.sonarsource.sonarlint.shaded.org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.

at org.sonarsource.sonarlint.shaded.org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:220)

at org.sonarsource.sonarlint.shaded.org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:204)

at org.sonarsource.sonarlint.core.rpc.protocol.SingleThreadedMessageConsumer.lambda$new$0(SingleThreadedMessageConsumer.java:51)

at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)

at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)

at java.base/java.lang.Thread.run(Thread.java:1583)

GET 200 http://192.168.2.226:9000/api/developers/search_events?projects=EMS-Core&from=2024-07-03T15%3A04%3A26%2B0200 | response time=9ms

Storing last event polling in /home/afardin/Progetti/cgc_uwp_workspace/.sonarlint/storage/4347435f534f4e41525f51554245/projects/454d532d436f7265/last_event_polling.pb

GET 200 http://192.168.2.226:9000/api/developers/search_events?projects=EMS-Core&from=2024-07-03T15%3A05%3A26%2B0200 | response time=9ms

Hi @alef75,

thanks for reaching out. Sadly I cannot reproduce the issue, would you be so kind to provide me with the full logs?

Can you also please open the Problems view and Error Log view? I’ve encountered PDT starting the debugger sometimes on ports interfering with different Eclipse plug-ins, not necessarily Eclipse, but this might be a possibility for the error origin.
If there are any errors that look related, please provide them to me as well.

Best,
Tobias

for sure:
here the log
sonarlint_error.log (6.8 KB)

Thanks, @alef75, for the logs. Quick question before I start investigating: Does this issue only happen when analyzing C/C++ files?
There is a CDT error in the logs, and it is a bit confusing to see it there. And that the SonarLint error stack traces are pretty short.

Can you also restart the IDE once and then trigger an analysis and provide me with the whole logs from the beginning? So I have everything from startup until after this issue, please.

I will test with an Eclipse installation featuring CDT, PDT, PyDev and WWD. And then come back to you.

Best,
Tobias

Hi Tobias
thank you very much

I confirm that the problem is here also analyzing the other languages

here you are the logs from the beginning (after restarting)
sonarlintError.log (5.5 MB)

Hi Tobias, I’ve made some more tests.
I’ve found that the problem is caused by some files in our project, but I don’t fins which one.

With our full project and with PDT:
sonarlint 9.x Works
sonarlint 10.3 Does Not Works

With our full project and without PDT:
sonarlint 9.x Works
sonarlint 10.3 Works

With our stripped down project and with PDT:
sonarlint 9.x Works
sonarlint 10.3 Works

I’ve also noticed that sonarlint 9.x behave very differntly from behave 10.3:
sonarlint 10.3, if I close and re-open the project takes about 20 minutes parsing every file of our project, included all the excluded files.

for example sonar 10.3 parse alla file included the folder TestAcceptance/pyvenv/ that contain all the python virtual environment, the target/ folder that contain all build artifact and
html/weapp/node_modules/, that contains all the node_moduled libraryes for the webapp.

Our project is in a monorepo, it is composed by:

Project/
userapps/
3rdParty/
public/
gavazzi/ → (C/C++ code we want analize with sonar)

target/ → (files generated by the build and generated target root file system)

html/
weapp/
src/
node_modules/

TestAcceptance/
Feature/
pyvenv/

Hi @alef75,

Thanks for the insight. I’ve created THIS ticket to be tackled by the next release, which is planned for the end of July.

The issue can be because your project is really big or the environment is very tightly configured, and our indexing got slower and slower over time. Additionally, some plug-ins we relied on (e.g. for Maven) degraded in performance as well so this adds up.
The main reason here seems to be the indexing is not fully done at the moment the analysis starts.

With this ticket I plan to speed it up, would it be okay for you if I would ping you before the release with a dogfooding version of SonarLint for Eclipse to test and see if and how much the performance increased?

Best,
Tobias

Hi Tobias,

Thank you for the feedback, I would be appy to help in testing it.

I hope there wil be a way to exclude some part of the project from sonarlint parse.
Why not using the exclude directive directly for this poupose ?
I know other eclipse plugin have similar issues.
I also know that eclipse have the “derived resource” concept, and we use it to exclude the paths from git, serach and so on, (we use the plugin autoderiv for applying it automatucally).

For now I’m switching back to sonarlint 9.x

Regards
Alessandro