Thread: [JSch-users] response code 10 to ChannelSftp.ls command
Status: Alpha
Brought to you by:
ymnk
|
From: Bradley W. <bra...@ha...> - 2010-08-16 21:10:42
|
Hi, we ran into an issue today where we were getting back an
unexpected response code from the ChannelSftp.ls command:
Caused by: 10: No such path.
at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2289)
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:1741)
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:1758)
at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1196)
at com.hannonhill.cascade.model.publish.transmit.SFTPShuttle.mkdirIfNecessary(SFTPShuttle.java:378)
... 13 more
We were depending on getting back ChannelSftp.SSH_FX_NO_SUCH_FILE when
the file/directory didn't exist.
I looked for both the error code and message in the ChannelSftp class
and could find neither.
Any ideas?
Thanks,
Bradley
|
|
From: Bradley W. <bra...@ha...> - 2010-08-19 22:08:08
|
Specifically, this is happening when connecting to a Titan FTP server.
I was able to determine that there appear to be different responses
depending what is passed to "ls". For example, if neither "files" nor
"files/js" directories exist, then ls("files/js") gives: "10: No such
path"and the stacktrace below.
However, if you just do ls("files"), you'll get a response code of 2
which ChannelSftp calls SSH_FX_NO_SUCH_FILE. Is this response code of
10 even a valid SFTP response code?
On Mon, Aug 16, 2010 at 5:10 PM, Bradley Wagner
<bra...@ha...> wrote:
>
> Hi, we ran into an issue today where we were getting back an
> unexpected response code from the ChannelSftp.ls command:
>
> Caused by: 10: No such path.
> at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2289)
> at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:1741)
> at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:1758)
> at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1196)
> at com.hannonhill.cascade.model.publish.transmit.SFTPShuttle.mkdirIfNecessary(SFTPShuttle.java:378)
> ... 13 more
>
> We were depending on getting back ChannelSftp.SSH_FX_NO_SUCH_FILE when
> the file/directory didn't exist.
>
> I looked for both the error code and message in the ChannelSftp class
> and could find neither.
>
> Any ideas?
>
> Thanks,
> Bradley
--
Hannon Hill - Put Us to the Test
bra...@ha... | http://www.hannonhill.com
|
|
From: <ym...@jc...> - 2010-08-23 07:12:22
|
Hi,
+-From: Bradley Wagner <bra...@ha...> --
|_Date: Thu, 19 Aug 2010 18:07:58 -0400 _________________
|
|Specifically, this is happening when connecting to a Titan FTP server.
|I was able to determine that there appear to be different responses
|depending what is passed to "ls". For example, if neither "files" nor
|"files/js" directories exist, then ls("files/js") gives: "10: No such
|path"and the stacktrace below.
|However, if you just do ls("files"), you'll get a response code of 2
|which ChannelSftp calls SSH_FX_NO_SUCH_FILE. Is this response code of
|10 even a valid SFTP response code?
According to
http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13
the response code 10 is valid. At section "9.1 Status Response",
that document says as follows,
Error Codes:
...
SSH_FX_NO_SUCH_PATH 10
...
SSH_FX_NO_SUCH_PATH
The file path does not exist or is invalid.
Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Skype callto://jcraft/
Twitter: @ymnk
|
|
From: Bradley W. <bra...@ha...> - 2010-08-23 13:28:26
|
> +-From: Bradley Wagner <bra...@ha...> --
> |_Date: Thu, 19 Aug 2010 18:07:58 -0400 _________________
> |
> |Specifically, this is happening when connecting to a Titan FTP server.
> |I was able to determine that there appear to be different responses
> |depending what is passed to "ls". For example, if neither "files" nor
> |"files/js" directories exist, then ls("files/js") gives: "10: No such
> |path"and the stacktrace below.
>
> |However, if you just do ls("files"), you'll get a response code of 2
> |which ChannelSftp calls SSH_FX_NO_SUCH_FILE. Is this response code of
> |10 even a valid SFTP response code?
>
> According to
> http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13
> the response code 10 is valid. At section "9.1 Status Response",
> that document says as follows,
>
> Error Codes:
> ...
> SSH_FX_NO_SUCH_PATH 10
> ...
> SSH_FX_NO_SUCH_PATH
> The file path does not exist or is invalid.
If that's the case, is there a reason that is not one of the listed
response codes in ChannelSftp that begin with "SSH_FX_". I only see 0
through 8.
Thanks,
Bradley
> Sincerely,
> --
> Atsuhiko Yamanaka
> JCraft,Inc.
> 1-14-20 HONCHO AOBA-KU,
> SENDAI, MIYAGI 980-0014 Japan.
> Tel +81-22-723-2150
> +1-415-578-3454
> Skype callto://jcraft/
> Twitter: @ymnk
|
|
From: <ym...@jc...> - 2010-08-23 14:46:58
|
Hi,
+-From: Bradley Wagner <bra...@ha...> --
|_Date: Mon, 23 Aug 2010 09:28:18 -0400 _________________
|
>> Error Codes:
>> ,A (B...
>> ,A (BSSH_FX_NO_SUCH_PATH ,A (B ,A (B ,A (B ,A (B ,A (B ,A (B ,A (B ,A (B ,A (B10
>> ,A (B...
>> ,A (BSSH_FX_NO_SUCH_PATH
>> ,A (B ,A (B ,A (BThe file path does not exist or is invalid.
|If that's the case, is there a reason that is not one of the listed
|response codes in ChannelSftp that begin with "SSH_FX_". I only see 0
|through 8.
The error code 9 and larger had been added since
http://tools.ietf.org/html/draft-ietf-secsh-filexfer-03
and that spec has defined the sftp protocol version 4.
JSch supports sftp protocol version 3, and OpenSSH's sftp also only supports version 3.
I think that sftpd(Titan FTP server) should not send such an error code(10) to
the sftp client, which does not support version 4.
Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Skype callto://jcraft/
Twitter: @ymnk
|
|
From: Bradley W. <bra...@ha...> - 2010-08-23 15:58:28
|
On Mon, Aug 23, 2010 at 10:46 AM, Atsuhiko Yamanaka <ym...@jc...> wrote: > > +-From: Bradley Wagner <bra...@ha...> -- |_Date: Mon, 23 Aug 2010 09:28:18 -0400 _________________ | >> Error Codes: >> (B... >> (BSSH_FX_NO_SUCH_PATH (B10 >> (B... >> (BSSH_FX_NO_SUCH_PATH >> (BThe file path does not exist or is invalid. |If that's the case, is there a reason that is not one of the listed |response codes in ChannelSftp that begin with "SSH_FX_". I only see 0 |through 8. The error code 9 and larger had been added since http://tools.ietf.org/html/draft-ietf-secsh-filexfer-03 and that spec has defined the sftp protocol version 4. JSch supports sftp protocol version 3, and OpenSSH's sftp also only supports version 3. I think that sftpd(Titan FTP server) should not send such an error code(10) to the sftp client, which does not support version 4. Thanks for the information. I went in and checked the settings for Titan SFTP server and found that it was set to use SFTP protocol version 3. Would this indicate a bug in the server software since you're saying this response code was not supported in version 3 of the protocol? |
|
From: <ym...@jc...> - 2010-08-24 07:55:10
|
Hi,
+-From: Bradley Wagner <bra...@ha...> --
|_Date: Mon, 23 Aug 2010 11:58:20 -0400 _________________
|
|I went in and checked the settings for Titan SFTP server and found
|that it was set to use SFTP protocol version 3. Would this indicate a
|bug in the server software since you're saying this response code was
|not supported in version 3 of the protocol?
I'll not say it is a bug,
but it should not send such a code on SFTP protocol version 3.
Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Skype callto://jcraft/
Twitter: @ymnk
|