Error on Sonarlint update binding with new version of plugin 4.2

Hello,

For our project, we use SonarQube 6.7 and since we went through Eclipse 2019-09 with the sonarlint 4.2 plugin, we have an error while updating the projects binding:

Unable to update SonarLint binding data for project ‘gda:trunk’ on ‘sonar.ipazh.fr
Unable to move C:\KitDevGDA\workspace.sonarlint\work\sonar.ipazh.fr.sonartmp_5218269273439832674\2690657720642648316
to C:\KitDevGDA\workspace.sonarlint\storage\736f6e61722e6970617a682e6672\projects\6764613a7472756e6b’’’

We are working on windows 10, and Eclipse is launched with either an 8 or 11 jdk.
In the eclipse log file, the detailed error is:

! ENTRY org.sonarlint.eclipse.core 4 0 2019-10-05 11: 58: 13.550
! MESSAGE Unable to update SonarLint binding data for project ‘gda: trunk’ on ‘sonar.ipazh.fr
! STACK 0
java.lang.IllegalStateException: Unable to move C: \ KitDevGDA \ workspace \ .sonarlint \ work \ sonar.ipazh.com \ .sonartmp_5218269273439832674 \ 2690657720642648316 to C: \ KitDevGDA \ workspace \ .sonarlint \ storage \ 736f6e61722e6970617a682e6672 \ projects \ 6764613a7472756e6b
at org.sonarsource.sonarlint.core.client.api.util.FileUtils.moveDir (FileUtils.java:74)
at org.sonarsource.sonarlint.core.client.api.util.FileUtils.replaceDir (FileUtils.java:236)
at org.sonarsource.sonarlint.core.container.connected.update.perform.ProjectStorageUpdateExecutor.update (ProjectStorageUpdateExecutor.java:67)
at org.sonarsource.sonarlint.core.container.connected.ConnectedContainer.updateProject (ConnectedContainer.java:123)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.updateProject (ConnectedSonarLintEngineImpl.java:266)
at org.sonarlint.eclipse.core.internal.server.Server.updateProjectStorage (Server.java:417)
at org.sonarlint.eclipse.core.internal.jobs.ProjectStorageUpdateJob.lambda 0 (ProjectStorageUpdateJob.java:45) at java.base / java.util.Optional.ifPresent (Optional.java:183) at org.sonarlint.eclipse.core.internal.jobs.ProjectStorageUpdateJob.run (ProjectStorageUpdateJob.java:45) at org.eclipse.core.internal.jobs.Worker.run (Worker.java:63) Caused by: java.nio.file.AccessDeniedException: C: \ KitDevGDA \ workspace \ .sonarlint \ work \ sonar.ipazh.com \ .sonartmp_5218269273439832674 \ 2690657720642648316 -> C: \ KitDevGDA \ workspace \ .sonarlint \ storage \ 736f6e61722e6970617a682e6672 \ projects \ 6764613a7472756e6b at java.base / sun.nio.fs.WindowsException.translateToIOException (WindowsException.java:89) at java.base / sun.nio.fs.WindowsException.rethrowAsIOException (WindowsException.java:103) at java.base / sun.nio.fs.WindowsFileCopy.move (WindowsFileCopy.java:309) at java.base / sun.nio.fs.WindowsFileSystemProvider.move (WindowsFileSystemProvider.java:288) at java.base / java.nio.file.Files.move (Files.java:1421) at org.sonarsource.sonarlint.core.client.api.util.FileUtils.lambda moveDirPreferAtomic $ 0 (FileUtils.java:80)
at org.sonarsource.sonarlint.core.client.api.util.FileUtils.retry (FileUtils.java:265)
at org.sonarsource.sonarlint.core.client.api.util.FileUtils.retry (FileUtils.java:269)
at org.sonarsource.sonarlint.core.client.api.util.FileUtils.moveDirPreferAtomic (FileUtils.java:80)
at org.sonarsource.sonarlint.core.client.api.util.FileUtils.moveDir (FileUtils.java:72)
… 9 more

We did not have the problem before moving into this new version of the plugin and eclipse. Before we used Eclipse 2019-06 and sonarlint 4.1.
I completely removed the binding, empty the .sonarlint directory, and redo the binding and I still have the same error message.
I looked at the logs of the antivirus, but I do not see anything indicating any blockage.
Do you have any idea of the problem?

Thank You.

Hi

I tested downgrading to version 4.1 of the sonarlint plugin, and I still have the same problem. I have the impression that there is a compatibility problem with eclipse 2019-09.

Thank You.

Hello, thank you for your feedback.

I did a fresh install of SonarLint 4.2 with Eclipse Java 2019-09 on a Windows 10 box and managed to bind a project to a SonarQube server, so at least from a purely technical point of view I don’t see a compatibility issue between Eclipse 2019-09 and SonarLint.

According to the log excerpt you posted, the exception happens when the old server bindings are converted to the new storage format. The problem is that with Windows IO management, it is hard to know whether the problem arises with the creation of the new directory or the deletion of the old one :slight_smile:

Could you please try with a new empty workspace, to move the migration problem out of the way?

Hi,

I tried with an Eclipse 2019-09 having a blank workspace. I had deleted the .sonarlint directories located in the workspace, as well as in my windows user folder.
I created the connection with my SonarQube 6.7.7 server without making any link with my project: the recovery of the server information went well.
I import my project into Eclipse (via a GIT repository), then I create a Bind between my project and the Sonarqube project: exactly the same error is triggered at the end of the update.

Thank You

Hello.

We have the same exact problem here with the same versions of Julien (sonarlint 4.x, sonarqube 6.7).

Any clues?

Thanks.

Hi,

I just retest with the new version of sonarlint 4.3, and I still have the same problem.

Hello, thank you again for your feedback.

I am not able to reproduce this issue, so let’s dig a bit further:

  • Which exact version of the JDK do you use? Can you update to the last release of JDK8/JDK11?
  • Is is possible for you to temporarily disable your antivirus, or at least exclude the .sonarlint directory? This is a frequent cause of IO related errors on Windows, due to file locks.

Finally I was able to disable the write antivirus scan and I no longer have the error …
So the problem comes from there. thank you.