IntelliJ SonarLint Plugin: Failed to update project


  • SonarQube:
  • IntelliJ: 2021.2.2 (Runtime version 11.0.12)
  • SonarLint Plugin:

error observed

I tried to bind a new project and got the following error:


But even after updating the server bindings I get this message. Which is quite interesting since I chose the project from the project list.

steps to reproduce

I tried to analyze what’s going wrong and got the hint that there is a Verbose Output option for the Log window. So I enabled it and got the following:

Project 'a' in server binding 'SonarQube' updated
GET 200 https://…/sonarqube/api/qualityprofiles/search.protobuf?project=b | response time=37ms
Downloaded project quality profiles in 37ms
GET 200 https://…/sonarqube/api/settings/values.protobuf?component=b | response time=24ms
Downloaded settings in 25ms
Page downloaded in 27ms
GET 200 https://…/sonarqube/batch/issues?key=b | response time=24ms
	at java.base/<init>(
	at org.sonarlint.intellij.http.ApacheHttpResponse.bodyAsStream(ApacheHttpResponse.kt:35)
	at org.sonarlint.intellij.http.ApacheHttpResponse.bodyAsStream(ApacheHttpResponse.kt:26)
	at org.sonarsource.sonarlint.core.serverapi.issue.IssueApi.lambda$downloadAllFromBatchIssues$4(
	at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.processTimed(
	at org.sonarsource.sonarlint.core.serverapi.issue.IssueApi.downloadAllFromBatchIssues(
	at org.sonarsource.sonarlint.core.container.connected.update.perform.ServerIssueUpdater.updateServerIssues(
	at org.sonarsource.sonarlint.core.container.connected.update.perform.ProjectStorageUpdateExecutor.updateServerIssues(
	at org.sonarsource.sonarlint.core.container.connected.update.perform.ProjectStorageUpdateExecutor.lambda$update$0(
	at org.sonarsource.sonarlint.core.client.api.util.FileUtils.replaceDir(
	at org.sonarsource.sonarlint.core.container.connected.update.perform.ProjectStorageUpdateExecutor.update(
	at org.sonarsource.sonarlint.core.container.connected.ConnectedContainer.updateProject(
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.updateProject(
	at org.sonarlint.intellij.tasks.BindingStorageUpdateTask.updateProject(
	at org.sonarlint.intellij.tasks.BindingStorageUpdateTask.updateProjects(
	at org.sonarlint.intellij.tasks.BindingStorageUpdateTask$
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(
	at java.base/java.util.concurrent.CompletableFuture$
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.base/java.util.concurrent.ThreadPoolExecutor$
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$
	at java.base/ Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$
	at java.base/

SonarQube sends a 200, but an NPE is thrown? Interesting. So I opened a browser and hit that URL and got a response: a 0 byte “issues” file. This project has no issues.

potential workaround

Unbind the project?

I’m not sure, but quite convinced, that there is a bug receiving a 0 byte file from SonarQube. Might that be possible?

The sonarlint-intellij plugin extracts the bodyBytes of the response and uses it as constructor parameter for ByteArrayInputStream.
I guess the bodyBytes are null. I tried to verify in the HttpClient5 source code that an empty server response would lead to a null bodyBytes member. But I wasn’t able to figure this out, I was not able to find the place(s) where responses are received and the corresponding objects built.


Welcome to the community and thanks for raising this issue.

I am not able to reproduce, it works on my side if there is no issue on the server. But indeed your analysis is correct and bodyBytes is nullable, so I think in certain cases it can cause an exception.

I created this ticket to fix the problem.

Thanks again for reporting!

Thanks for investigating on this. It’s puzzling me that you can’t reproduce this. But I’m absolutely fine waiting for this change.

Hello, FYI version which includes a fix for the aforementioned issue has just been published to the JetBrains plugin repository.

Works now. Thank you very much!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.