Cannot Access SVN Repository Over SSH Due to Error - svn authentication cancelled

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Symptoms

When using a private key to access the repository (without standard log in) and having set FISHEYE_OPTS to pass the necessary details, e.g.:

1 export FISHEYE_OPTS="-Dsvnkit.ssh2.key=/path/to/private/key/file -Dsvnkit.ssh2.username=userName -Dsvnkit.ssh2.passphrase=optionalPassphrase -Dsvnkit.ssh2.password=userpassword -Dsvnkit.ssh2.port=optionalPort"

Fisheye outputs the following error in the logs:

1 2 3 Caused by: org.tmatesoft.svn.core.SVNCancelException: svn: authentication cancelled at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.cancel(SVNErrorManager.java:30) at org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager.getNextAuthentication(DefaultSVNAuthenticationManager.java:201)

Diagnosis

Confirm the error to connect by making an SVNKit call directly from the command-line by using the JSVNscript located in the FISHEYE_HOME/lib/svn directory. Edit this script (Windows - jsvn.bat, Other - jsvn) and add the FISHEYE_OPTS (see above) values to SVNKIT_VM_OPTIONS. If either a username or private key prompt is returned after running the following command then Fisheye too will fail:

1 jsvn.bat --no-auth-cache info svn+ssh://URL.to.svn.repository

Note, however, that the SVN server is available via an external Subversion client (e.g. TortoiseSVN).

For more information on JSVN check the following page:

Cause

As per the SVNKit documentation:

By default SVNKit tries to obtain all necessary information from the [tunnels] section of the config file that is located in the default SVN run-time configuration area. However if that information is not complete or not found at all, SVNKit tries then to use predefined system properties listed beneath.

1 2 3 4 5 svnkit.ssh2.key = /path/to/private/key/file svnkit.ssh2.username = userName svnkit.ssh2.passphrase = optionalPassphrase svnkit.ssh2.password = userpassword svnkit.ssh2.port = optionalPort

It is therefore likely that there is something defined in the [tunnels] section of the SVN config file. For example, the location of the private key was defined, however, the default username was omitted. As a result, the location of the private key or the username supplied in FISHEYE_OPTS will not be used.

Solution

Resolution

Remove the definition from the [tunnels] section of the config file so that the system properties passed via FISHEYE_OPTS will be used. Confirm the edit was successful and verify Fisheye connectivity by making the SVNKit call directly from the command-line by, once again, using the JSVN script:

1 jsvn.bat --no-auth-cache info svn+ssh://URL.to.svn.repository

For reference, the config file is located in the default SVN run-time configuration area. The default configuration area is located at ~/.subversion in Linux and OS X and at C:\Documents and Settings\<userName>\Application Data\Subversion in Windows.

If the connection still fails, try passing svnkit.ssh2.author instead of svnkit.ssh2.username in FISHEYE_OPTS.

Updated on April 16, 2025

Still need help?

The Atlassian Community is here for you.