0 votes
by (160 points)

We're trying to SFTP a small text file and receive the output below. We don't know what "Error 10" is. Can anyone enlighten us?

2012-11-13 15:39:13.752 Opening log file.
2012-11-13 15:39:14.259 INFO Sftp(1)[10] Info: Connecting to sftp2.phpmcs.com:22 using Sftp 3.0.4444.0.
2012-11-13 15:39:14.402 DEBUG Sftp(1)[10] SSH: Server is 'SSH-2.0-CerberusFTPServer_5.0 FIPS'.
2012-11-13 15:39:14.404 INFO Sftp(1)[10] SSH: Negotiation started.
2012-11-13 15:39:14.719 DEBUG Sftp(1)[10] SSH: Group exchange.
2012-11-13 15:39:15.050 DEBUG Sftp(1)[10] SSH: Negotiating key.
2012-11-13 15:39:15.247 DEBUG Sftp(1)[10] SSH: Validating signature.
2012-11-13 15:39:15.342 INFO Sftp(1)[10] SSH: Negotiation finished.
2012-11-13 15:39:15.342 INFO Sftp(1)[10] Info: Server: SSH-2.0-CerberusFTPServer_5.0 FIPS
2012-11-13 15:39:15.343 INFO Sftp(1)[10] Info: Fingerprint: 3b:a7:62:0f:34:77:e3:56:a8:11:e7:29:c0:5c:14:8f
2012-11-13 15:39:15.343 INFO Sftp(1)[10] Info: Cipher info: SSH 2.0, DiffieHellmanGroupExchangeSHA1, RSA, aes256-cbc/aes256-cbc, SHA1/SHA1
2012-11-13 15:39:26.924 DEBUG Sftp(1)[10] SSH: Allowed authentication methods: publickey.
2012-11-13 15:39:26.924 DEBUG Sftp(1)[10] SSH: Trying public key authentication for 'username'.
2012-11-13 15:39:27.011 DEBUG Sftp(1)[10] SSH: Authentication successful.
2012-11-13 15:39:27.075 DEBUG Sftp(1)[10] SSH: Requesting subsystem 'sftp'.
2012-11-13 15:39:27.139 INFO Sftp(1)[10] Command: SSH_FXP_INIT (4)
2012-11-13 15:39:27.200 INFO Sftp(1)[10] Response: SSH_FXP_VERSION (4, 4 extensions)
2012-11-13 15:39:27.200 INFO Sftp(1)[10] Info: Using SFTP v4 on a Windows-like platform.
2012-11-13 15:39:27.202 INFO Sftp(1)[10] Command: SSH_FXP_REALPATH (1, '.')
2012-11-13 15:39:27.262 INFO Sftp(1)[10] Response: SSH_FXP_NAME (1, 1 item)
2012-11-13 15:39:27.262 INFO Sftp(1)[10] Info: Current directory is '/'.
2012-11-13 15:39:39.406 INFO Sftp(1)[10] Command: SSH_FXP_OPEN (2, '/20121215153804109.txt', 26)
2012-11-13 15:39:39.467 INFO Sftp(1)[10] Response: SSH_FXP_STATUS (2, 10, '')
2012-11-13 15:39:39.479 ERROR Sftp(1)[10] Info: Rebex.Net.SftpException: Error 10.
   at gbMKS.PEQpz.eCVvJZ(1dRwomZ , Type )
   at gbMKS.PEQpz.BGrFh(String , Qu2Ci , Boolean )
   at Rebex.Net.Sftp.1xTmHi(Qu2Ci , udycp , String , Stream , Int64 , Int64 , 27NpLhZ )
Applies to: Rebex SFTP

1 Answer

+1 vote
by (132k points)
Best answer

According to SFTP v4 draft, error code 10 is SSH_FX_NO_SUCH_PATH and means that "the file path does not exist or is invalid". This error was reported by the SFTP server in response to client's attempt to open the file.

In most cases, the SftpException would contain an error message sent by the server. In this case, however, the server only send a code with an empty message ('' in the log), so a simple "Error 10" message was reported instead. We will change our code to report something more meaningful in this case.

by (160 points)

Thanks Lukas for verifying that. I saw code 10 (here) and thought as much but I wasn't sure if the SftpException used the same codes or it was something internal to the assembly. It turns out our partner has not given us rw on the drop point.

by (132k points)

Actually, SftpException has Code property which returns an SftpErrorCode enum value that represents the SFTP error code. However, we convert all codes to SFTP v3 error numbers (in order to make the component behave the same regardless the SFTP server), of which there are only 9.