Connected to SonarCloud or SonarQube (and which version): SonarQube 9.9
And a thorough description of the problem / question:
I have installed Sonarlint plugin on IBM Developer for z/OS (aka IDz), version 16.0.3. At startup of IDz, I started getting an error –
An internal error occurred during: “Update SonarLint binding data for project ‘my-project-name’ on ‘my-sonarqube-server-url’”.
org/eclipse/egit/core/info/GitInfo
Additional details in the log shows this –
Starting SonarLint for Eclipse 9.0.0.81302
Starting SonarLint engine for connection ‘my-sonarqube-server-url’…
Started embedded server on port 64120
Stream failed
java.io.InterruptedIOException
at org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec$1.cancel(HttpAsyncMainClientExec.java:137)
at org.apache.hc.client5.http.impl.async.InternalHttpAsyncExecRuntime.lambda$execute$0(InternalHttpAsyncExecRuntime.java:277)
at org.apache.hc.core5.concurrent.ComplexFuture.cancel(ComplexFuture.java:89)
at org.sonarsource.sonarlint.core.http.ApacheHttpClientAdapter$HttpAsyncRequest.cancel(ApacheHttpClientAdapter.java:256)
at org.sonarsource.sonarlint.core.serverapi.stream.EventStream.close(EventStream.java:143)
at org.sonarsource.sonarlint.core.server.event.SonarQubeEventStream.cancelSubscription(SonarQubeEventStream.java:88)
at org.sonarsource.sonarlint.core.server.event.SonarQubeEventStream.unsubscribe(SonarQubeEventStream.java:67)
at org.sonarsource.sonarlint.core.server.event.ServerEventsService.unsubscribe(ServerEventsService.java:196)
at org.sonarsource.sonarlint.core.server.event.ServerEventsService.handle(ServerEventsService.java:107)
at jdk.internal.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:85)
at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:142)
at com.google.common.eventbus.Subscriber.lambda$dispatchEvent$0(Subscriber.java:71)
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.lang.Thread.run(Thread.java:839)
When I attempt to scan code, I see errors in the log as →
Error while fetching server taint issues
java.lang.NoClassDefFoundError: org/eclipse/egit/core/info/GitInfo
at org.sonarlint.eclipse.core.internal.vcs.EGit5dot12VcsFacade.getRepo(EGit5dot12VcsFacade.java:46)
at org.sonarlint.eclipse.core.internal.vcs.AbstractEGitVcsFacade.getCurrentCommitRef(AbstractEGitVcsFacade.java:54)
at org.sonarlint.eclipse.core.internal.vcs.EGit5dot12VcsFacade.getCurrentCommitRef(EGit5dot12VcsFacade.java:1)
at org.sonarlint.eclipse.core.internal.vcs.AbstractEGitVcsFacade.getCurrentCommitRef(AbstractEGitVcsFacade.java:1)
at org.sonarlint.eclipse.core.internal.vcs.VcsService.saveCurrentCommitRef(VcsService.java:91)
at org.sonarlint.eclipse.core.internal.vcs.VcsService.lambda$0(VcsService.java:112)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1710)
at org.sonarlint.eclipse.core.internal.vcs.VcsService.getServerBranch(VcsService.java:110)
at org.sonarlint.eclipse.core.internal.jobs.TaintIssuesUpdateOnFileOpenedJob.run(TaintIssuesUpdateOnFileOpenedJob.java:74)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
This was working OK with older version IDz (version 16.0.1) and Sonarlint 7.9 or 8.0. Any suggestions on what could be wrong and how to resolve this?
thank you for raising this issue with us.
SonarLint relies on the EGit plug-in internally to handle everything connected to version control.
Sadly we have no access to IBM Developer for z/OS but are you aware of the changes they did as you said it worked in an old version? We did not change anything on SonarLint side recently so I assume they removed or exchanged the plug-in from their product? Can you please check that the plug-in is installed in IDz?
My go-to guess would be in the case it is not part of IDz anymore to install it once again, e.g. via the Eclipse Marketplace or via their Eclipse Update Site. Please get back to me if something is not working as expected after you added EGit once again
IDz 16.0.3 has egit 6.5.0.2023030708.
The stack error that is arising from a similar customer is
!ENTRY org.eclipse.core.jobs 4 2 2023-11-14 09:03:12.197
!MESSAGE An internal error occurred during: “Synchronize local storage with SonarQube/SonarCloud”.
!STACK 0
java.lang.NoClassDefFoundError: org.eclipse.egit.core.info.GitInfo
at org.sonarlint.eclipse.core.internal.vcs.EGit5dot12VcsFacade.getRepo(EGit5dot12VcsFacade.java:46)
Caused by: java.lang.ClassNotFoundException: org.eclipse.egit.core.info.GitInfo cannot be found by org.sonarlint.eclipse.core_7.8.0.63129
** at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:529)**
Nothing indicates a problem in IDz other than 16.0.2 works and 16.0.3 doesn’t.
Sorry for stepping into the post but maybe I can help… for the original person opening this entry that is using Sonarlint 9.0, it requires Java 17 per the release notes here: What's New with Eclipse in SonarLint | Sonar
IDz 16.0.3 only supports Java 11 currently.
Hello Lydia,
No worries. Thanks, in fact, for your inputs and the insight - I appreciate it. I realized the Java 17 requirement for Sonarlint 9.0, but similar error was there when I uninstalled version 9.0, re-installed Sonarlint 8.1.0 in IDz 16.0.3. There’s something about version 16.0.3 that throws that error - regardless of Sonarlint version (and I have tried 7.8, 7.9, 8.0, 8.1 - all with same error).
indeed SonarLint 9.0 has the requirements of Java 17 but it is only because of the language analyzers bumping up their version in this release of SonarLint.
The error both of you have seems to be based on a change in IDz from 16.0.2 to 16.0.3. I took a look at the (sparse) release notes of 16.0.1 / 16.0.2 / 16.0.3 but couldn’t find anything linked to changes in their plug-in.
That is the reason behind my asking if you could check if EGit is still part of the newest IDz release as I cannot verify it myself - I have no access to IDz due to it being a paid product. If any of you could check both the old version it worked with and the new version it doesn’t work with that would be great:
is EGit still part of 16.0.3
what version of EGit in 16.0.1 / 16.0.2 and 16.0.3
This way I know if the error might be coming from SonarLint and I can help or if it is coming from IDz where my hands are tied.
Hey, Tobias -
That is good to know about the Java levels.
IDz 16.0.2 uses egit 5.13.0.202109080827-r
IDz 16.0.3 uses egit 6.5.0.202303070854-r
There is definitely an upgrade in egit versions.
I did notice that there was a fix by SonarLint for VSCode in 2.1.2 when it couldn’t find the git parts, but I don’t see a similar fix for Eclipse:
Not sure if I am going on a tangent, but I did look at the jar and the classes in
org.sonarlint.eclipse.core_7.8.0.63129.jar\org\sonarlint\eclipse\core\internal\vcs
and I see that class and some older ones based on the name of the class:
EGit5dot12VcsFacade – this is the one causing the problem
OldEGitVcsFacade
NoOpVcsFacade
Should it be trying to use the old version instead of the new? or is there a trigger somewhere else in the code - like that which was fixed for VSCode?
thanks for coming back with the information.
In the meantime, we got additional information from other sources that it was working correctly with IDz 16.0.2 - therefore we assume that the update broke something (maybe on our side too).
We are going to investigate it but it will take some time to do so. Please be patient with us as we will get back to you after our investigation
thanks for your patience - I might have to ask for some more from both of you.
We started to investigate the issue but could not resolve it as of yet. We also have to make sure that it is not based on changes in EGit or IDz behavior and that’s why it is taking a bit longer
I’ll keep you posted when I know more. If you have anything in the meantime, please let me know, and from my side: If it is possible for you to downgrade to IDz 16.0.2 I would recommend it while you’re awaiting my response!
Hello Tobias, Just wondering if you’ve made any progress with your investigation into this issue. I work with Lydia and we’ve seen a few more cases of this issue arise.
thank you for your interest in that topic. We did an investigation and handed it over to IBM (as IDz is their product) as we could only reproduce the issue with their specific setup but not with Eclipse having the same EGit version installed just without the IBM plug-ins.
We’re hoping they let us know once their investigation is finished, until then the topic is currently on hold on our side. The only advice we have (as we’re not that familiar with IDz) is - as mentioned above - for the time being to downgrade to IDz 16.0.2.
plain Eclipse 4.23- same level as IDz is using,
same egit as IDz - egit 6.5
and SonarLint 7.8
With egit, I get an error about gitInfo when trying to run Analyze.
When not using egit, I get an error at the same place when trying to run Analyze.
Because there is no git, the error is different.
Error without egit:
Error during execution of SonarLint analysis
org.sonarsource.sonarlint.core.serverconnection.storage.StorageException: Failed to read file: C:\Users\Administrator\idz_workspace_nogit.sonarlint\storage\736f6e61722d71756265312e667972652e69626d2e636f6d\projects\4c696e74\analyzer_config.pb
at org.sonarsource.sonarlint.core.serverconnection.storage.ProtobufUtil.readFile(ProtobufUtil.java:42)
at org.sonarsource.sonarlint.core.serverconnection.storage.ProjectStorage.readConfiguration(ProjectStorage.java:104)
at org.sonarsource.sonarlint.core.serverconnection.storage.ProjectStorage.lambda$getAnalyzerConfiguration$1(ProjectStorage.java:60)
at org.sonarsource.sonarlint.core.serverconnection.storage.RWLock.read(RWLock.java:32)
at org.sonarsource.sonarlint.core.serverconnection.storage.ProjectStorage.getAnalyzerConfiguration(ProjectStorage.java:60)
at org.sonarsource.sonarlint.core.serverconnection.ServerConnection.getAnalyzerConfiguration(ServerConnection.java:124)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.analyze(ConnectedSonarLintEngineImpl.java:202)
at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.lambda$0(ConnectedEngineFacade.java:248)
at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.withEngine(ConnectedEngineFacade.java:151)
at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.runAnalysis(ConnectedEngineFacade.java:247)
at org.sonarlint.eclipse.core.internal.jobs.AnalyzeConnectedProjectJob.runAnalysis(AnalyzeConnectedProjectJob.java:71)
at org.sonarlint.eclipse.core.internal.jobs.AnalyzeConnectedProjectJob.runAnalysis(AnalyzeConnectedProjectJob.java:1)
at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.run(AbstractAnalyzeProjectJob.java:393)
at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.runAnalysisAndUpdateMarkers(AbstractAnalyzeProjectJob.java:201)
at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.doRun(AbstractAnalyzeProjectJob.java:157)
at org.sonarlint.eclipse.core.internal.jobs.AbstractSonarProjectJob.run(AbstractSonarProjectJob.java:45)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.nio.file.NoSuchFileException: C:\Users\Administrator\idz_workspace_nogit.sonarlint\storage\736f6e61722d71756265312e667972652e69626d2e636f6d\projects\4c696e74\analyzer_config.pb
at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:235)
at java.base/java.nio.file.Files.newByteChannel(Files.java:371)
at java.base/java.nio.file.Files.newByteChannel(Files.java:422)
at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:420)
at java.base/java.nio.file.Files.newInputStream(Files.java:156)
at org.sonarsource.sonarlint.core.serverconnection.storage.ProtobufUtil.readFile(ProtobufUtil.java:39)
… 16 more
Who creates the projects folder?
I tried deleting the .sonarlint folder, restarting the workspace, and then doing Update All Bindings, but it still fails.
Our testing with SonarQube is using Username and password, not tokens. If that makes any difference.
just to let you know that the issue was resolved with IBM. You should now be able to update to IDz 16.0.3 and update SonarLint to the latest version 9.2.0.81471 as it contains the fixes on our side.
If you encounter any new issues, please let us know.
IDz 16.0.3 has Java 11, whereas SonarLint 9.2.* requires Java 17+. I’m wondering if the Java version mismatch will cause any issues. Has this been verified?