Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

unable to configure bamboo to find ssh (tortoiseplink)

Ozan Yigit February 21, 2012

This is a previously reported issue, with no apparent solution. typical windows mercurial setup, with tortoisehg and putty.
mercurial settings correct, and will work via command line, eg. hg clone ssh://hg@mygate/etc works as expected, and
has worked on all clients we have configured for well over a year.

this particular instance is a bamboo build agent. the exception is:

java.lang.RuntimeException : com.atlassian.bamboo.plugins.hg.HgCommandException: command [C:\Program Files\TortoiseHg\hg.exe, pull, --rev, 4f1078e129ffe12bd25979c49f957972c55b3ed7, --config, ui.ssh=ssh -o StrictHostKeyChecking=no -o BatchMode=yes, ssh://hg@mygate/foo] failed. Working directory was `C:\Documents and Settings\oyigit\bamboo-agent-home\xml-data\build-dir\_hg-repositories-cache\b7b75c29066a14265a4be83a36e96f946f326e2b'. stderr: abort: no suitable response from remote hg! stdout: remote: 'ssh' is not recognized as an internal or external command,remote: operable program or batch file.)

note how the outgoing command re-maps ssh as ssh, instead of using mercurial.ini setup, which specifically sets ssh as tortoiseplink, eg.

ssh= tortoiseplink.exe -ssh -i "C:\blah\blah'privkey.ppk"

so what gives? i cannot see any settings that would have my build server to issue the right command to its windows agent, where ssh is tortoiseplink.

yes, I can install some other ssh command, but i need to understand whether this is a bamboo bug i have to work around, or some configuration i have overlooked.

i have already tried setting up a custom executable ssh with the proper path via agents conrol panel. doesn't work.

5 answers

2 votes
Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 22, 2012

You need to set the Bamboo capability: system.hg.executable.ssh to the SSH executable you wish to use. Otherwise it defaults to "ssh -o StrictHostKeyChecking=no -o BatchMode=yes"

Jean-Dominique GASCUEL
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 22, 2013

To do so, just use the SECOND executabe (SSH) proposed in the add-capability menu for Mercurial...

0 votes
PiotrA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2012

Which "autorization type" have you set up in your plan repository configuration?

I'm thinking that the last one, called "Default Mercurial credentials" could force Bamboo to use ssh configured in mercurial.ini... but I might be wrong - can't check it right now.

Ozan Yigit February 23, 2012

auth type is keyfile without passphrase. keyfile is supposed to come from the "bamboo" user on the agent, it is specified,
registered etc. but with the --config ui.ssh=ssh line, the actual mercurial configuration that specifies the keyfile is bypassed.

0 votes
ReneR
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2012

How are you running the agent? What user account? Is it running as a service? With the system account?

Mercurial expects to find your .ini or .hgrc file using the %USERPROFILE% environment variable. Since the Hg command is being spawned by Bamboo thru the agent (which is a Java process) you shouldn't assume that the behaviour you'll see from that will be the same as when logged in with your own user on the Desktop.

Setup a dummy Job with a script task in it and run something like: "hg -v showconfig"

Or make sure the account you're using to run the agent has a USERPROFILE environment variable set. Or you can pass that as an env var in the Job where you need it.

Ozan Yigit February 23, 2012

thanks for the response. agent was run in two different ways: once as an nt service, and the other as a "bamboo" administrative user, at console. hg -v showconfig indicates tortoisehg configuration is correct, ui.ssh is properly defined as tortoisehgplink, with pointer to the private key. the bottom line comes to --config line, which defines ui.ssh as ssh. i have no idea what possible configuration could change this: it bypasses mercurial.ini configuration.

0 votes
ReneR
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2012

hg help config

Can tell you where Mercurial expects to find initialization files.
0 votes
Jay Barra
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 21, 2012

Do you have any saved sessions in PuTTY?

Ozan Yigit February 22, 2012

good question, but no, everything is fresh, no saved sessions. host keys initialized.
i know of a really ugly fix: cp tortoiseplink.exe ssh.exe
but i'd rather have a clean configuration for this.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events