Mercurial VCS test errors with 'unknown protocol: ssh'

I am trying to get ssh with key auth working with Team City.

I have found some walkthroughs and I believe have covered the common issues: LocalSystem has the key cached, mercurial.ini is setup to use plink.exe and I've even tested 'hg clone' command from a CLI run as LocalSystem.

However, when I try to configure and test the VCS root in Team City it just hangs and the teamcity-vcs.log shows this error:

[2011-05-18 10:12:22,505]   WARN [on=editVcsRoot ] -      jetbrains.buildServer.VCS - Error while parsing url ssh://hg.mydomain.com/repositoryname/
java.net.MalformedURLException: unknown protocol: ssh
        at java.net.URL.<init>(Unknown Source)
        at java.net.URL.<init>(Unknown Source)
        at java.net.URL.<init>(Unknown Source)
        at jetbrains.buildServer.buildTriggers.vcs.mercurial.command.Settings.createURLWithCredentials(Settings.java:136)
        at jetbrains.buildServer.buildTriggers.vcs.mercurial.command.Settings.getRepositoryUrl(Settings.java:113)
        at jetbrains.buildServer.buildTriggers.vcs.mercurial.command.IdentifyCommand.execute(IdentifyCommand.java:36)
        at jetbrains.buildServer.buildTriggers.vcs.mercurial.MercurialVcsSupport$3.testConnection(MercurialVcsSupport.java:233)

I have the following configuration settings:
HG Command path: 'c:\program files\mercurial\hg.exe'
Pull changes from: ssh://hg.mydomain.com/repositoryname/
Username: hg

Any insight appreciated, I can't find a single thing when I search for this error.

thanks,
Paul

6 comments
Comment actions Permalink

Sorry for double post but I resolved it and wanted to separate issue and answer.

I tried tweaking the URL some to see if different errors occurred, when capitalizing ssh to SSH the following error was logged:

[2011-05-18 11:02:36,911]   WARN [on=editVcsRoot ] -      jetbrains.buildServer.VCS - Error occurred in test connection
jetbrains.buildServer.vcs.VcsException: '"C:\Program Files\Mercurial\hg.exe" identify SSH://hg.mydomain.com/myrepository/' command failed.
stderr: abort: repository SSH://hg.mydomain.com/myrepository/ not found!

A close look at that error shows it wasn't passing the username into the hg command! So I went back and blanked out the username field and put the URL back into the state the hg command line expects: ssh://user@host/repository.

After this the test succeeded and I was able to continue.

0
Comment actions Permalink

And I cannot get it worked with latest stable TeamCity.

For "ssh://hg@ip/reponame" it just freezes with no messages to logs :-(

0
Comment actions Permalink

Hi

To communicate with Mercurial we call its command-line tool. Sometimes it asks for interactive input from the console, and TeamCity cannot handle such situations automatically. There is TW-18014 for this bug.
For example it can ask you for passphrase, or display some errors.

Please check that your key does not have a passphrase.
For troubleshooting purposes you can run TeamCity interactively within user session by

runAll.bat start

0
Comment actions Permalink

Thanks for the reply

There is no passphrase and actually I have solved the issue but I just cannot remember what I had done :-(

0
Comment actions Permalink

I have the same problem. I install first TeamCity 6.5.4 and it won't build simple project from Mercurial repo. Then I updated to 6.5.5 but problem stiil appered. In logs i found this lines:

[2011-11-02 16:06:14,093]   WARN [on=editVcsRoot ] -      jetbrains.buildServer.VCS - Error while parsing url ssh://ourserver.com/mercurialrepo/
java.net.MalformedURLException: unknown protocol: ssh
     at java.net.URL.<init>(Unknown Source)
     at java.net.URL.<init>(Unknown Source)


Is it real to checkout from SSH?
0

Please sign in to leave a comment.