You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "D.J. Heap" <dj...@shadyvale.net> on 2003/07/27 13:26:14 UTC

svn+ssh

People having trouble with svn+ssh look like they could be helped with a 
bit more error checking in libsvn_ra_svn\client.c where it creates the 
tunnel agent process around line 387:

   if (tunnel)
     {
       SVN_ERR(find_tunnel_agent(tunnel, hostname, &args, config, pool));
       apr_procattr_create(&attr, pool);
       apr_procattr_io_set(attr, 1, 1, 0);
       apr_procattr_cmdtype_set(attr, APR_PROGRAM_PATH);
       apr_procattr_child_errfn_set(attr, handle_child_process_error);
       proc = apr_palloc(pool, sizeof(*proc));
       apr_proc_create(proc, *args, args, NULL, attr, pool);
       conn = svn_ra_svn_create_conn(NULL, proc->out, proc->in, pool);
       conn->proc = proc;


Windows, at least, seems to hang somewhere afterwards if the 
apr_proc_create fails.  Some error checking on that call might be 
needed...I don't have time right now, but I can look at it later this 
week if no one else has.

DJ


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn+ssh

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
D.J. Heap wrote:


> Hopefully that will help reduce the problem reports since my suspicion 
> is that the tunnel agent or it's support dll's are not in the PATH in 
> many cases.

That seems likely.  I know for a fact that it is possible to use ra_svn 
over ssh because I do it myself from time to time, so PATH issues seem 
like the most likely cause of the problem.

-garrett


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn+ssh

Posted by mark benedetto king <mb...@lowlatency.com>.
On Sun, Jul 27, 2003 at 09:54:45PM -0600, dj wrote:
> It appears to be waiting on a password prompt in the tunnel.  If I
> supply the '-pw mypassword' option in the config file it works fine for
> me.  I'm not a real ssh/tunnel expert so maybe someone else knows a
> better way to handle this if putting passwords in your config file is
> not desirable.
> 
> DJ
> 

pageant is a nice alternative.

--ben


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn+ssh

Posted by "D.J. Heap" <dj...@shadyvale.net>.
Any other prompts when you run it manually?  Accept certificate or 
something like that?  Anything like that will cause it to hang in the 
tunnel, of course.  If not then I'm out of ideas, sorry...It's working 
fine for me -- svn+ssh using plink.exe on WinXP to a Linux box.

DJ

Steve Williams wrote:
> I just tried adding the '-pw' option with password to the ssh tunnel entry
> in config and it still did nothing.
> 
> Sly
> 
> dj wrote:
> 
>>It appears to be waiting on a password prompt in the tunnel.  If I
>>supply the '-pw mypassword' option in the config file it works fine
>>for me.  I'm not a real ssh/tunnel expert so maybe someone else knows
>>a better way to handle this if putting passwords in your config file
>>is not desirable.
>>
>>DJ
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn+ssh

Posted by Steve Williams <st...@kromestudios.com>.
I just tried adding the '-pw' option with password to the ssh tunnel entry
in config and it still did nothing.

Sly

dj wrote:
> It appears to be waiting on a password prompt in the tunnel.  If I
> supply the '-pw mypassword' option in the config file it works fine
> for me.  I'm not a real ssh/tunnel expert so maybe someone else knows
> a better way to handle this if putting passwords in your config file
> is not desirable.
>
> DJ
>
> On Sun, 2003-07-27 at 21:40, Steve Williams wrote:
>> Testing it here now at work (the original testing was done at home),
>> it still pauses infinitely, but it takes two presses of Ctrl-C to
>> break it out with no 'connection closed' message.  Yes, plink.exe
>> shows up in the process list while it is waiting.
>>
>> Sly
>>
>> D.J. Heap wrote:
>>> Hmm, in my experience that has always been either the exe or some
>>> dll's it wants not in the PATH so the tunnel agent process is never
>>> started. Does putty.exe show up in your process list while it is
>>> stuck?


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn+ssh

Posted by Francis Irving <fr...@flourish.org>.
You could use TortoisePlink.exe instead of Plink.exe.  

It has GUI windows dialogs for all the SSH prompts, such as for a
password or passphrase, or to tell you you are connecting to a server
which you apparently haven't connected to before.  This means you 
can never get stuck in an invisible piped tunnel which is prompting for
something.

TortoisePlink.exe is maintained along with TortoiseCVS (thanks
Torsten!); you can get the binaries or source for it from the
TortoiseCVS project.  These should work with Win32 command line
Subversion.

For binaries, install TortoiseCVS from www.tortoisecvs.org.  You will
find TortoisePlink.exe in the TortoiseCVS folder in Program Files.

The source code is here:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tortoisecvs/TortoiseCVS/src/TortoisePlink/

And you'll probably want to use Pageant (an SSH passphrase holding
agent) along with TortoisePlink so you don't have to keep entering
passwords.  Rough instructions are here:
http://www.tortoisecvs.org/faq.html#sshkeys

Thinking about it, does TortoiseSVN ship with TortoisePlink?

Francis

On Sun, Jul 27, 2003 at 09:54:45PM -0600, dj wrote:
> It appears to be waiting on a password prompt in the tunnel.  If I
> supply the '-pw mypassword' option in the config file it works fine for
> me.  I'm not a real ssh/tunnel expert so maybe someone else knows a
> better way to handle this if putting passwords in your config file is
> not desirable.

-- 
Web: http://www.flourish.org  Email: francis@flourish.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn+ssh

Posted by dj <dj...@shadyvale.net>.
It appears to be waiting on a password prompt in the tunnel.  If I
supply the '-pw mypassword' option in the config file it works fine for
me.  I'm not a real ssh/tunnel expert so maybe someone else knows a
better way to handle this if putting passwords in your config file is
not desirable.

DJ

On Sun, 2003-07-27 at 21:40, Steve Williams wrote:
> Testing it here now at work (the original testing was done at home), it
> still pauses infinitely, but it takes two presses of Ctrl-C to break it out
> with no 'connection closed' message.  Yes, plink.exe shows up in the process
> list while it is waiting.
> 
> Sly
> 
> D.J. Heap wrote:
> > Hmm, in my experience that has always been either the exe or some
> > dll's it wants not in the PATH so the tunnel agent process is never
> > started. Does putty.exe show up in your process list while it is
> > stuck?



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn+ssh

Posted by Steve Williams <st...@kromestudios.com>.
Testing it here now at work (the original testing was done at home), it
still pauses infinitely, but it takes two presses of Ctrl-C to break it out
with no 'connection closed' message.  Yes, plink.exe shows up in the process
list while it is waiting.

Sly

D.J. Heap wrote:
> Hmm, in my experience that has always been either the exe or some
> dll's it wants not in the PATH so the tunnel agent process is never
> started. Does putty.exe show up in your process list while it is
> stuck?
>
>
> Steve Williams wrote:
>> Hangs infinitely with no response at all.  I could leave it for five
>> minutes or fifty minutes and it doesn't make any difference.  I get
>> the 'connection closed' message when I press Ctrl-C.
>>
>> Sly


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn+ssh

Posted by "D.J. Heap" <dj...@shadyvale.net>.
Hmm, in my experience that has always been either the exe or some dll's 
it wants not in the PATH so the tunnel agent process is never started. 
Does putty.exe show up in your process list while it is stuck?


Steve Williams wrote:
> Hangs infinitely with no response at all.  I could leave it for five minutes
> or fifty minutes and it doesn't make any difference.  I get the 'connection
> closed' message when I press Ctrl-C.
> 
> Sly
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn+ssh

Posted by Steve Williams <st...@kromestudios.com>.
Hangs infinitely with no response at all.  I could leave it for five minutes
or fifty minutes and it doesn't make any difference.  I get the 'connection
closed' message when I press Ctrl-C.

Sly

D.J. Heap wrote:
> Is it hanging or getting the connection closed message or something
> else?  Connection closed usually meant the server side tunnel couldn't
> be started after ssh had connected, IIRC.  This is using the command
> line client?
>
> DJ
>
> Steve Williams wrote:
>
>> It is not a PATH problem.  I can go to a command window and run the
>> tunnel agent without any problems.  The tunnel agent (plink.exe) has
>> been copied to the Subversion directory.
>>
>> Sly
>>
>> D.J. Heap wrote:
>>
>>> Hopefully that will help reduce the problem reports since my
>>> suspicion is that the tunnel agent or it's support dll's are not in
>>> the PATH in many cases.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn+ssh

Posted by Steve Williams <st...@kromestudios.com>.
> Is it hanging or getting the connection closed message or something
> else?  Connection closed usually meant the server side tunnel couldn't
> be started after ssh had connected, IIRC.  This is using the command
> line client?

Here is the text from my original message:

I'm using plink.exe from PuTTY release 0.53b.  I am using the official
distributions of Subversion 0.25.0 on Win32 and Linux.

The %APPDATA%\Subversion\config file contains the following lines

[tunnels]
ssh = plink.exe -l svn

'svn' is the account on the Linux box that owns the repository.  plink.exe
is in %PATH% (it's in the same directory as svn.exe).  I try to checkout a
working copy of the test repository with the following command.

D:\temp>svn co svn+ssh://192.168.1.1/usr/local/repos/test

On Linux this command works fine.  On Win32 this command just waits around
infinitely with no response at all.  I have to Ctrl-C to exit, whereupon it
prints out

svn: Network connection closed unexpectedly
svn: Connection closed unexpectedly

If I execute the following command (which is what I believe svn is trying to
do)...

D:\temp>plink.exe -l svn 192.168.1.1 svnserve -t

...then I get the expected response from the svnserve process.

( success ( 1 1 ( ANONYMOUS EXTERNAL ) ( ) ) )

I also tried it with %SVN_SSH% set to "plink.exe -l svn".  Same result
(infinite wait).

There is also an infinite wait if the client cannot find ssh.exe or the
executable specified in the config file or %SVN_SSH%.  No error message
given.  It must be given two Ctrl-C's to exit whereupon it prints nothing.

What would be causing an infinite wait?  Why would svn not report an error
if it cannot find the defined ssh executable?

Sly


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn+ssh

Posted by "D.J. Heap" <dj...@shadyvale.net>.
Is it hanging or getting the connection closed message or something 
else?  Connection closed usually meant the server side tunnel couldn't 
be started after ssh had connected, IIRC.  This is using the command 
line client?

DJ

Steve Williams wrote:

> It is not a PATH problem.  I can go to a command window and run the tunnel
> agent without any problems.  The tunnel agent (plink.exe) has been copied to
> the Subversion directory.
> 
> Sly
> 
> D.J. Heap wrote:
> 
>>Hopefully that will help reduce the problem reports since my suspicion
>>is that the tunnel agent or it's support dll's are not in the PATH in
>>many cases.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn+ssh

Posted by Steve Williams <st...@kromestudios.com>.
It is not a PATH problem.  I can go to a command window and run the tunnel
agent without any problems.  The tunnel agent (plink.exe) has been copied to
the Subversion directory.

Sly

D.J. Heap wrote:
> Hopefully that will help reduce the problem reports since my suspicion
> is that the tunnel agent or it's support dll's are not in the PATH in
> many cases.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn+ssh

Posted by "D.J. Heap" <dj...@shadyvale.net>.
Greg Hudson wrote:

> On Sun, 2003-07-27 at 09:26, D.J. Heap wrote:
> 
>>Windows, at least, seems to hang somewhere afterwards if the 
>>apr_proc_create fails.
> 
> 
> Ah, my bad, I guess.  On Unix, apr_proc_create() can fail, but it almost
> never does (only if there are no system resources for a fork()).  On
> Windows, since the fork/exec steps are done together, there are
> presumably much more interesting and common failure cases, so it's much
> more important to do error-checking.  Of course, there's no good excuse
> not to check for errors even on Unix; I'm just explaining why I never
> noticed the problem before.
> 
> The fix should be easy; I'll let someone else take care of it.


Sure, process creation on Windows is definitely more prone to problems 
it seems to me (App Paths, dll's scattered all over, etc), although I 
haven't done a lot of Unix development.  And it looks like mbk has 
already committed a fix. :)

Hopefully that will help reduce the problem reports since my suspicion 
is that the tunnel agent or it's support dll's are not in the PATH in 
many cases.

DJ



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn+ssh

Posted by mark benedetto king <mb...@lowlatency.com>.
On Sun, Jul 27, 2003 at 04:24:06PM -0400, Greg Hudson wrote:
> On Sun, 2003-07-27 at 09:26, D.J. Heap wrote:
> > Windows, at least, seems to hang somewhere afterwards if the 
> > apr_proc_create fails.
> 
> Ah, my bad, I guess.  On Unix, apr_proc_create() can fail, but it almost
> never does (only if there are no system resources for a fork()).  On
> Windows, since the fork/exec steps are done together, there are
> presumably much more interesting and common failure cases, so it's much
> more important to do error-checking.  Of course, there's no good excuse
> not to check for errors even on Unix; I'm just explaining why I never
> noticed the problem before.
> 
> The fix should be easy; I'll let someone else take care of it.
> 

Fixed in r6588.

--ben


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn+ssh

Posted by Greg Hudson <gh...@MIT.EDU>.
On Sun, 2003-07-27 at 09:26, D.J. Heap wrote:
> Windows, at least, seems to hang somewhere afterwards if the 
> apr_proc_create fails.

Ah, my bad, I guess.  On Unix, apr_proc_create() can fail, but it almost
never does (only if there are no system resources for a fork()).  On
Windows, since the fork/exec steps are done together, there are
presumably much more interesting and common failure cases, so it's much
more important to do error-checking.  Of course, there's no good excuse
not to check for errors even on Unix; I'm just explaining why I never
noticed the problem before.

The fix should be easy; I'll let someone else take care of it.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org