SonarLint 10.7 not working after updating from previous version on Eclipse

Please provide

  • Windows 11:
  • SonarLint plugin version 10.7:
  • Programming language you’re coding in C:
  • Is connected mode used YES:
    • Connected to SonarQube(10.2):

Updated today to 10.7 and nothing works. How Can I downgrade to at least 10.5?

We are using in connected mode for C. I had Eclipse 2022-09, but because of problem updated to Eclipse 2024-09 and the same problem. The error message is “No file to analyze”. It was working all OK this morning before I have updated to 10.7. I am not sure what version I was using, I have installed SonarLint for first time one month ago.

The LOG is attached
sonarLint_problem.log (244.0 KB)

Hi @Alex29,

thanks for reaching out. Please provide me with some more information about your project in order to determine the root cause while I’m looking through the logs in order to find something useful.

My first guess is that your project is a CDT project, right? Is it perhaps using a build system like CMake or Gradle or anything else?

Can you look at the properties of the project and provide me with every configuration in the C/C++ Build setting what the Build Directory is set to?
SonarLint ignores files from indexing and, therefore, does not analyze the files inside a build (output) directory.

Two lines in the log are very curious to me:

Computing file exclusion for uri 'file:/C:/Projects/tutmp/trunk/tutmp_product/tutmp/src/cpu_ceiling.c'
Unable to find client file for uri file:/C:/Projects/tutmp/trunk/tutmp_product/tutmp/src/cpu_ceiling.c

I would assume the file exists (as you had it opened) but apparently SonarLint couldn’t find them, either because it was ignored from the indexing or perhaps because the project is so big that it wasn’t finished with indexing at that point?

I’m going to dig deeper into the logs in the meantime.

Best,
Tobias

Hi Tobias.
Thank yor your reply. I am away till Monday. I can only provide what i remember at the moment. The rest i will send you on Monday.
It is CDT Eclipse and we use make files to built it. It was all working till I have updated yesterday to 10.7 and suddenly no files to analyse. No configuration was changed. I can run scanner in SonarQube as normal, but it would be nice to have it locally in Eclipse. The problem I was trying to solve that SonarQube and SonaLint were giving different results. And than I saw update in Eclipse for SonarLint 10.7 and I did update.
The project is not too big. We have a license on SonarQube for 100000 lines and we are not close to that. SonaLint is taking part of configurations locally and some from SonarQube in connected mode. It is very confusing.
We use SVN and before scanning, we update the trunk with the script, so SonarQube sonscanner works against the latest code.
The only thing I have changed recently in SonarQube, that I am setting the src with sonar.source=src/ and assume that project directory is set to parent, and was before sonar.source= . with some excluded folders. But that worked that morning anyway.
Thank you. I hope we sort this out.

Hey @Alex29,

thanks for the info. I just released SonarLint for Eclipse 10.8. This might not fix your problem but please try it nevertheless and provide me with new logs.
This version is intended to log more about corner cases, like yours, where the analysis is triggered, and then it says there is no inputFile. With these new logs I will have more information.

Thanks also for your input. Just to clarify, the information saved in your sonar-project.properties file is not taken into account by SonarLint.
As requested earlier, please also provide me with the information about C/C++ Build → Build Directory of the project.

In an example project I have the preferences look like this for the two configurations (Debug and Release):


Looking forward hearing back from you with the new logs!

Best,
Tobias

Hi Tobias,
I have installed new SonarLint 10.8. The problem still exist. Please find attached logs:
sonarLint_problem.log (190.6 KB)
sonarLint_problem_more.log (1017.6 KB)

As far as I know I did not create sonar-project.properties for SonarLint. I just have some configurations in Preferences->SonarLint->Analyser Properties. Which are ignored anyway.

C/C++ Build → Build Directory has the same settings like you have, only Generate Makefiles Automatically unchecked as we use our own makefiles.

Thank you.

Looking forward for your reply.
Alex

Hi @Alex29,

Thank you very much; this is already very helpful! I will check tomorrow again, but the main reason here seems to be that the files were not indexed, and I have to find out why.

Are the CDT files (.project, .cproject and everything in the .settings folder) checked in, or are they generated every time (e.g., when importing the project)?
Would it be possible that you could share them with me (only the Eclipse-specific files, no source or anything else)?
You can also share them privately with me or via mail. This would help me to build a reproducer.

If I find new stuff in the meantime, I will keep you posted.

Best,
Tobias

Hi Tobias,
How could I send you these files in private? I don’t see any options.

And is any way I could reinstall SonarLint and start from the begging. I have tried already to delete everything with name SonarLint but after new install some configurations were already picked up from somewhere.
Or may be no need to do that?

Thank you
Alex

I’ve got the same problem with sonarlint 10.8 (with no PDT)

Hi @Alex29,

I’ve sent you a private message for the files to share.

In order to remove the preferences of SonarLint you have to look at three different spots depending on the kind of preference. The files are all either called org.sonarlint.eclipse.core.prefs or org.sonarlint.eclipse.ui.prefs:

  • in the projects .settings folder there might be one, containing the project-specific settings like the binding
  • in the workspace at .metadata/.plugins/org.eclipse.core.runtime/.settings
  • in the application folder inside configuration/.settings

Best,
Tobias

Hi @Alex29,

based on the investigation the following TICKET was created and tackled, fixing this bug that only happened on Windows and when the output/build directory was set to be the project base directory.

The fix is currently available on the SonarLint for Eclipse Dogfooding Update Site and will be released with 10.9 planned towards early November.

@alef75 just fyi, this sadly won’t fix your issue and I will continue the investigation and the discussion in the other Thread.

Thanks both of you for your feedback, all the information you provided and the help you provided with testing build artifacts on your side! :pray:

Best,
Tobias

1 Like

Hi Tobias,
Thank you for your help. The problem was resolved.

2 Likes