Ant scp task is not working with openssh-3.9
As soon as ant wants to transfer a directory the following error occurs:
[scp] SSH_MSG_DISCONNECT: 2 Received ieof for nonexistent channel 0.
BUILD FAILED
...
server indicated an error: scp: protocol error: received directory without -r
If I downgrade my sshd to 3.8 everything works fine.
So this error is probably caused by changes in the implementation of scp protocol since openssh-3.9
I als found a patch which adds the -r option to the ant scp task
Reproducible: Always
Steps to Reproduce:
1.Do an scp task in an ant build file with a <fileset dir=".." /> in it
2.Have openssh-3.9 runnig
3. ant this build.xml
Actual Results:
Error:
[scp] SSH_MSG_DISCONNECT: 2 Received ieof for nonexistent channel 0.
BUILD FAILED
...
server indicated an error: scp: protocol error: received directory without -r
Expected Results:
Copy all files and directories to remote server
This error is probably caused by changes in the implementation of scp protocol
since openssh-3.9
I als found a patch which adds the -r option to the ant scp task on:
http://sourceforge.net/mailarchive/forum.php?thread_id=6173225&forum_id=12628
diff -Naur
apache-ant-1.6.2/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessage.java
apache-ant-1.6.2.new/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessage.java
--apache-ant-1.6.2/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessage.java
Fri
Jul 16 00:57:40 2004
+++
apache-ant-1.6.2.new/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessage.java
Sat
Dec 18 05:51:39 2004
@@ -112,7 +112,7 @@
}
private void doMultipleTransfer() throws IOException, JSchException {
- Channel channel = openExecChannel("scp -d -t " + remotePath);
+ Channel channel = openExecChannel("scp -r -d -t " + remotePath);
try {
OutputStream out = channel.getOutputStream();
InputStream in = channel.getInputStream();
Cheers,
Olivier