Exception happened during initial sync with project

  • Operating system: Ubuntu 20.04 LTS
  • SonarLint plugin version: v4.0.5
  • Programming language you’re coding in: Cxx
  • Is connected mode used:
    • Connected to SonarCloud

I’m trying to bind folder with a project on a server. I’m able to establish connection to SonarCloud but when I’m adding bindings client says there is no projects on remote. When I set information about binding in settings.json I can see an NotFoundException

[Warn  - 11:56:32.171] Exception happened during initial sync with project acp-edge-hub
[Warn  - 11:56:32.172] org.sonarsource.sonarlint.core.serverapi.exception.NotFoundException: Error 404 on https://sonarcloud.io/api/components/tree.protobuf?qualifiers=FIL,UTS&component=<project_name>&organization=<org_name>&ps=500&p=1

But if I try this URL in browser it works just fine and creates protobuf file with some content.

Any suggestions why jar cannot connect to the server?

Hello @vsh, welcome to Sonar Community! :wave: :sonar:

Thank you for reporting this. According to the symptoms you describe, I think that the connection has not been properly established to SonarCloud - most probably because the provided user token is wrong. If you go to SonarLint > Connected Mode > SonarCloud, what do you see? If the connection is successful, you should see a blue checkmark like below.

You can always edit the connection with the fresh user token. :pencil2:

If you believe the problem lies somewhere else, please provide us with SonarLint logs so that we can better understand what is going on. :page_with_curl:

All the best,
Sophio :sonarlint_vscode:

Hi @sophio.japharidze,

I’m getting the same error while I’m configuring the SonarLint in VS Code for the ts. I have my in house SonarQube Server and I made the connection with it by using the global analysis token having all permissions.

I also verified the blue tick in SonarLint extension.

Getting the error

Executing /home/shoaib/.vscode-server/extensions/sonarsource.sonarlint-vscode-4.1.0-linux-x64/jre/21.0.1-linux-x86_64.tar/bin/java -jar /home/shoaib/.vscode-server/extensions/sonarsource.sonarlint-vscode-4.1.0-linux-x64/server/sonarlint-ls.jar -stdio -analyzers /home/shoaib/.vscode-server/extensions/sonarsource.sonarlint-vscode-4.1.0-linux-x64/analyzers/sonargo.jar /home/shoaib/.vscode-server/extensions/sonarsource.sonarlint-vscode-4.1.0-linux-x64/analyzers/sonarjava.jar /home/shoaib/.vscode-server/extensions/sonarsource.sonarlint-vscode-4.1.0-linux-x64/analyzers/sonarjs.jar /home/shoaib/.vscode-server/extensions/sonarsource.sonarlint-vscode-4.1.0-linux-x64/analyzers/sonarphp.jar /home/shoaib/.vscode-server/extensions/sonarsource.sonarlint-vscode-4.1.0-linux-x64/analyzers/sonarpython.jar /home/shoaib/.vscode-server/extensions/sonarsource.sonarlint-vscode-4.1.0-linux-x64/analyzers/sonarhtml.jar /home/shoaib/.vscode-server/extensions/sonarsource.sonarlint-vscode-4.1.0-linux-x64/analyzers/sonarxml.jar /home/shoaib/.vscode-server/extensions/sonarsource.sonarlint-vscode-4.1.0-linux-x64/analyzers/sonarcfamily.jar /home/shoaib/.vscode-server/extensions/sonarsource.sonarlint-vscode-4.1.0-linux-x64/analyzers/sonartext.jar /home/shoaib/.vscode-server/extensions/sonarsource.sonarlint-vscode-4.1.0-linux-x64/analyzers/sonariac.jar /home/shoaib/.vscode-server/extensions/sonarsource.sonarlint-vscode-4.1.0-linux-x64/analyzers/sonarlintomnisharp.jar
[stderr] SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
[stderr] SLF4J: Defaulting to no-operation (NOP) logger implementation
[stderr] SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Initializing file:///home/shoaib/Sparrow/Sparrow/Core on branch Feature/bulksend_core_SIT_changes_branch-from-1.0.2.27
[Debug - 16:20:33.040] Folder file:///home/shoaib/Sparrow/Sparrow/Core is now on branch Feature/bulksend_core_SIT_changes_branch-from-1.0.2.27.
[Debug - 16:20:33.009] Fetching global configuration
[Debug - 16:20:33.180] Queuing analysis of file "file:///home/shoaib/Sparrow/Sparrow/Core/Node/local_modules/batch.ts" (version 1)
[Debug - 16:20:33.208] Queuing analysis of file "file:///home/shoaib/Sparrow/Sparrow/Core/Node/APIServerChannel/controller/instructionstatus.ts" (version 1)
[Debug - 16:20:33.208] Queuing analysis of file "file:///home/shoaib/Sparrow/Sparrow/Core/Node/local_modules/connection.ts" (version 1)
No submodules found in '/home/shoaib/Sparrow/Sparrow' repository. Error: Error: write EPIPE
Error when detecting ignored files:
[Debug - 16:20:33.361] Cached SCM ignore status for file "file:///home/shoaib/Sparrow/Sparrow/Core/Node/local_modules/batch.ts": Not ignored
[Info  - 16:20:36.983] Started embedded server on port 64120
[Debug - 16:20:37.022] Restoring previous local-only issue database from /home/shoaib/.sonarlint/storage/local_only_issue_backup.tar.gz
[Debug - 16:20:37.039] Starting local-only issue database from /home/shoaib/.sonarlint/xodus-local-only-issue-store14753552309947711800
[Debug - 16:20:37.901] Creating a new StorageFacade for storageRoot=/home/shoaib/.sonarlint/storage and workDir=/home/shoaib/.sonarlint/work
[Debug - 16:20:38.038] Binding suggestion computation queued for config scopes '<root>'...
[Debug - 16:20:38.043] Configuration scope '<root>' is not bindable.
[Debug - 16:20:38.050] Fetching configuration for folder 'file:///home/shoaib/Sparrow/Sparrow/Core'
[Debug - 16:20:38.742] Starting connected SonarLint engine for 'Core Sparrow'...
[Debug - 16:20:38.759] Node.js path provided by configuration: /home/shoaib/node-v18.17.0-linux-x64/bin/node
[Debug - 16:20:38.759] Checking node version...
[Debug - 16:20:38.749] Workspace folder 'WorkspaceFolder[name=Core,uri=file:///home/shoaib/Sparrow/Sparrow/Core]' configuration updated: WorkspaceFolderSettings[analyzerProperties={sonar.cs.file.suffixes=.cs, sonar.cs.internal.useNet6=true, sonar.cs.internal.loadProjectOnDemand=false, sonar.cs.internal.loadProjectsTimeout=60},connectionId=Core Sparrow,pathToCompileCommands=,projectKey=Core-Sparrow,testFilePattern=]
[Debug - 16:20:38.779] Execute command '/home/shoaib/node-v18.17.0-linux-x64/bin/node -v'...
[Debug - 16:20:38.780] Global settings updated: WorkspaceSettings[connections={Core Sparrow=ServerConnectionSettings[connectionId=Core Sparrow,disableNotifications=true,organizationKey=<null>,serverUrl=http://192.168.6.252:9000]},disableTelemetry=false,excludedRules=[],focusOnNewCode=false,includedRules=[],pathToNodeExecutable=/home/shoaib/node-v18.17.0-linux-x64/bin/node,ruleParameters={},showAnalyzerLogs=false,showVerboseLogs=true]
[Debug - 16:20:38.959] Command '/home/shoaib/node-v18.17.0-linux-x64/bin/node -v' exited with 0
stdout: v18.17.0
[Debug - 16:20:38.961] Detected node version: 18.17.0
[Debug - 16:20:39.369] Default settings updated: WorkspaceFolderSettings[analyzerProperties={sonar.cs.file.suffixes=.cs, sonar.cs.internal.useNet6=true, sonar.cs.internal.loadProjectOnDemand=false, sonar.cs.internal.loadProjectsTimeout=60},connectionId=Core Sparrow,pathToCompileCommands=,projectKey=Core-Sparrow,testFilePattern=]
[Debug - 16:20:39.620] GET 200 http://192.168.6.252:9000/api/system/status | response time=786ms
[Debug - 16:20:39.621] Downloaded server infos in 269ms
[Debug - 16:20:39.708] GET 200 http://192.168.6.252:9000/api/authentication/validate?format=json | response time=85ms
[Debug - 16:20:39.776] Loaded 8 plugins
[Debug - 16:20:39.776]   * C# Code Quality and Security (Omnisharp) 1.15.0.80820 (csharp)
[Debug - 16:20:39.777]   * CFamily Code Quality and Security 6.50.0.64514 (cpp)
[Debug - 16:20:39.777]   * HTML Code Quality and Security 3.9.0.3600 (web)
[Debug - 16:20:39.777]   * XML Code Quality and Security 2.10.0.4108 (xml)
[Debug - 16:20:39.777]   * Go Code Quality and Security 1.15.0.4655 (go)
[Debug - 16:20:39.778]   * IaC Code Quality and Security 1.22.0.7057 (iac)
[Debug - 16:20:39.778]   * Text Code Quality and Security 2.7.1.1388 (text)
[Debug - 16:20:39.778]   * JavaScript/TypeScript/CSS Code Quality and Security 10.9.0.24449 (javascript)
[Debug - 16:20:44.542] Creating container for module 'file:///home/shoaib/Sparrow/Sparrow/Core'
[Debug - 16:20:44.623] SonarLint engine started for connection 'Core Sparrow'
[Debug - 16:20:44.718] GET 403 http://192.168.6.252:9000/api/components/tree.protobuf?qualifiers=FIL,UTS&component=Core-Sparrow&ps=500&p=1 | response time=44ms
[Warn  - 16:20:44.720] Exception happened during initial sync with project Core-Sparrow
[Warn  - 16:20:44.720] java.lang.IllegalStateException: Insufficient privileges
    at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.handleError(ServerApiHelper.java:148)
    at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.processPage(ServerApiHelper.java:209)
    at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.lambda$getPaginated$5(ServerApiHelper.java:198)
    at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.lambda$consumeTimed$8(ServerApiHelper.java:274)
    at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.processTimed(ServerApiHelper.java:249)
    at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.consumeTimed(ServerApiHelper.java:273)
    at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.getPaginated(ServerApiHelper.java:196)
    at org.sonarsource.sonarlint.core.serverapi.component.ComponentApi.getAllFileKeys(ComponentApi.java:45)
    at org.sonarsource.sonarlint.core.serverconnection.ProjectFileListDownloader.get(ProjectFileListDownloader.java:29)
    at org.sonarsource.sonarlint.core.serverconnection.ProjectStorageUpdateExecutor.updateComponents(ProjectStorageUpdateExecutor.java:59)
    at org.sonarsource.sonarlint.core.serverconnection.ProjectStorageUpdateExecutor.lambda$update$0(ProjectStorageUpdateExecutor.java:52)
    at org.sonarsource.sonarlint.core.serverconnection.FileUtils.replaceDir(FileUtils.java:113)
    at org.sonarsource.sonarlint.core.serverconnection.ProjectStorageUpdateExecutor.update(ProjectStorageUpdateExecutor.java:52)
    at org.sonarsource.sonarlint.core.serverconnection.ServerConnection.updateProject(ServerConnection.java:266)
    at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.updateProject(ConnectedSonarLintEngineImpl.java:517)
    at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.syncAtStartup(ProjectBindingManager.java:234)
    at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.computeProjectBinding(ProjectBindingManager.java:219)
    at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.lambda$getBinding$0(ProjectBindingManager.java:185)
    at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(Unknown Source)
    at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.getBinding(ProjectBindingManager.java:178)
    at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.getBinding(ProjectBindingManager.java:163)
    at org.sonarsource.sonarlint.ls.folders.WorkspaceFoldersManager.lambda$getBindingProvider$6(WorkspaceFoldersManager.java:131)
    at org.sonarsource.sonarlint.ls.folders.WorkspaceFoldersManager.lambda$addFolder$5(WorkspaceFoldersManager.java:124)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)
 
[Debug - 16:20:45.277] GET 403 http://192.168.6.252:9000/api/components/tree.protobuf?qualifiers=FIL,UTS&component=Core-Sparrow&ps=500&p=1 | response time=57ms
[Warn  - 16:20:45.278] Exception happened during initial sync with project Core-Sparrow
[Warn  - 16:20:45.278] java.lang.IllegalStateException: Insufficient privileges
    at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.handleError(ServerApiHelper.java:148)
    at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.processPage(ServerApiHelper.java:209)
    at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.lambda$getPaginated$5(ServerApiHelper.java:198)
    at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.lambda$consumeTimed$8(ServerApiHelper.java:274)
    at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.processTimed(ServerApiHelper.java:249)
    at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.consumeTimed(ServerApiHelper.java:273)
    at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.getPaginated(ServerApiHelper.java:196)
    at org.sonarsource.sonarlint.core.serverapi.component.ComponentApi.getAllFileKeys(ComponentApi.java:45)
    at org.sonarsource.sonarlint.core.serverconnection.ProjectFileListDownloader.get(ProjectFileListDownloader.java:29)
    at org.sonarsource.sonarlint.core.serverconnection.ProjectStorageUpdateExecutor.updateComponents(ProjectStorageUpdateExecutor.java:59)
    at org.sonarsource.sonarlint.core.serverconnection.ProjectStorageUpdateExecutor.lambda$update$0(ProjectStorageUpdateExecutor.java:52)
    at org.sonarsource.sonarlint.core.serverconnection.FileUtils.replaceDir(FileUtils.java:113)
    at org.sonarsource.sonarlint.core.serverconnection.ProjectStorageUpdateExecutor.update(ProjectStorageUpdateExecutor.java:52)
    at org.sonarsource.sonarlint.core.serverconnection.ServerConnection.updateProject(ServerConnection.java:266)
    at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.updateProject(ConnectedSonarLintEngineImpl.java:517)
    at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.syncAtStartup(ProjectBindingManager.java:234)
    at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.computeProjectBinding(ProjectBindingManager.java:219)
    at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.lambda$getBinding$0(ProjectBindingManager.java:185)
    at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(Unknown Source)
    at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.getBinding(ProjectBindingManager.java:178)
    at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.getBinding(ProjectBindingManager.java:146)
    at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.analyze(AnalysisTaskExecutor.java:190)
    at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.lambda$analyze$2(AnalysisTaskExecutor.java:159)
    at java.base/java.util.HashMap.forEach(Unknown Source)
    at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.analyze(AnalysisTaskExecutor.java:159)
    at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.run(AnalysisTaskExecutor.java:131)
    at org.sonarsource.sonarlint.ls.AnalysisScheduler.lambda$analyzeAsync$1(AnalysisScheduler.java:239)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)
 
[Error - 16:20:45.612] Analysis failed
org.sonarsource.sonarlint.core.serverconnection.storage.StorageException: Failed to read file: /home/shoaib/.sonarlint/storage/436f72652053706172726f77/projects/436f72652d53706172726f77/component_list.pb
    at org.sonarsource.sonarlint.core.serverconnection.storage.ProtobufFileUtil.readFile(ProtobufFileUtil.java:37)
    at org.sonarsource.sonarlint.core.serverconnection.ComponentsStorage.read(ComponentsStorage.java:35)
    at org.sonarsource.sonarlint.core.serverconnection.ServerConnection.calculatePathPrefixes(ServerConnection.java:140)
    at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.calculatePathPrefixes(ConnectedSonarLintEngineImpl.java:508)
    at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.computeProjectBinding(ProjectBindingManager.java:222)
    at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.lambda$getBinding$0(ProjectBindingManager.java:185)
    at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(Unknown Source)
    at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.getBinding(ProjectBindingManager.java:178)
    at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.getBinding(ProjectBindingManager.java:146)
    at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.analyze(AnalysisTaskExecutor.java:190)
    at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.lambda$analyze$2(AnalysisTaskExecutor.java:159)
    at java.base/java.util.HashMap.forEach(Unknown Source)
    at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.analyze(AnalysisTaskExecutor.java:159)
    at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.run(AnalysisTaskExecutor.java:131)
    at org.sonarsource.sonarlint.ls.AnalysisScheduler.lambda$analyzeAsync$1(AnalysisScheduler.java:239)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.nio.file.NoSuchFileException: /home/shoaib/.sonarlint/storage/436f72652053706172726f77/projects/436f72652d53706172726f77/component_list.pb
    at java.base/sun.nio.fs.UnixException.translateToIOException(Unknown Source)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
    at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(Unknown Source)
    at java.base/java.nio.file.Files.newByteChannel(Unknown Source)
    at java.base/java.nio.file.Files.newByteChannel(Unknown Source)
    at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(Unknown Source)
    at java.base/java.nio.file.Files.newInputStream(Unknown Source)
    at org.sonarsource.sonarlint.core.serverconnection.storage.ProtobufFileUtil.readFile(ProtobufFileUtil.java:34)
    ... 19 more

Hello @syntax3r ! :wave:

Please consult the Connection setup docs. I believe your problem will be resolved if you use SonarQube User Token instead of the global analysis token.

Let me know if that helps,
Sophio

1 Like

@sophio.japharidze
Thanks for the quick response. Yes, it has been resolved after using the user token instead of global.

Thanks

2 Likes

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