Subject: Re: SCP upload failure

Re: SCP upload failure

From: Jeremy Knope <>
Date: Mon, 24 Aug 2009 11:28:41 -0400

On Aug 24, 2009, at 10:27 AM, Daniel Stenberg wrote:

> On Mon, 24 Aug 2009, Jeremy Knope wrote:
> Can we please not top-post on this list? Discussions/threads get
> truly mangled by this habit!
>> I've tried it against a couple OS X machines, a linux VM and a
>> linux VPS so far. The only one that worked was the VPS but I'll
>> have to try again to make sure. What does seem to work fine is
>> smaller files, those transfer fine without hanging.
>> I'll do some more testing today on more systems and try a few
>> different sized files, but it's pretty much 100% failure with the
>> 25M file on almost every server.
> But you didn't answer if this is 1.2 running on all of those systems.
> Then the next question is if they're freezing on the exact same spot
> every time? If not exact, roughly the same? What point is that?
> Then we can start thinking using libssh2_trace() to track this down.
> Did you build with configure --enable-debug? Then we can add a
> libssh2_trace() with LIBSSH2_TRACE_SCP and possibly
> LIBSSH2_TRACE_CONN and LIBSSH2_TRACE_TRANS set. Those will add a lot
> of output so if we're unlucky the behavior changes...

Sorry for the top post, it is 1.2 I'm running (tested libssh2 code on
2 machines, my OS X work machine and a linux VM on it)
I'm also using it in blocking mode, so the simple scp_write based test
hangs on waiting for the channel to close, but my actual application
forever loops on writing data to the channel as it wouldn't bail on
the return of the write call being < 0.

I do have trace working now, which shows an oddity with waiting for
the channel to close, but still doesn't help that the file seems to be
corrupt, so some data wasn't written maybe. This is some of the
output of the trace & program's output which shows the odd close issue:

[libssh2] 4.709238 Conn: Sending 934 bytes on channel 0/0, stream_id=0
[libssh2] 4.709313 Conn: Writing 0 bytes on channel 0/0, stream #0
EOF of local file (0)
Sending EOF
[libssh2] 4.709484 Conn: Sending EOF on channel 0/0
Waiting for EOF
[libssh2] 4.709780 Conn: Awaiting close of channel 0/0
[libssh2] 4.745205 Conn: Exit status 1 received for channel 0/0
[libssh2] 4.745296 Conn: EOF received for channel 0/0
Waiting for channel to close
[libssh2] 4.745383 Conn: Awaiting close of channel 0/0
[libssh2] 4.745432 Conn: Close received for channel 0/0

Seems like libssh2 says the channel close was received but is still
blocked? Not sure if I'm reading it right, but I'm going to tweak
some more and see if I can get more info about what's going on with
writing of the data.

Jeremy Knope / Software Developer / Ambrosia Software, Inc. --
Received on 2009-08-24