This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

scp exits often with -1


Hi folks,

after upgrading to latest cygwin1.dll and openssh I have massive problems with ssh/scp. Using e.g. the same scp command it fails from time to time called from the command line. Unfortunately it fails more often when called from a shell script and quite every time when this shell script is called from a DOS batch called by a Java app.

See the output of scp -v -v in the good version:

 ========= %< ========
 $ scp -v -v project.xml jos@es3.elsag.de:/devel/maven/home/public_html/repo/essencio-perActa/poms/idxmgr-1.0.4-SNAPSHOT.pom
 Executing: program /usr/bin/ssh host es3.elsag.de, user jos, command scp -v -t /devel/maven/home/public_html/repo/essencio-perActa/poms/idxmgr-1.0.4-SNAPSHOT.pom
 OpenSSH_3.9p1, OpenSSL 0.9.7d 17 Mar 2004
 debug2: ssh_connect: needpriv 0
 debug1: Connecting to es3.elsag.de [192.168.2.73] port 22.
 debug1: Connection established.
 [snip]
 debug1: Authentication succeeded (publickey).
 debug2: fd 4 setting O_NONBLOCK
 debug2: fd 5 setting O_NONBLOCK
 debug1: channel 0: new [client-session]
 debug2: channel 0: send open
 debug1: Entering interactive session.
 debug2: callback start
 debug2: client_session2_setup: id 0
 debug1: Sending command: scp -v -t /devel/maven/home/public_html/repo/essencio-perActa/poms/idxmgr-1.0.4-SNAPSHOT.pom
 debug2: channel 0: request exec confirm 0
 debug2: callback done
 debug2: channel 0: open confirm rwindow 0 rmax 16384
 debug2: channel 0: rcvd adjust 32768
 Sending file modes: C0755 5432 project.xml
 project.xml                                                                           100% 5432     5.3KB/s   00:00    
 debug2: channel 0: read<=0 rfd 4 len 0
 debug2: channel 0: read failed
 debug2: channel 0: close_read
 debug2: channel 0: input open -> drain
 debug2: channel 0: ibuf empty
 debug2: channel 0: send eof
 debug2: channel 0: input drain -> closed
 debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
 debug2: channel 0: rcvd eof
 debug2: channel 0: output open -> drain
 debug2: channel 0: obuf empty
 debug2: channel 0: close_write
 debug2: channel 0: output drain -> closed
 debug2: channel 0: rcvd close
 debug2: channel 0: almost dead
 debug2: channel 0: gc: notify user
 debug2: channel 0: gc: user detached
 debug2: channel 0: send close
 debug2: channel 0: is dead
 debug2: channel 0: garbage collecting
 debug1: channel 0: free: client-session, nchannels 1
 debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.2 seconds
 debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
 debug1: Exit status 0
 ========= %< ========

Here's the output of the bad version:

 ========= %< ========
 $ scp -v -v project.xml jos@es3.elsag.de:/devel/maven/home/public_html/repo/essencio-perActa/poms/idxmgr-1.0.4-SNAPSHOT.pom
 Executing: program /usr/bin/ssh host es3.elsag.de, user jos, command scp -v -t /devel/maven/home/public_html/repo/essencio-perActa/poms/idxmgr-1.0.4-SNAPSHOT.pom
 OpenSSH_3.9p1, OpenSSL 0.9.7d 17 Mar 2004
 debug2: ssh_connect: needpriv 0
 debug1: Connecting to es3.elsag.de [192.168.2.73] port 22.
 debug1: Connection established.
 [snip]
 debug1: Authentication succeeded (publickey).
 debug2: fd 4 setting O_NONBLOCK
 debug2: fd 5 setting O_NONBLOCK
 debug1: channel 0: new [client-session]
 debug2: channel 0: send open
 debug1: Entering interactive session.
 debug2: callback start
 debug2: client_session2_setup: id 0
 debug1: Sending command: scp -v -t /devel/maven/home/public_html/repo/essencio-perActa/poms/idxmgr-1.0.4-SNAPSHOT.pom
 debug2: channel 0: request exec confirm 0
 debug2: callback done
 debug2: channel 0: open confirm rwindow 0 rmax 16384
 debug2: channel 0: rcvd adjust 32768
 Sending file modes: C0755 5432 project.xml
 project.xml                                                                           100% 5432     5.3KB/s   00:00    
 debug2: channel 0: read<=0 rfd 4 len 0
 debug2: channel 0: read failed
 debug2: channel 0: close_read
 debug2: channel 0: input open -> drain
 debug2: channel 0: ibuf empty
 debug2: channel 0: send eof
 debug2: channel 0: input drain -> closed
 debug2: channel 0: rcvd eof
 debug2: channel 0: output open -> drain
 debug2: channel 0: obuf empty
 debug2: channel 0: close_write
 debug2: channel 0: output drain -> closed
 debug2: channel 0: rcvd close
 debug2: channel 0: almost dead
 debug2: channel 0: gc: notify user
 debug2: channel 0: gc: user detached
 debug2: channel 0: send close
 debug2: channel 0: is dead
 debug2: channel 0: garbage collecting
 debug1: channel 0: free: client-session, nchannels 1
 debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.2 seconds
 debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
 debug1: Exit status -1
 ========= %< ========

The singel difference is, that in the successful case the client sends an exit-state, that is not received in the unseccussful version. The problem manifests more often with using a shell script and a DOS batch:

 ========= scpwin ========
 #!/bin/sh

 for a in "$@";
 do
    case $a in
    -*) ARGS="$ARGS $a";;
    *) if test -n "$a"; then ARGS="$ARGS \"`cygpath -u \"$a\"`\""; fi;;
    esac
 done

 #echo $ARGS | xargs echo
 echo $ARGS | xargs scp
 ========= scpwin ========

and 

 ========= scpwin.bat ========
 @sh -c "scpwin '%1' '%2' '%3' '%4' '%5' '%6' '%7' '%8'"
 ========= scpwin.bat ========

Called from a bash shell (repeast fast 4 or 5 times):
cmd /c "scpwin.bat -v -v project.xml jos@es3.elsag.de:/devel/maven/home/public_html/repo/essencio-perActa/poms/idxmgr-1.0.4-SNAPSHOT.pom"

Worst case is calling the scpwin.bat from within Java (app also started from the bash shell) using Runtime.exec(Object[]). Then it fails nearly every time.

Any other information I can provide ?

- Jörg

Attachment: cygcheck.out
Description: cygcheck.out

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]