Discuss (FTP), (FTP on .NET CF) and (FTPS, SFTP and SCP).
no avatar
User

balugo05

Posts

2

Joined

Sat Jun 22, 2013 1:41 am

Location

Florida, USA

SFTP Uploadfile to AS400 in ASCII throws errorCode=4

by balugo05 » Sat Jun 22, 2013 3:35 am

I have an SFTP process using edtFTPnet/PRO-7.1.0.20 (vb .net 3.5) that transfers binary files from a windows server 2008 client to an AS400 server using SFTP in BINARY without any problems. However, when I try to transport ASCII files using the ASCII FTPTransferType, I receive an Error code 4. There is no explanation for this error and I have only found one instance in the forum that contains this error.

Is there a list of error codes and explanations for the SFTP protocol? Any assistance with this problem is greatly appreciated!

'open connection with store
ftp.ServerAddress = AS400
ftp.UserName = useID
ftp.Password = usePW
ftp.ServerPort = 22
ftp.Protocol = FileTransferProtocol.SFTP
' turn off server validation
ftp.ServerValidation = SecureFTPServerValidationType.None
ftp.ServerCompatibility = SecureFTPCompatibilityFlags.SSHDisableChmodAfterPut
ftp.ParallelTransferMode = False

Here is a portion of the resulting error log:

ALL [SFTPMessage] 21 Jun 2013 11:54:33.665 : Send : Name=SSH_FXP_STAT,Type=17,RequestID=7
path=/QSYS.lib/TPLIB.lib/CSPPOSTIME.file/STR50271.MBR
DEBUG [SSH2Channel] 21 Jun 2013 11:54:33.665 : Transmit 61 bytes
DEBUG [ChannelDataWindow] 21 Jun 2013 11:54:33.665 : Remote window size decreased to 2096846
DEBUG [PlainSocket] 21 Jun 2013 11:54:33.665 : RepeatCallback received 84 bytes
DEBUG [SSH2Connection] 21 Jun 2013 11:54:33.665 : ProcessPacket pt=SSH_MSG_CHANNEL_DATA
ALL [AbstractSFTPChannelReceiver] 21 Jun 2013 11:54:33.665 : NextMessageLength=37
DEBUG [SFTPMessageFactory] 21 Jun 2013 11:54:33.665 : Received message (type=105,len=37)
ALL [SFTPFileAttributes] 21 Jun 2013 11:54:33.665 : flags=15
DEBUG [SFTPMessageStore] 21 Jun 2013 11:54:33.665 : AddMessage(7) - added to store
ALL [SFTPMessage] 21 Jun 2013 11:54:33.665 : Reply : Name=SSH_FXP_ATTRS,Type=105,RequestID=7
attributes=US=-194791, G=0, D=False, F=True, LI=False, R=True, W=True, AT=1371787200, AD=6/21/2013 4:00:00 AM, MT=1371791283, MD=6/21/2013 5:08:03 AM, P=33216, S=1674, U=-rwx------
ALL [SFTPMessage] 21 Jun 2013 11:54:33.665 : Send : Name=SSH_FXP_OPEN,Type=3,RequestID=8
absolutePath=/QSYS.lib/TPLIB.lib/CSPPOSTIME.file/STR50271.MBR
flags=26
attributes=US=0, G=0, D=False, F=True, LI=False, R=True, W=True, AT=0, AD=1/1/1970 12:00:00 AM, MT=0, MD=1/1/1970 12:00:00 AM, P=33216, S=0, U=-rwx------
DEBUG [SSH2Channel] 21 Jun 2013 11:54:33.665 : Transmit 77 bytes
DEBUG [ChannelDataWindow] 21 Jun 2013 11:54:33.665 : Remote window size decreased to 2096769
DEBUG [PlainSocket] 21 Jun 2013 11:54:33.665 : RepeatCallback received 68 bytes
DEBUG [SSH2Connection] 21 Jun 2013 11:54:33.665 : ProcessPacket pt=SSH_MSG_CHANNEL_DATA
ALL [AbstractSFTPChannelReceiver] 21 Jun 2013 11:54:33.665 : NextMessageLength=24
DEBUG [SFTPMessageFactory] 21 Jun 2013 11:54:33.665 : Received message (type=101,len=24)
DEBUG [SFTPMessage] 21 Jun 2013 11:54:33.665 : ErrorCode|Status=4
DEBUG [SFTPMessageStore] 21 Jun 2013 11:54:33.665 : AddMessage(8) - added to store
ALL [SFTPMessage] 21 Jun 2013 11:54:33.665 : Reply : Name=SSH_FXP_STATUS,Type=101,RequestID=8
errorCode=4
errorMessage=Failure
language=
ERROR [SFTPSubsystem] 21 Jun 2013 11:54:33.665 : GetHandleResponse: Failure
DEBUG [SSHFTPClient] 21 Jun 2013 11:54:33.665 : Catching and ignoring exception: Failure (code=4)
ALL [SFTPMessage] 21 Jun 2013 11:54:33.665 : Send : Name=SSH_FXP_OPEN,Type=3,RequestID=9
absolutePath=/QSYS.lib/TPLIB.lib/CSPPOSTIME.file/STR50271.MBR
flags=26
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: SFTP Uploadfile to AS400 in ASCII throws errorCode=4

by support2 » Sat Jun 22, 2013 6:01 am

General failure - it doesn't tell you much. IBM support for SFTP is a bit patchy - I would stick to binary transfers if they work.
no avatar
User

balugo05

Posts

2

Joined

Sat Jun 22, 2013 1:41 am

Location

Florida, USA

by balugo05 » Sat Jun 22, 2013 6:34 am

I can get around it but I wanted to find out what the code meant.

Thanks for the reply!

Who is online

Users browsing this forum: No registered users and 22 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign
cron