Troubleshooting
Knowing where to begin looking for information is the first step to reaching out for help. Many answers to commonly found problems can be found on the SonarLint channel of the Sonar Community Forum. See below for the basic steps to access the SonarLint logs when the analysis results are not what you expected.
How to get SonarLint logs
- Open the Eclipse Console view.
- Open the SonarLint Console.
- Behind the double-gear dropdown menu in the Console view, enable Verbose output and Analysis logs.
- Reproduce the issue; for example, reopen the offending file.
IDE-specific traces are useful when troubleshooting only when Eclipse-specific activity is related to SonarLint errors.
How to get the Eclipse logs
Sometimes errors are not in the SonarLint console but could be directly in Eclipse error logs.
- Open Eclipse Error Log view: go to Eclipse > Window > Show view > Other... > General and select Error Log from the list
- Look for an error event related to SonarLint
- Open event details to get the stacktrace
How to get SonarLint thread dumps
In some cases, it can be useful to extract thread dumps from the running instance of your IDE for debugging; thread dumps can help us investigate UI freeze issues or threading problems.
If SonarLint does not start or stops working and the IDE is still running, thread dumps are necessary to properly troubleshoot the problem before the IDE is restarted. If you restart the IDE, some information about what was happening when it failed will be lost. Fortunately, thread dumps are easy to obtain for both SonarLint and your IDE.
Once obtained, please report your error to the Community forum. Your thread dump may contain sensitive details and if it’s required for further troubleshooting, it will be possible to share your thread dump privately.
Getting an IDE thread dump
You must first get the process ID for your IDE, then export the thread dump. The jps
and jstack
commands below are utilities that come bundled with the Java JDK.
- Run the following command and note the process ID number returned for your IDE:
- Second, run the following command using your process ID to return the thread dump. Be sure to specify your process ID and change the name of the output file if you’d like:
Getting a SonarLint thread dump
Getting the process ID for SonarLint is the same as for the IDE; simply note the ID for SonarLintServerCli
or run the command again, then export the thread dump. The jps
and jstack
commands below are utilities that come bundled with the Java JDK.
- Run the following command and note the process ID number returned for
SonarLintServerCli
:
- Second, run the following command using your process ID to return the thread dump. Be sure to specify your process ID and change the name of the output file if you’d like:
Troubleshooting Connected Mode setup
No matching project found
No matching project is found because:
- It's best if you already have the project open in your IDE, otherwise SonarLint might not be able to find a matching file.
- SonarLint can get confused if you have multiple projects open in the workspace. Please open or choose the correct project and try again.
If these solutions don't help, follow these instructions to manually configure the project binding.
No matching issue found
SonarLint can't find your issue because:
- You might not be on the same branch.
- The issue was fixed, or the source code may be different from the analyzed version.
I have configured some SonarScanner properties. Are they applied to SonarLint?
No. Scanner properties you may have defined in the sonar-project.properties
or pom.xml
files (for example sonar.sources
or sonar.projectBasedir
) only make sense when modifying the SonarScanner in the command line. SonarLint tries to use IDE metadata to avoid other configurations.
If you want to share some configuration between SonarScanners and SonarLint, like exclusions, or some analyzer properties, the best way is to use Connected Mode and set the configuration in the SonarQube or SonarCloud UI.
Was this page helpful?