Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Guest

Re: GUI flawless but script gets error code 4 and ssh2_msg_channel_data for nonexistent channel 0 error

Thanks for the offer to assist, but figured out the issue... had a letter "i" incorrect case in the destination path of the script, hence why the GUI worked fine since the path isn't open to user error.
martin

Re: GUI flawless but script gets error code 4 and ssh2_msg_channel_data for nonexistent channel 0 error

Please post session log files both from GUI and the script.
john321

GUI flawless but script gets error code 4 and ssh2_msg_channel_data for nonexistent channel 0 error

Greetings,
I've been reading the forum and help files but am finding myself stuck. I am transferring two txt files via SFTP and when using the GUI, I am able to do so without issue. However, the script I am using is giving me an Error code: 4 for one file (file1 below), and 'Receiving ssh2_msg_channel_data for nonexistent channel 0' error for the other (file 2 below). I've used the command generator in the GUI, am using a bat file and separate winscp script file, have saved the ini file with config settings and tried calling that or not, have tried a couple different switches on the PUT command, and have enabled and read log files.

Here are sample files.
BAT
"C:\Program Files (x86)\WinSCP\WinSCP.com" /log="D:\Program Files\mypath\test.log" /ini="D:\Program Files\mypath\winscp.ini" /script="D:\Program Files\mypath\winscp-script2.txt"


Script
open sftp://username:complexpassword@sftpserver.com/ -hostkey="ssh-rsa 1024 123456etc" -rawsettings FSProtocol=2
 
put "D:\Program Files\mypath\file1.txt" "/incoming/stg/" -nopreservetime -resume
put "D:\Program Files\mypath\file2.txt" "/incoming/stg/"
 
exit