Topic "Error generating directory listings"

Author Message
Guest




There is a bug in the latest build of winSCP(3.7.5 build 294) where directory listings are not properly parsed and cause errors. This happens in both interfaces (explorer or norton-like).

The server I am connecting to via SCP is running OSF1 V5.1 2650 alpha (obtained from uname -a).

Here is the relevant portion of the log:

. Cached directory change via "public_html" to "/net/nfs6/vol1/homes/rcote/public_html".
. Getting current directory name.
. Listing current directory.
. Locating to cached directory "/net/nfs6/vol1/homes/rcote/public_html".
. There are 0 bytes remaining in the send buffer
. There are 0 bytes remaining in the send buffer
> cd "/net/nfs6/vol1/homes/rcote/public_html" ; echo "WinSCP: this is end-of-file:$status"
. Waiting for another 1 bytes
< WinSCP: this is end-of-file:0
. There are 0 bytes remaining in the send buffer
. There are 0 bytes remaining in the send buffer
> ls -la ; echo "WinSCP: this is end-of-file:$status"
. Waiting for another 1 bytes
< total 21104
< drwxrwxr-x 5 rcote swissprot 4096 Jun 15 11:57 .
< drwxr-x--x 8 rcote swissprot 4096 Jun 2 17:08 ..
< drwxrwxr-x 2 rcote swissprot 4096 May 20 09:58 cgi-bin
< -rw-rw-r-- 1 rcote swissprot 23567 May 12 12:10 index.html
< -rw-r--r-- 1 rcote swissprot21539891 Jun 17 10:36 mzDataConvert.zip
< drwxrwxr-x 2 rcote swissprot 4096 May 17 13:34 ontology-db
< drwxrwxr-x 2 rcote swissprot 4096 May 20 17:26 uml
< WinSCP: this is end-of-file:0
* (ECommand) Error listing directory '/net/nfs6/vol1/homes/rcote/public_html'.
* Unexpected directory listing line '-rw-r--r-- 1 rcote swissprot21539891 Jun 17 10:36 mzDataConvert.zip'.

This bug is repeatable in any directory where the filesize and usergroup are not separated by a whitespace.

Regards,
Rc
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Please try SFTP instead of SCP.
_________________
Martin Prikryl
whalenr
[View user's profile]

Joined: 2005-06-20
Posts: 2
I'm attempting to test WinSCP against our SFTP server and getting the following errors:
Version 3 of the protocol:
Error listing directory SFTP Packet (112,33184,11597)
Version 4 or 5
Error decoding SFTP Packet (39,4,39)

If you can give me some idea as to what the actual problem is, we can help make sure that our software works together.

Richard Whalen
Process Software
whalenr
[View user's profile]

Joined: 2005-06-20
Posts: 2
From the tail end of the log file with debug 2:
> 2005-06-21 11:20:21.506 Type: SSH_FXP_READDIR, Size: 17, Number: 1804
> 2005-06-21 11:20:21.506 0C,00,00,07,0C,00,00,00,08,00,8F,11,80,00,8F,9A,28,
. 2005-06-21 11:20:21.506 There are 0 bytes remaining in the send buffer
. 2005-06-21 11:20:21.506 Waiting for another 4 bytes
. 2005-06-21 11:20:21.506 Looking for incoming data
. 2005-06-21 11:20:21.526 Select result is 1
< 2005-06-21 11:20:21.526 Type: SSH_FXP_STATUS, Size: 22, Number: 1804
< 2005-06-21 11:20:21.526 65,00,00,07,0C,00,00,00,01,00,00,00,03,45,4F,46,00,00,00,02,65,6E,
< 2005-06-21 11:20:21.526 Status/error code: 1
> 2005-06-21 11:20:21.526 Type: SSH_FXP_CLOSE, Size: 17, Number: 2052
> 2005-06-21 11:20:21.526 04,00,00,08,04,00,00,00,08,00,8F,11,80,00,8F,9A,28,
. 2005-06-21 11:20:21.526 There are 0 bytes remaining in the send buffer
* 2005-06-21 11:20:21.536 (Exception) Error decoding SFTP packet (39, 4, 39).
. 2005-06-21 11:20:23.619 Closing connection.

The debug log for the server indicates that the FXP_CLOSE operation completed successfully, and a SSH_FX_OK status should have been sent.
_________________
Richard Whalen
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
whalenr wrote:
I'm attempting to test WinSCP against our SFTP server and getting the following errors:
Version 3 of the protocol:
Error listing directory SFTP Packet (112,33184,11597)

There's not such error in WinSCP, IFAIK. Wasn't it "Error listing directory. Error decoding SFTP Packet" or something similar?
Quote:
Version 4 or 5
Error decoding SFTP Packet (39,4,39)

I have no idea how this could happened. I have just sent you an email with link to debug version.
_________________
Martin Prikryl
Yngve

Guest


I have the same error. It seems that I get the error in all folders where I have files bigger than 100MB. From your error-log it seems like it is this line causing the error:

-rw-r--r-- 1 rcote swissprot21539891 Jun 17 10:36 mzDataConvert.zip

The group name and file size is "melting" together when typing ls -all: swissprot21539891, I think WinSCP tries to calculate the size of a file from "swissprot21539891" an generate the error.

Another example:

Unexpected directory listing line '-rwxrw---- 1 guest everyone734693376 Nov 12 2005 Karl.avi'.
Guest




Anonymous wrote:

This bug is repeatable in any directory where the filesize and usergroup are not separated by a whitespace.


Ah! Didn't read all of your post Smile Seems like we have same conclusion. Is there any fix for this bug?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Quote:
Ah! Didn't read all of your post Smile Seems like we have same conclusion. Is there any fix for this bug?

Use SFTP if possible.
_________________
Martin Prikryl
Yngve Bergheim

Guest


Is it possible to do a check against digits?

Check if it’s an integer value, backwards. I.e. swissprot21539891, would test 1,9,… until it hits first character ‘t’ and then escapes with a FileSize = substr(lsFileSize, -8)

Would have been nice :-)

I could maybe help if you point out for me where to start in the source.
Yngve Bergheim

Guest


Think I have located the code that needs to be modified. I'm not a C++ developer, so I'm not sure if I should try to modify anything.

If we do the test the other way around, from size to group, I think we could make WinSCP handle files bigger than 100MB. What do you think?

\core\RemoteFiles.cpp line 651-663

Code:

    do
    {
      FGroup += Col;
      GETCOL;
      assert(!Col.IsEmpty());
      // for devices etc.. there is additional column ending by comma, we ignore it
      if (Col[Col.Length()] == ',') GETCOL;
      ASize = StrToInt64Def(Col, -1);
      // if it's not a number (file size) we take it as part of group name
      // (at least on CygWin, there can be group with space in its name)
      if (ASize < 0) Col = " " + Col;
    }
    while (ASize < 0);
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Yngve Bergheim wrote:
Think I have located the code that needs to be modified. I'm not a C++ developer, so I'm not sure if I should try to modify anything.

If we do the test the other way around, from size to group, I think we could make WinSCP handle files bigger than 100MB. What do you think?

I'll give it a try Smile
_________________
Martin Prikryl
Yngve Bergheim

Guest


Marvellous! Very Happy Very Happy Very Happy I don't think I would have managed it myself!
kevino

Guest


I'm still seeing the mentioned "directory listing" bug in 3.8.2 (Build 330)
Guest




I am constantly getting similar bug but can't determine its nature. I tried various settings but every time this bug prevented me from doing anything with remote files but for staring at their names in the log. Here is a part of log, that seems to be about it:

ls -la ; echo "WinSCP: this is end-of-file:$status"
total 85
drwxr-xr-x 32 root 1024 Jul 16 2003 .
drwxr-xr-x 32 root 1024 Jul 16 2003 ..
drwx--x--- 7 root 512 Oct 29 22:17 .root
drwxr-xr-x 2 root 512 Mar 1 1999 TT_DB
drwxr-xr-x 2 root 512 Jan 8 2005 anonftp
dr-xr-xr-x 2 root 2 Nov 17 14:49 atlas
lrwxrwxrwx 1 root 9 Aug 30 1997 bin -> ./usr/bin
drwxr-xr-x 4 root 512 Dec 14 1998 cache
drwxr-xr-x 11 130 512 Oct 10 2001 cern
lrwxrwxrwx 1 root 9 Apr 19 1998 core -> /dev/null
dr-xr-xr-x 2 root 2 Nov 17 14:49 data
drwxrwxr-x 16 root 4608 Nov 17 10:28 dev
Detected incoming data while idle
drwxrwxr-x 4 root 512 Aug 30 1997 devices
drwxrwxr-x 27 root 3072 Nov 17 10:28 etc
drwxrwxr-x 5 root 512 Oct 22 1997 export
dr-xr-xr-x 2 root 6 Nov 17 14:49 home
drwxrwxrwt 4 root 512 Nov 17 14:46 junk
drwxr-xr-x 9 root 512 Feb 8 1998 kernel
lrwxrwxrwx 1 root 9 Aug 30 1997 lib -> ./usr/lib
drwx------ 2 root 8192 Aug 30 1997 lost+found
drwxrwxr-x 2 root 512 Aug 30 1997 mnt
dr-xr-xr-x 2 root 2 Nov 17 14:49 net
dr-xr-xr-x 2 root 2 Nov 17 14:49 nomad
drwxr-xr-x 20 root 1024 Aug 7 2003 opt
drwxr-xr-x 5 root 512 Aug 3 2000 platform
dr-xr-xr-x 2 root 31680 Nov 17 14:49 proc
lrwxrwxrwx 1 root 12 Apr 7 2002 pub -> /home/nuweb/
drwxrwxr-x 2 root 512 Oct 16 2000 sbin
drwxrwxrwt 39 root 2048 Nov 17 14:33 scratch
drwxr-xr-x 9 root 512 Nov 21 2002 share
dr-xr-xr-x 2 root 2 Nov 17 14:49 shome
lrwxrwxrwx 1 root 13 Feb 21 2002 tftpboot -> /opt/tftpboot
drwxrwxrwt 7 sys 632 Nov 17 14:49 tmp
drwxrwxr-x 37 root 1024 Jul 16 2003 usr
drwxr-xr-x 27 root 1024 Aug 7 2003 var
drwxr-xr-x 2 root 512 Aug 30 1997 vol
lrwxrwxrwx 1 root 17 Apr 7 2002 www -> /home/nuweb/httpd
dr-xr-xr-x 2 root 2 Nov 17 14:49 xfn
WinSCP: this is end-of-file:0
(ECommand) Error listing directory '/'.
Unexpected directory listing line 'drwxr-xr-x 32 root 1024 Jul 16 2003 .'.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Anonymous wrote:
I am constantly getting similar bug but can't determine its nature. I tried various settings but every time this bug prevented me from doing anything with remote files but for staring at their names in the log.

Use SFTP or try to enable option Alias LS to display group name.
_________________
Martin Prikryl
Guest




kevino wrote:
I'm still seeing the mentioned "directory listing" bug in 3.8.2 (Build 330)


I just tried 4.0.4 and apparently this bug is still present. Kind of annoying. And I don't have an SFTP server running, so that's not an option. And yes, I do have "Alias LS to display group name" enabled. Does not fix it either.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Quote:
I just tried 4.0.4 and apparently this bug is still present. Kind of annoying. And I don't have an SFTP server running, so that's not an option. And yes, I do have "Alias LS to display group name" enabled. Does not fix it either.

There's too many different issues mentioned in this thread. Which one do you mean?
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
This issue is being tracked here.
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
For list of reasons WinSCP cannot parse directory listing and possible resolutions, see documentation.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License