Mercurial Plugin + ssh

191 views
Skip to first unread message

dbarbieri

unread,
Jul 22, 2011, 7:39:02 PM7/22/11
to jenkin...@googlegroups.com
The mercurial plugin is failing when I have it clone via ssh

When I copy and paste the exact same failed clone command into a windows batch script on the job configuration page it works fine, which leads me to believe that the problem is with the mercurial plugin. How does it issue the clone command to the system?

My environment is windows 7 + cygwin's ssh + mercurial 1.9

Has anyone had success using ssh via the mercurial plugin on windows, and if so, what was your environment

Here is the error:

java.io.IOException: Cannot run program "hg": CreateProcess error=2, The system cannot find the file specified
	at java.lang.ProcessBuilder.start(Unknown Source)
	at hudson.Proc$LocalProc.<init>(Proc.java:244)
	at hudson.Proc$LocalProc.<init>(Proc.java:216)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:698)
	at hudson.Launcher$ProcStarter.start(Launcher.java:329)
	at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:923)
	at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:890)
	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
	at hudson.remoting.Request$2.run(Request.java:287)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at hudson.remoting.Engine$1$1.run(Engine.java:60)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.<init>(Unknown Source)
	at java.lang.ProcessImpl.start(Unknown Source)



Confidentiality Notice: This e-mail message, its contents and any attachments to it are confidential to the intended recipient, and may contain information that is privileged and/or exempt from disclosure under applicable law. If you are not the intended recipient, please immediately notify the sender and destroy the original e-mail message and any attachments (and any copies that may have been made) from your system or otherwise. Any unauthorized use, copying, disclosure or distribution of this information is strictly prohibited.
  ­­  

Richard Bywater

unread,
Jul 24, 2011, 8:32:00 PM7/24/11
to jenkin...@googlegroups.com
Does cloning via http work? By the look of it, it would appear that perhaps hg isn't in the PATH for the user that runs Jenkins?

Richard.

dbarbieri

unread,
Jul 26, 2011, 1:23:35 PM7/26/11
to jenkin...@googlegroups.com
Thanks for the feedback.

Yes hg is in the path. Neither http nor ssh works when I use the cygwin hg, which I need in order to clone ssh. Http works fine with windows hg but not I cant use ssh.

But this is what gives me hope for a easy fix. In the job configuration, if instead of using the mercurial plugin to clone, I copy/paste the exact same clone command is generates in the windows batch script area it works fine.

Does the plugin work by detecting the windows platform then and looking only for windows mercurial?

-Devin

dbarbieri

unread,
Jul 28, 2011, 7:09:36 PM7/28/11
to jenkin...@googlegroups.com, Richard Bywater
Yes I can clone using http. I can use ssh for linux/solaris/bsd/hpux/osx but not windows.

When I use tortoisehg + putty I can configure a mercurial.ini file to say 'ssh = C:\Putty\plink.exe -ssh -v -l <user> -pw <password>. I can then use type hg clone ssh://whatever and clone without it asking for a password, exactly how it should be set since jenkins can't query. Cloning via ssh works on everything but windows, on which is just stalls forever with no error.

When then copy/paste the same clone command in a script and run it via jenkins and it works fine.

The need to switch to ssh is due to http being a less reliable protocol. We get a handful of failed builds daily due to using http.


-Devin



On 07/24/2011 06:32 PM, Richard Bywater wrote:
Reply all
Reply to author
Forward
0 new messages