SCM sensor does not work with E170001 when using svn over ssh

Since the sonar switched to using SVNKit, I can’t get the guilty analysis for working working copies using svn+ssh . He does not work:

 [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar (default-cli) on project example: Error when executing blame for file src/main/java/com/acme/Foo.java: svn: E170001: Authentication required for ' svn@svn +ssh://svn.acme.com' 

The svn works correctly when called from the command line, as well as when connected to ssh svn@svn.acme.com . I use SVNKit in Eclipse with this repository, and it also works fine (although I had to tell where to look for the private key).

When I try to debug sonar execution, I see that the private key is simply not installed:

 myPreviousAuthentication SVNSSHAuthentication (id=392) myAgentProxy null myIsPartial false myIsStorageAllowed false myKind "svn.ssh" (id=387) myPassphrase null myPassword (id=608) myPortNumber -1 myPrivateKeyFile null myPrivateKeyValue null myURL SVNURL (id=345) myUserName "jbochenski" (id=610) myPreviousErrorMessage SVNErrorMessage (id=388) dontShowErrorCode false myChildErrorMessage null myErrorCode SVNErrorCode (id=614) myMessage "Credentials rejected by SSH server." (id=613) myObjects Object[0] (id=616) myThrowable null myType 0 

The URL, username and password are correct, but as you can see, myPrivateKeyFile is null .

I tried to set the private key path using MAVEN_OPTS='-Dsvnkit.ssh2.key=/home/acme/.ssh/id_rsa' according to the SVNKit documentation , but it has no effect.

If you run this on another working copy extracted from https , the analysis works fine, which once again confirms its problem with ssh authentication.

+5
source share
1 answer

This is really a missing feature. I created the following ticket: https://jira.sonarsource.com/browse/SONARSCSVN-9

Could you test this updated version of the plugin: https://github.com/SonarSource/sonar-scm-svn/releases/download/1.3-rc1/sonar-scm-svn-plugin-1.3-SNAPSHOT.jar

You should be able to pass additional parameters (or set them in the user interface):

 -Dsonar.svn.privateKeyPath=<path to private key> -Dsonar.svn.passphrase.secure=<optional passphrase> 

Report any problems / issues directly in the migration request so as not to pollute SO: https://github.com/SonarSource/sonar-scm-svn/pull/4

+3
source

Source: https://habr.com/ru/post/1243145/


All Articles