Connected to SonarCloud or SonarQube (and which version): SonarQube Community 9.6.0.59041
SonarLint Plugin can not be connected to SonarQube Community edition.
I tried to bind via Token and Id-Pass way but while syncing rules etc. it gives an error
Error: Error 400 on /api/issues/pull?projectKey=<ProjectKeyHere>&branchName=&languages=web,java,js,kotlin,php,py,ruby,scala,secrets,swift,ts,xml: The 'branchName' parameter is missing
As this is a community edition I can’t use GIT analysis and I don’t want to. Any project key that I use is not working.
I’m facing the same issue with version 7.0.0.52289. When I downgraded to version 6.8.0.50884, I did not get the error message.
I’m running the latest version of IntelliJ:
IntelliJ IDEA 2022.2.1 (Ultimate Edition)
Build #IU-222.3739.54, built on August 16, 2022
Runtime version: 17.0.3+7-b469.37 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
Non-Bundled Plugins:
google-java-format (1.15.0.0)
com.intellij.selenium (222.4005)
org.sonarlint.idea (6.8.0.50884)
CheckStyle-IDEA (5.70.0)
com.intellij.bigdatatools (222.3345.33)
And an on premise version of SonarQube CE: 9.6.0.59041
Do you also use git in your project ? Does the error happen when you switch branch ? Could you please enable verbose logs, reproduce the problem and share the logs with us ?
Strange thing happened. Because I was on 6.8.0.50884 and IntelliJ Idea did not let me update to the latest (do not know why), I decided to uninstall 6.8.0.50884, restart Idea, install 7.0.0.52289, restart Idea.
After having 7.0.0.52289 available, the error I previously saw did not occur anymore.
Also tested when switching branches (from within IntelliJ). All seems working now as expected. So I’m not able to reproduce the problem at the moment. As soon as I hit the problem again I will capture the logs.
The only explanation I can see is that your local storage is somehow corrupted. We locally cache server branches and this file might be broken.
If by chance you still face the problem Raghav, or if it comes back Jan, could you share with us the contents of this cache file ? It is located in your IDE System folder, generally under sonarlint/storage/XXXX/projects/YYYY/project_branches.pb.
A way to workaround the problem would be to remove this file (or even the full folder) and go to Settings > Tools > SonarLint > Project Settings > Update local storage.
Error when I first create connection with SonarQube:
> Error refreshing taint vulnerabilities
> java.lang.IllegalStateException: Error 400 on /api/issues/pull_taint?projectKey=Caremiles-Android&branchName=&languages=web,java,js,kotlin,php,py,ruby,scala,secrets,swift,ts,xml: The 'branchName' parameter is missing
> at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.handleError(ServerApiHelper.java:136)
> at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.get(ServerApiHelper.java:70)
> at org.sonarsource.sonarlint.core.serverapi.issue.IssueApi.lambda$pullTaintIssues$9(IssueApi.java:223)
> at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.processTimed(ServerApiHelper.java:225)
> at org.sonarsource.sonarlint.core.serverapi.issue.IssueApi.pullTaintIssues(IssueApi.java:222)
> at org.sonarsource.sonarlint.core.serverconnection.TaintIssueDownloader.downloadTaintFromPull(TaintIssueDownloader.java:93)
> at org.sonarsource.sonarlint.core.serverconnection.ServerIssueUpdater.syncTaints(ServerIssueUpdater.java:65)
> at org.sonarsource.sonarlint.core.serverconnection.ServerConnection.syncServerTaintIssuesForProject(ServerConnection.java:206)
> at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.syncServerTaintIssues(ConnectedSonarLintEngineImpl.java:445)
> at org.sonarlint.intellij.issue.vulnerabilities.TaintVulnerabilitiesPresenter.syncTaintVulnerabilitiesFor$lambda-2(TaintVulnerabilitiesPresenter.kt:99)
> at java.base/java.util.Optional.ifPresent(Optional.java:183)
> at org.sonarlint.intellij.issue.vulnerabilities.TaintVulnerabilitiesPresenter.syncTaintVulnerabilitiesFor(TaintVulnerabilitiesPresenter.kt:97)
> at org.sonarlint.intellij.issue.vulnerabilities.TaintVulnerabilitiesPresenter.refreshTaintVulnerabilitiesForOpenFiles(TaintVulnerabilitiesPresenter.kt:74)
> at org.sonarlint.intellij.issue.vulnerabilities.TaintVulnerabilitiesPresenter$refreshTaintVulnerabilitiesForOpenFilesAsync$1.run(TaintVulnerabilitiesPresenter.kt:66)
> at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:450)
> at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:117)
> at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:510)
> at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:243)
> at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:183)
> at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:705)
> at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:647)
> at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:63)
> at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:170)
> at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:243)
> at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
> at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
> at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
> at java.base/java.security.AccessController.doPrivileged(Native Method)
> at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
> at java.base/java.lang.Thread.run(Thread.java:829)
Error after doing your suggested workaround:
A way to workaround the problem would be to remove this file (or even the full folder) and go to Settings > Tools > SonarLint > Project Settings > Update local storage.
> Downloaded plugin list in 265ms
> [SYNC] Synchronizing analyzer configuration for project 'Caremiles-Android'
> Downloaded settings in 329ms
> [SYNC] Fetching rule set for language 'java' from profile 'AYLPjziTEevrcnx5PP4-'
> [SYNC] Fetching rule set for language 'js' from profile 'AYLPjzSvEevrcnx5PPQh'
> [SYNC] Fetching rule set for language 'kotlin' from profile 'AYLPjzPmEevrcnx5PPIn'
> [SYNC] Fetching rule set for language 'php' from profile 'AYLPjzraEevrcnx5PQKu'
> [SYNC] Fetching rule set for language 'py' from profile 'AYLPjzWsEevrcnx5PPZF'
> [SYNC] Fetching rule set for language 'ruby' from profile 'AYLPjzZzEevrcnx5PPcu'
> [SYNC] Fetching rule set for language 'scala' from profile 'AYLPjzL0Eevrcnx5PPEA'
> [SYNC] Fetching rule set for language 'ts' from profile 'AYLPjz8FEevrcnx5PQfq'
> [SYNC] Fetching rule set for language 'web' from profile 'AYLPjzl4Eevrcnx5PQBY'
> [SYNC] Fetching rule set for language 'xml' from profile 'AYLPjzpWEevrcnx5PQE-'
> [SYNC] Synchronizing project branches for project 'Caremiles-Android'
> [SYNC] Synchronizing taint issues for project 'Caremiles-Android' on branch 'master'
> Clearing all issues because binding was updated
> Using connection 'Sonar-Arpatech' for project 'Caremiles-Android'
> Analysing 'build.gradle'...
> Using connection 'Sonar-Arpatech' for project 'Caremiles-Android'
> Analysing 'build.gradle'...
> Found 0 issues