How to Import SVN Project in Bitbucket using svn+ssh

Hi Team,

can you tell me how to Import SVN Project in Bitbucket using svn+ssh?

am using URL: svn+ssh://svn.test.com/svn/repos/ and add the ssh private key, but which is failing

Thanks,
Manju NS

Hello,

could you please advise what exact tool do you use for the migration – SubGit command-line tool or SVN Mirror add-on for Bitbucket server?

we are using svn mirror

Hello,

to use ssh with the add-on set the svn+ssh url in the URL field, then select SSH Private Key in the Authenticate With drops-down list, fulfils the User field and either upload a private ssh key pressing the SSH Private Key button or configure SSH agent on the Bitbucket server and chose the Use SSH Agent checkbox:


With this configuration the add-on will be able to connect to SVN using ssh.

Hello!

I’m afraid this log snipper sheds too little light on the connection issue causes. The configuration looks correct judging from the screenshot, so I assume the reason is that either it is not possible to reach out to the SVN server’s port 22 from Bitbucket or the credentials are not correct. A possible way to verify is, for example, to try to connect to the SVN server over ssh from Bitbucket’s server console using the same credentials – the result will indicate if the connection is possible and credentials are correct – and also it would make sense checking all the SVN Mirror and Bitbucket logs, they should contain an exception and stack trace that would indicate the reason of the connection problem.

HI,

any updates on this, please help US ASAP

when trying with http-based access failed with this error for new mirrors “timed out waiting for server” but http-based access running fine with old mirrors a, so we are blocked for new setup, please advise ASAP

Hello,

we have discussed the issue with our dev team and concluded that this is an issue that requires fixing an underlying library that will be done in the next add-on release. We plane to make it soon, in a matter of week or two, I’ll inform you as I get any news on that.
Meanwhile, as a workaround it’s possible to set the add-on to use another SSH implementation that should resolve the issue. The workaround would require adding custom JVM parameter in Bitbucket; to get it done login to the Bitbucket server, then edit the following startup script:

 <Bitbucket Server installation directory>/bin/_start-webapp.sh
 <Bitbucket Server installation directory>/bin/_start-webapp.bat

The former is for Linux and the second is for Windows, edit the one for the OS where your Bitbucket is installed. Add the JVM option

-Dsvnkit.ssh.client=apache

into the JVM_JAVA_ARGS line in the file so that it looks like this:

JVM_JAVA_ARGS="-Djava.io.tmpdir=$BITBUCKET_HOME/tmp -Djava.library.path=$JVM_LIBRARY_PATH -Dsvnkit.ssh.client=apache"

Note that this line is from our test server, on your server it may look differently, but the main point here is that this options should be added to the options line.
Restart the Bitbucket server after adding the option, ssh connection should be working well.

HI Ildar,

Thanks a lot for your prompt response , will try mentioned workaround and get back to your

For long time use , better to fix this issue ASAP

Thanks,

Manju NS

any updates on this?

Thanks,
Manju NS

Hi Team,

can we get an update on this? we are blocking due to this

Thanks,
Manju NS

Hi Manju!

Sorry for the delay with the response.
We continue working on the new version, but it’s still not yet ready for release, I will let you know as any news come. Meanwhile, we have noticed in the stack trace you sent that for some reason the add-on did not switch to use the apache library for SSH connection so that it still used the trlead library for SSH:

at com.trilead.ssh2.transport.KexManager.getOrWaitForConnectionInfo(SourceFile:92)
at com.trilead.ssh2.transport.TransportManager.getConnectionInfo(SourceFile:231)
at com.trilead.ssh2.Connection.connect(SourceFile:769)

which is pretty strange taking into account the fact the JVM setting has been set. May I ask you what add-on version is in use on the server? If that is not the latest one, could you please try to upgrade it to the latest add-on version available for your server? Has the Bitbucket server been restarted after the setting change; and if that is a Bitbucket cluster – have all the Bitbucket nodes been restarted?

Hi Ildar,

We are using below version of svn mirror , and I did not see any updates after this version in bitbucket

Thanks,

Manju NS

Hi Manju,

for Bitbucket 6 and 7 that’s indeed the latest version. May I ask you what is the exact Bitbucket version is in use? Also, is that a multi-node cluster and if yes, have all the nodes been restarted after the JVM setting was set?

Hi Manju,

thank you for the information, I’ll discuss with our dev team and reach out to you.

Hi Manju,

we have fixed the issue in our new version of the add-on; the new version has not yet been released, but it will be shortly. However, the build is ready and to speed up the resolution you can download it and install manually to not to wait it published on Atlassian Marketplace:

Please let us know the outcome after the installation.

Hi ildar,

Can you please tell me how to download it and after install the new plugin do we need to remove below config settings ?

-Dsvnkit.ssh.client=apache

Thanks,

Manju NS

Hi Manju,

to download the package just follow the link I’ve sent and choose “Login as guest” on the login screen. The package can be installed on the Bitbucket’s Aministration page as Add-ons - Manage apps - Upload app:


This new version uses apache library by default, so the JVM config is not actually needed anymore and can be removed. On the other hand, it now changes nothing and does not affect the add-on in no way, so it’s not urgent and can be postponed until the next maintenance.

Hi,

i did log in as a guest and am asking which and where I need to download it? please provide a direct download link

Thanks,
Manju NS

My apologies, look like the forum changed the link automatically. Here’s the direct link

https://teamcity.tmatesoft.com/repository/download/translator_stash_build/27400:id/dev/translator-stash-4.0.7.jar

Hi ,

Thanks for the link ,

we have two nodes, so I need to upload for both the nodes?

Thanks,
Manju NS