SonarLint not showing errors from SonarQube

Please provide

  • Operating system: macOS 15.1 (24B83)
  • SonarLint plugin version: 10.12.0.79769
  • IntelliJ version: IntelliJ IDEA 2024.3 (Ultimate Edition) Build #IU-243.21565.193
  • Programming language you’re coding in: Koltin
  • Is connected mode used:
    • Connected to SonarQube (and which version): Enterprise Edition Version 10.4.1 (build 88267)

And a thorough description of the problem / question:

It seems like SonarLint does not query SonarQube to get the open issues for the current branch.
I have both seen issues in SonarQube, that haven’t been reflected in SonarLint. I do have the .sonarlint/connectedMode.json file.

I also see that HTTP requests are going to my SonarQube instance

[Smart Notifications Polling] DEBUG sonarlint - GET 200 https://<domain>/api/developers/search_events?projects=<my_project>&from=2024-12-02T10%3A47%3A46%2B0000

However, as you can see, it is not filtering by branch which seems like the issue. Furthermore, im not sure if this HTTP endpoint even supports filtering by branch.

My use case for SonarLint is
I wanted to shift left by detecting issues from SonarQube in the IDE instead of during the CI in the merge request. I also wanted to be able to see that I resolved issues locally without waiting for the CI’s sonarqube job to finish if I had an issue. SonarLint wasn’t able to achieve either of these for me.

Hi @Mark3

Could you share with us the SonarLint logs?

Logs can be seen below.

I guess these two lines in particular look suspicious

 [2024-12-03T16:08:14.486] [sonarlint-server-tracking-issue-updater] DEBUG sonarlint - Skip downloading file issues on SonarQube
 [2024-12-03T16:08:14.487] [sonarlint-server-tracking-issue-updater] DEBUG sonarlint - Skip downloading file hotspots on SonarQube 10.1+
Trigger: CURRENT_FILE_ACTION
[CURRENT_FILE_ACTION] 1 file(s) submitted
Configuring analysis with org.sonarlint.intellij.java.JavaAnalysisConfigurator
Cancelling analysis 89a652d9-25c6-49b4-9d14-e206c86b5e29
Analysing 'FileWithIssuesInSonarQube.kt' (ID cb411300-857a-4e26-97bb-13a879d81ded)...
 [2024-12-03T16:08:14.023] [sonarlint-analysis-engine] DEBUG sonarlint - Start analysis
 [2024-12-03T16:08:14.025] [sonarlint-analysis-engine] INFO sonarlint - Index files
 [2024-12-03T16:08:14.025] [sonarlint-analysis-engine] DEBUG sonarlint - Language of file "file:///Users/mark/myproject/path/to/file/in/intellij/FileWithIssuesInSonarQube.kt" is detected to be "KOTLIN"
 [2024-12-03T16:08:14.025] [Report about progress of file indexation] INFO sonarlint - 1 file indexed
 [2024-12-03T16:08:14.036] [sonarlint-analysis-engine] DEBUG sonarlint - Added 304 checks for language='ts', repository='typescript'
 [2024-12-03T16:08:14.036] [sonarlint-analysis-engine] DEBUG sonarlint - Added 303 checks for language='js', repository='javascript'
 [2024-12-03T16:08:14.037] [sonarlint-analysis-engine] DEBUG sonarlint - No registered JsAnalysisConsumer.
 [2024-12-03T16:08:14.045] [sonarlint-analysis-engine] DEBUG sonarlint - 'JavaSensor' skipped because there are no related files in the current project
 [2024-12-03T16:08:14.045] [sonarlint-analysis-engine] DEBUG sonarlint - 'Python Sensor' skipped because there are no related files in the current project
 [2024-12-03T16:08:14.045] [sonarlint-analysis-engine] DEBUG sonarlint - 'IPython Notebooks Sensor' skipped because there are no related files in the current project
 [2024-12-03T16:08:14.045] [sonarlint-analysis-engine] DEBUG sonarlint - Execute Sensor: Kotlin Sensor
 [2024-12-03T16:08:14.045] [sonarlint-analysis-engine] DEBUG sonarlint - The Kotlin analyzer is running in a context where unchanged files cannot be skipped.
 [2024-12-03T16:08:14.045] [Progress of the Kotlin analysis] INFO sonarlint - 1 source file to be analyzed
 [2024-12-03T16:08:14.046] [sonarlint-analysis-engine] DEBUG sonarlint - Using Kotlin 1.9 to parse source code
 [2024-12-03T16:08:14.046] [sonarlint-analysis-engine] DEBUG sonarlint - Using the default amount of threads
 [2024-12-03T16:08:14.457] [sonarlint-analysis-engine] DEBUG sonarlint - Initializing metadata of file file:///Users/mark/myproject/path/to/file/in/intellij/FileWithIssuesInSonarQube.kt
 [2024-12-03T16:08:14.47] [Progress of the Kotlin analysis] INFO sonarlint - 1/1 source file has been analyzed
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - Execute Sensor: Gradle Sensor
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - 'IaC Terraform Sensor' skipped because there are no related files in the current project
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - 'IaC CloudFormation Sensor' skipped because there are no related files in the current project
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - 'IaC Kubernetes Sensor' skipped because there are no related files in the current project
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - 'IaC AzureResourceManager Sensor' skipped because there are no related files in the current project
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - Execute Sensor: Java Config Sensor
 [2024-12-03T16:08:14.47] [Progress of the Java analysis] INFO sonarlint - 0 source files to be analyzed
 [2024-12-03T16:08:14.47] [Progress of the Java analysis] INFO sonarlint - 0/0 source files have been analyzed
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - 'JavaScript/TypeScript analysis' skipped because there are no related files in the current project
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - 'JavaScript inside YAML analysis' skipped because there are no related files in the current project
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - 'JavaScript inside HTML analysis' skipped because there are no related files in the current project
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - Execute Sensor: CSS Rules
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] INFO sonarlint - No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - 'Ruby Sensor' skipped because there are no related files in the current project
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - 'PL/SQL Sensor' skipped because there are no related files in the current project
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - Execute Sensor: EnterpriseSecretsSensor
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - 'Scala Sensor' skipped because there are no related files in the current project
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - Execute Sensor: HTML
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - 'XML Sensor' skipped because there are no related files in the current project
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - 'PHP sensor' skipped because there are no related files in the current project
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - 'Analyzer for "php.ini" files' skipped because there are no related files in the current project
 [2024-12-03T16:08:14.47] [sonarlint-analysis-engine] DEBUG sonarlint - Execute Sensor: TextAndSecretsSensor
 [2024-12-03T16:08:14.478] [Progress of the text and secrets analysis] INFO sonarlint - 1 source file to be analyzed
 [2024-12-03T16:08:14.484] [Progress of the text and secrets analysis] INFO sonarlint - 1/1 source file has been analyzed
 [2024-12-03T16:08:14.484] [sonarlint-analysis-engine] DEBUG sonarlint - 'Swift Code Quality and Security' skipped because there are no related files in the current project
 [2024-12-03T16:08:14.484] [sonarlint-analysis-engine] DEBUG sonarlint - Execute Sensor: IaC Docker Sensor
 [2024-12-03T16:08:14.486] [Progress of the Docker analysis] INFO sonarlint - 0 source files to be analyzed
 [2024-12-03T16:08:14.486] [Progress of the Docker analysis] INFO sonarlint - 0/0 source files have been analyzed
 [2024-12-03T16:08:14.486] [sonarlint-analysis-engine] DEBUG sonarlint - Execute Sensor: pythonbugs
 [2024-12-03T16:08:14.486] [sonarlint-analysis-engine] INFO sonarlint - Analysis detected 1 issue and 0 Security Hotspots in 549ms
 [2024-12-03T16:08:14.486] [sonarlint-server-tracking-issue-updater] DEBUG sonarlint - Skip downloading file issues on SonarQube
 [2024-12-03T16:08:14.487] [sonarlint-server-tracking-issue-updater] DEBUG sonarlint - Skip downloading file hotspots on SonarQube 10.1+
Analysis cb411300-857a-4e26-97bb-13a879d81ded finished
 [2024-12-03T16:08:30.564] [Smart Notifications Polling] DEBUG sonarlint - GET 200 https://<domain>/api/developers/search_events?projects=myproject&from=2024-12-03T16%3A07%3A30%2B0000 | response time=46ms
 [2024-12-03T16:08:30.565] [Smart Notifications Polling] DEBUG sonarlint - Storing last event polling in /Users/mark/Library/Caches/JetBrains/IntelliJIdea2024.3/sonarlint/storage/436f6d706c79416476616e7461676520536f6e61725175626520696e7374616e6365/projects/6f726368657374726174696f6e2d6c61796572/last_event_polling.pb

Hey @Mark3, could the current filtering not allow you to see the issue raised?

Can you try to enable this filter on the left:

But those issues weren’t resolved. Also mine looks different it looks like this

Sorry, this was a preview of our next version that will be released later this week! :smile:

This is an unrelated call which is expected not to have branch information.

This is also unrelated and expected

Just so I can understand the problem correctly. Issues are being raised locally (this is visible in your logs: Analysis detected 1 issue), but it does not match the status of the server’s issues.

What is the issue raised on SonarQube and what’s its status? What do you see in your IDE?

That is correct

IntelliJ is not aware of the issues raised from the connected SonarQube server.

I can try to get an image but i will have to reproduce the issue so give me some time…