SCM file info via svn+ssh raises java.io.IOException: Cannot negotiate, proposals do not match

Description

The SonarScanner raises an exception when trying to get file information via svn+ssh . The exception is thrown when the ssh server on the svn server only allows more secure KexAlgorithms.
The Exception is:
java.io.IOException: Cannot negotiate, proposals do not match.

Several svn tools (e.g. Linux, TortoiseSVN) uses more secure KexAlgorithms and work with our svn server.

Workaround

Enable unsecure diffie-hellman-group-exchange-sha1 KexAlgorithms in ssh server configuration.

Version

  • SonarScanner CLI Windows 4.6.2.2472
  • SonarQube Developer Edition 8.9.6.50800

Log Snippet

  java.lang.IllegalStateException: Error when executing blame for file src/socket/test_socket_simple.cpp
  	at org.sonar.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:85)
  	at org.sonar.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:362)
  	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
  	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
  	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:150)
  	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
  	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
  	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(Unknown Source)
  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
  	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: E210002: There was a problem while connecting to svn.horizont-it.de:22
  	at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:70)
  	at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:57)
  	at org.tmatesoft.svn.core.internal.io.svn.SVNSSHConnector.open(SVNSSHConnector.java:145)
  	at org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.java:79)
  	at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:1282)
  	at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.hasCapability(SVNRepositoryImpl.java:1590)
  	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.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:83)
  	... 22 more
  Caused by: java.io.IOException: There was a problem while connecting to svn.horizont-it.de:22
  	at com.trilead.ssh2.Connection.connect(Connection.java:817)
  	at org.tmatesoft.svn.core.internal.io.svn.ssh.SshHost.openConnection(SshHost.java:225)
  	at org.tmatesoft.svn.core.internal.io.svn.ssh.SshHost.openSession(SshHost.java:153)
  	at org.tmatesoft.svn.core.internal.io.svn.ssh.SshSessionPool.openSession(SshSessionPool.java:85)
  	at org.tmatesoft.svn.core.internal.io.svn.SVNSSHConnector.open(SVNSSHConnector.java:122)
  	... 34 more
  Caused by: java.io.IOException: Key exchange was not finished, connection is closed.
  	at com.trilead.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:92)
  	at com.trilead.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:231)
  	at com.trilead.ssh2.Connection.connect(Connection.java:769)
  	... 38 more
  Caused by: java.io.IOException: Cannot negotiate, proposals do not match.
  	at com.trilead.ssh2.transport.KexManager.handleMessage(KexManager.java:413)
  	at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:765)
  	at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:480)
  	at java.base/java.lang.Thread.run(Unknown Source)