Hi! I’ve faced issue with binding project to SonarCloud project.
Used Versions
Eclipse: Eclipse IDE for Enterprise Java Developers 2018-12 (4.10.0), build id 20181214-0600
SonarLint: 4.1 (downloaded from eclipse marketplace)
Public SonarCloud project: https://sonarcloud.io/dashboard?id=student-project
It is successfully add SonarCloud server, but it show error dialog when I try to bind eclipse project to SonarCloud project.
Message:
Unable to update SonarLint binding data for project 'student-project' on 'Students'
Stack Trace:
org.sonarsource.sonarlint.core.client.api.exceptions.ProjectNotFoundException: Project with key 'student-project' not found on SonarQube server (was it deleted?)
at org.sonarsource.sonarlint.core.container.connected.update.ProjectQualityProfilesDownloader.fetchModuleQualityProfiles(ProjectQualityProfilesDownloader.java:67)
at org.sonarsource.sonarlint.core.container.connected.update.ProjectConfigurationDownloader.fetchQualityProfiles(ProjectConfigurationDownloader.java:60)
at org.sonarsource.sonarlint.core.container.connected.update.ProjectConfigurationDownloader.fetch(ProjectConfigurationDownloader.java:45)
at org.sonarsource.sonarlint.core.container.connected.update.perform.ProjectStorageUpdateExecutor.updateConfiguration(ProjectStorageUpdateExecutor.java:79)
at org.sonarsource.sonarlint.core.container.connected.update.perform.ProjectStorageUpdateExecutor.lambda$update$0(ProjectStorageUpdateExecutor.java:70)
at org.sonarsource.sonarlint.core.client.api.util.FileUtils.replaceDir(FileUtils.java:171)
at org.sonarsource.sonarlint.core.container.connected.update.perform.ProjectStorageUpdateExecutor.update(ProjectStorageUpdateExecutor.java:69)
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:402)
at org.sonarlint.eclipse.core.internal.jobs.ProjectStorageUpdateJob.lambda$0(ProjectStorageUpdateJob.java:45)
at java.util.Optional.ifPresent(Unknown Source)
at org.sonarlint.eclipse.core.internal.jobs.ProjectStorageUpdateJob.run(ProjectStorageUpdateJob.java:45)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Session Data:
eclipse.buildId=4.10.0.I20181206-0815
java.version=1.8.0_201
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product -data file:/C:/Users/alexey_perov/eclipse-workspace/ -product org.eclipse.epp.package.jee.product
If start project analyze, following error will occur in SonarLint console:
Starting SonarLint for Eclipse 4.1.0.201901311043
Error during execution of SonarLint analysis
org.sonarsource.sonarlint.core.client.api.exceptions.StorageException: Failed to read file: C:\Users\alexey_perov\eclipse-workspace\.sonarlint\storage\Student\projects\student-project\configuration.pb
at org.sonarsource.sonarlint.core.container.storage.ProtobufUtil.readFile(ProtobufUtil.java:46)
at org.sonarsource.sonarlint.core.container.storage.StorageReader.readProjectConfig(StorageReader.java:98)
at org.sonarsource.sonarlint.core.container.storage.StorageFileExclusions.getExcludedFiles(StorageFileExclusions.java:47)
at org.sonarsource.sonarlint.core.container.storage.StorageContainerHandler.getExcludedFiles(StorageContainerHandler.java:110)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$getExcludedFiles$12(ConnectedSonarLintEngineImpl.java:231)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:344)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:334)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.getExcludedFiles(ConnectedSonarLintEngineImpl.java:231)
at org.sonarlint.eclipse.core.internal.server.Server.getServerFileExclusions(Server.java:526)
at org.sonarlint.eclipse.core.internal.utils.FileExclusionsChecker.lambda$2(FileExclusionsChecker.java:72)
at java.util.Optional.ifPresent(Unknown Source)
at org.sonarlint.eclipse.core.internal.utils.FileExclusionsChecker.filterExcludedFiles(FileExclusionsChecker.java:70)
at org.sonarlint.eclipse.core.internal.utils.FileExclusionsChecker.isExcluded(FileExclusionsChecker.java:84)
at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.lambda$0(AbstractAnalyzeProjectJob.java:132)
at java.util.Arrays$ArrayList.forEach(Unknown Source)
at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.doRun(AbstractAnalyzeProjectJob.java:131)
at org.sonarlint.eclipse.core.internal.jobs.AbstractSonarProjectJob.runInWorkspace(AbstractSonarProjectJob.java:44)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:42)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.nio.file.NoSuchFileException: C:\Users\alexey_perov\eclipse-workspace\.sonarlint\storage\Student\projects\student-project\configuration.pb
at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(Unknown Source)
at java.nio.file.Files.newByteChannel(Unknown Source)
at java.nio.file.Files.newByteChannel(Unknown Source)
at java.nio.file.spi.FileSystemProvider.newInputStream(Unknown Source)
at java.nio.file.Files.newInputStream(Unknown Source)
at org.sonarsource.sonarlint.core.container.storage.ProtobufUtil.readFile(ProtobufUtil.java:43)
... 18 more
Steps to reproduce
- Create new Java project in eclipse
- Install SonarLint plugin from Marketplace
- Connect to SonarCloud server (using token)
- Bind just created project to just connected server (using student-project as project key)
- Error message occur
Extra info
I’ve tried to do same thing in Intellij IDEA and it work fine.
Intellij IDEA version: IntelliJ IDEA 2018.3.4 (Community Edition) Build #IC-183.5429.30, built on January 29, 2019
SonarLint plugin for Intellij IDEA version: v4.0.2.3009