Error during SonarScanner execution

Hello everyone,

I’m using Sonar Qube 8.2 on Windows 10 and I tried to analyze C# code, but when I get to the last step where sonar scanner writes report into sonar qube project I following error:

command: SonarScanner.MSBuild.exe end /d:sonar.login="780607cbf51faa618fdf878fab5fc3048c08c36d"
problem: ERROR: Error during SonarScanner execution
INFO: Final Memory: 14M/50M
java.lang.IllegalStateException: Error when executing blame for file PaMetWinInterface/gui/COSEMControls/COSEMOBISHelper.cs
INFO: ------------------------------------------------------------------------
        at org.sonar.plugins.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:85)
        at org.sonar.plugins.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:58)
        at org.sonar.scanner.scm.ScmPublisher.publish(ScmPublisher.java:84)
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:356)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
        at com.sun.proxy.$Proxy0.execute(Unknown Source)
        at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
        at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: org.tmatesoft.svn.core.SVNException: svn: E175002: connection refused by the server
svn: E175002: OPTIONS request failed on '/svn/PaMet/trunk/Source/PaMetWinInterface/gui/COSEMControls/COSEMOBISHelper.cs'
        at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:112)
        at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:96)
        at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:765)
        at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:352)
        at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:340)
        at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:910)
        at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:702)
        at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:113)
        at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:1035)
        at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.hasCapability(DAVRepository.java:856)
        at org.tmatesoft.svn.core.io.SVNRepository.assertServerIsMergeInfoCapable(SVNRepository.java:790)
        at org.tmatesoft.svn.core.io.SVNRepository.getFileRevisions(SVNRepository.java:759)
        at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteAnnotate.run(SvnRemoteAnnotate.java:109)
        at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteAnnotate.run(SvnRemoteAnnotate.java:30)
        at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21)
        at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1239)
        at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
        at org.tmatesoft.svn.core.wc.SVNLogClient.doAnnotate(SVNLogClient.java:295)
        at org.sonar.plugins.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:83)
        ... 22 more
Caused by: java.net.ConnectException: Connection refused: connect
        at java.base/java.net.PlainSocketImpl.waitForConnect(Native Method)
        at java.base/java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:107)
        at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
        at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
        at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
        at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
        at java.base/java.net.Socket.connect(Socket.java:608)
        at org.tmatesoft.svn.core.internal.util.SVNSocketFactory.connect(SVNSocketFactory.java:164)
        at org.tmatesoft.svn.core.internal.util.SVNSocketFactory.createPlainSocket(SVNSocketFactory.java:75)
        at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.connect(HTTPConnection.java:238)
        at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:415)
        ... 38 more
ERROR:
The SonarQube Scanner did not complete successfully
04:55:03.966  Post-processing failed. Exit code: 1

How can I resolve this issue?
Cheers,
Tijana

Hello @Tijana

As per the stack track the scan fails because the scanner is unable to “blame” the source file to know about which lines were changed when (connectivity to your SVN does not seem to work).

As a short term workaround you can disable SCM integration by setting analysis property /d:sonar.scm.disabled=true in the SonarScanner.MSBuild.exe begin* step, but you will lose some interesting features related t SCM integration in SonarQube (date and author of commits missing in the SonarQube code viewer, and all feature that rely on this)

But mid term, you should not use the above workaround and find out why SonarQube cannot access your SVN (I am guessing you may not have configured a SVN user and password to interact with SVN, see menu Administration --> General Settings --> SCM --> SVN section)

Olivier

1 Like

Hello Olivier,

You are completely right. The issue was in fact that I was not connected to VPN in order to connect with SVN.
Thank you for helping.
Issue is resolved.

Best Regards,
Tijana

1 Like

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