Login  
Search All Forums
Dart Home | PowerTCP FTP for .NET | Custom Development Reply | PowerTCP FTP for .NET Topics | Forums   
AuthorForum: PowerTCP FTP for .NET
Topic: Exception from List: Input string was not in correct format
larryaasen

From: Herndon, VA USA
Posts: 14
Member Since: 10/24/03
posted November 12, 2003 4:50 PM

I noticed that there was an exception that says the "Input string was not in correct format" when trying to get a list of files from FTP. This happens frequently for some unknown reason. It does not do this all the time but once it starts happening, it continues forever. It goes away after the application is restarted.

Here is the exception:
ftp3: FTPDeleteManager.HandleFile failure.
Exception: Input string was not in a correct format.
Stack:
  at c.c(Delegate A_0, Object[] A_1)
  at Dart.PowerTCP.Ftp.Ftp.List(String searchPattern, Boolean full)
  at FlightDispatch.FileTransferSvc.FTPDeleteManager.DeleteFilesOlder (DateTime expireTime)
  at FlightDispatch.FileTransferSvc.FTPDeleteManager.HandleFile(TransferData file)

Here is part of my log from the Trace event:
11/12/2003 3:44:50 PM Sent ->CWD /usr/local/apache-2.0.47/htdocs/Data/Tracks
11/12/2003 3:44:50 PM Rec -->250 CWD command successful.
11/12/2003 3:44:50 PM Sent ->TYPE I
11/12/2003 3:44:50 PM Rec -->200 Type set to I.
11/12/2003 3:44:50 PM Sent ->PASV
11/12/2003 3:44:50 PM Rec -->227 Entering Passive Mode (172,27,173,195,169,148)
11/12/2003 3:44:50 PM Sent ->STOR tmp5C28.tmp
11/12/2003 3:44:50 PM Rec -->150 Binary data connection for tmp5C28.tmp (172.27.66.42,1576).
11/12/2003 3:44:50 PM Rec -->226 Transfer complete.
11/12/2003 3:44:50 PM Sent ->TYPE A
11/12/2003 3:44:50 PM Rec -->200 Type set to A.
11/12/2003 3:44:50 PM Sent ->PASV
11/12/2003 3:44:50 PM Rec -->227 Entering Passive Mode (172,27,173,195,169,149)
11/12/2003 3:44:50 PM Sent ->LIST tmp5C28.tmp
11/12/2003 3:44:50 PM Rec -->150 ASCII data connection for /bin/ls (172.27.66.42,1577) (0 bytes).
11/12/2003 3:44:50 PM Rec -->226 ASCII Transfer complete.
11/12/2003 3:44:50 PM Sent ->PASV
11/12/2003 3:44:50 PM Rec -->227 Entering Passive Mode (172,27,173,195,169,150)
11/12/2003 3:44:50 PM Sent ->LIST
11/12/2003 3:44:50 PM Rec -->150 ASCII data connection for /bin/ls (172.27.66.42,1578) (0 bytes).
11/12/2003 3:44:51 PM Rec -->226 ASCII Transfer complete.
11/12/2003 3:44:51 PM Sent ->DELE tmp5C28.tmp
11/12/2003 3:44:51 PM Rec -->250 DELE command successful.
11/12/2003 3:44:51 PM ftp1.List
11/12/2003 3:44:51 PM Sent ->PASV
11/12/2003 3:44:51 PM Rec -->227 Entering Passive Mode (172,27,173,195,169,151)
11/12/2003 3:44:51 PM Sent ->LIST *
11/12/2003 3:44:51 PM Rec -->150 ASCII data connection for /bin/ls (172.27.66.42,1579) (0 bytes).
11/12/2003 3:44:52 PM Rec -->226 ASCII Transfer complete.

My call to List is like this:
Listing fileList = ftp3.List( "*", true );

Why does this exception get generated?

Thanks,
Larry
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 12, 2003 5:09 PM

It means that the server gave us a listing that we did not understand. Normally we would eat the error and just not populate the Listing object giving you access to the listing through the ToString() method.

It looks like you found a List that has data in it that we don't parse correctly.

If you want this resolved, please supply a way to duplicate the problem. The easiest way would be to give us the info needed to get into a server that does listings like that.

If you don't want to post that info here, feel free to send it to support@dart.com

larryaasen

From: Herndon, VA USA
Posts: 14
Member Since: 10/24/03
posted November 12, 2003 5:34 PM

Tony,

Thanks for the info. I will log the listing in the log file this time. What ToString() method do I use to get the listing returned from List()? I assume the one from the PowerTCP.Ftp class, right?

Larry
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 12, 2003 5:42 PM

Listing.ToString() should give you the raw text of the listing.
larryaasen

From: Herndon, VA USA
Posts: 14
Member Since: 10/24/03
posted November 12, 2003 5:48 PM

If the List method throws an exception, then the listing object returned by the method call will not execute. How will I call ToString on the listing object that is never returned?
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 12, 2003 8:07 PM

That's true. Sorry for not thinking of that. Please try to use another means to get the listing and send it to us.

larryaasen

From: Herndon, VA USA
Posts: 14
Member Since: 10/24/03
posted November 13, 2003 9:16 AM

I will save the Segment.Buffer data in my log file from the Trace event and send that to you. 

By the way, the help topic for the Segment.Buffer Property includes sample code that does not use Segment.Buffer.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 13, 2003 9:23 AM

The List does not come through on the trace, since it is on a separate connection. You'll have to use another FTP program to do that.

It would be easiest if you could somehow point me to a server that demos the problem.

larryaasen

From: Herndon, VA USA
Posts: 14
Member Since: 10/24/03
posted November 13, 2003 9:39 AM

Unfortunately, the FTP server is on a protected network and can only be accessed from one machine on our other network.
larryaasen

From: Herndon, VA USA
Posts: 14
Member Since: 10/24/03
posted November 13, 2003 9:40 AM

I can use WS_FTP Pro to connect to that FTP server. Will that provide the data you need?
larryaasen

From: Herndon, VA USA
Posts: 14
Member Since: 10/24/03
posted November 13, 2003 9:56 AM

I used the command line version of FTP to generate the following list. Note that it returns the 5 directories that are named 2003-11-09, 2003-11-10, 2003-11-11, 2003-11-12, and 2003-11-13. Do you think the directory names are messing up the parsing of the list results?

Here is the output:

ftp> ls -long
200 PORT command successful.
150 ASCII data connection for /bin/ls (172.27.66.42,4554) (0 bytes).
total 314
drwxr-xr-x  2  34816 Nov 11 06:34 2003-11-09
drwxr-xr-x  2  34304 Nov 10 19:15 2003-11-10
drwxr-xr-x  2  34816 Nov 11 19:15 2003-11-11
drwxr-xr-x  2  34816 Nov 12 19:14 2003-11-12
drwxr-xr-x  2  20992 Nov 13 09:49 2003-11-13
226 ASCII Transfer complete.
ftp: 251 bytes received in 0.03Seconds 7.84Kbytes/sec.
ftp>
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 13, 2003 10:13 AM

It's kind of late to be asking you this, but what is the version of your Dart.PowerTCP.Ftp.dll?

Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 13, 2003 10:29 AM

Also, do you know what the third field is (eg 34816)? Is that the size of the file?

larryaasen

From: Herndon, VA USA
Posts: 14
Member Since: 10/24/03
posted November 13, 2003 11:02 AM

The version I have is 2.0.3.0 and the 34816 column is size in bytes according to WS_FTP Pro. The command line FTP doesn't actually say but I checked it against WS_FTP Pro.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 13, 2003 11:22 AM

That's pretty far off from the shipping (2.2.5.0) but I just checked against the shipping and found that, while I did not get an exception, the directories all had no names.

I can offer you a workaround for now, but I have entered this as issue 2145 in case you want to call in (315-790-5456) and check on the status (please do not ask when it will be fixed here, I do not have that info)

WORKAROUND:

Get the latest FtpDotNet.msi from:

http://www.dart.com/downloads/ftpdotnet.msi

Uninstall your existing Ftp for .NET, then install the newer one.

Now when you get the listing it should not throw an exception. However the type will still be UNIX. You will know that the Listing failed when the filename is "". At that point you can use Listing.ToString() and parse the names yourself.
larryaasen

From: Herndon, VA USA
Posts: 14
Member Since: 10/24/03
posted November 13, 2003 12:01 PM

That is the version I received when I downloaded it from your website on 10/17/2003. Is that the wrong place to get the component?
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 13, 2003 12:13 PM

No, that's the right place. It was updated recently.
larryaasen

From: Herndon, VA USA
Posts: 14
Member Since: 10/24/03
posted November 13, 2003 2:05 PM

I have installed the latest version of the FTP component, and placed the results from the Listing.ToString() method. The results are below. The file list has been reduced to 3 files for posting, so the total bytes values will be off. Hope this helps.

11/13/2003 1:43:44 PM Rec -->220 atawfdweb FTP server (SunOS 5.8) ready.
11/13/2003 1:43:44 PM Sent ->USER ftpwfd
11/13/2003 1:43:44 PM Rec -->331 Password required for ftpwfd.
11/13/2003 1:43:44 PM Sent ->PASS **********
11/13/2003 1:43:44 PM Rec -->230 User ftpwfd logged in.
11/13/2003 1:43:44 PM Sent ->PWD
11/13/2003 1:43:44 PM Rec -->257 "/usr/local/apache-2.0.47" is current directory.
11/13/2003 1:43:44 PM Sent ->CWD /usr/local/apache-2.0.47/htdocs/Data/Tracks
11/13/2003 1:43:44 PM Rec -->250 CWD command successful.
11/13/2003 1:43:44 PM Sent ->TYPE I
11/13/2003 1:43:44 PM Rec -->200 Type set to I.
11/13/2003 1:43:44 PM Sent ->PASV
11/13/2003 1:43:44 PM Rec -->227 Entering Passive Mode (172,27,173,195,181,193)
11/13/2003 1:43:44 PM Sent ->STOR tmp5CD5.tmp
11/13/2003 1:43:44 PM Rec -->150 Binary data connection for tmp5CD5.tmp (172.27.66.42,1185).
11/13/2003 1:43:44 PM Rec -->226 Transfer complete.
11/13/2003 1:43:44 PM Sent ->TYPE A
11/13/2003 1:43:44 PM Rec -->200 Type set to A.
11/13/2003 1:43:45 PM Sent ->PASV
11/13/2003 1:43:45 PM Rec -->227 Entering Passive Mode (172,27,173,195,181,194)
11/13/2003 1:43:45 PM Sent ->LIST tmp5CD5.tmp
11/13/2003 1:43:45 PM Rec -->150 ASCII data connection for /bin/ls (172.27.66.42,1186) (0 bytes).
11/13/2003 1:43:45 PM Rec -->226 ASCII Transfer complete.
11/13/2003 1:43:45 PM Sent ->PASV
11/13/2003 1:43:45 PM Rec -->227 Entering Passive Mode (172,27,173,195,181,195)
11/13/2003 1:43:45 PM Sent ->LIST
11/13/2003 1:43:45 PM Rec -->150 ASCII data connection for /bin/ls (172.27.66.42,1187) (0 bytes).
11/13/2003 1:43:45 PM Rec -->226 ASCII Transfer complete.
11/13/2003 1:43:45 PM Sent ->DELE tmp5CD5.tmp
11/13/2003 1:43:45 PM Rec -->250 DELE command successful.
11/13/2003 1:43:45 PM ftp1.List
11/13/2003 1:43:45 PM Sent ->PASV
11/13/2003 1:43:45 PM Rec -->227 Entering Passive Mode (172,27,173,195,181,196)
11/13/2003 1:43:45 PM Sent ->LIST *
11/13/2003 1:43:45 PM Rec -->150 ASCII data connection for /bin/ls (172.27.66.42,1188) (0 bytes).
11/13/2003 1:43:46 PM Rec -->226 ASCII Transfer complete.
11/13/2003 1:43:47 PM Listing:
2003-11-09:
total 11378
drwxr-xr-x  2 ftpwfd  other   34816 Nov 11 06:34 .
drwxr-xr-x  7 ftpwfd  other   743936 Nov 13 13:42 ..
-rw-r--r--  1 ftpwfd  other   130163 Nov 9 18:35 23.19.48.xml
-rw-r--r--  1 ftpwfd  other   127983 Nov 9 18:36 23.20.48.xml
-rw-r--r--  1 ftpwfd  other   127527 Nov 9 18:37 23.21.48.xml

2003-11-10:
total 171376
drwxr-xr-x  2 ftpwfd  other   34304 Nov 10 19:15 .
drwxr-xr-x  7 ftpwfd  other   743936 Nov 13 13:42 ..
-rw-r--r--  1 ftpwfd  other   117264 Nov 9 19:16 00.00.48.xml
-rw-r--r--  1 ftpwfd  other   113209 Nov 9 19:17 00.01.48.xml
-rw-r--r--  1 ftpwfd  other   110256 Nov 9 19:18 00.02.48.xml

2003-11-11:
total 185436
drwxr-xr-x  2 ftpwfd  other   34816 Nov 11 19:15 .
drwxr-xr-x  7 ftpwfd  other   743936 Nov 13 13:42 ..
-rw-r--r--  1 ftpwfd  other   114884 Nov 10 19:16 00.00.50.xml
-rw-r--r--  1 ftpwfd  other   110839 Nov 10 19:17 00.01.50.xml
-rw-r--r--  1 ftpwfd  other   109479 Nov 10 19:18 00.02.50.xml

2003-11-12:
total 183828
drwxr-xr-x  2 ftpwfd  other   34816 Nov 12 19:14 .
drwxr-xr-x  7 ftpwfd  other   743936 Nov 13 13:42 ..
-rw-r--r--  1 ftpwfd  other   112996 Nov 11 19:16 00.00.50.xml
-rw-r--r--  1 ftpwfd  other   115982 Nov 11 19:17 00.01.50.xml
-rw-r--r--  1 ftpwfd  other   119591 Nov 11 19:18 00.02.50.xml

2003-11-13:
total 120172
drwxr-xr-x  2 ftpwfd  other   26624 Nov 13 13:41 .
drwxr-xr-x  7 ftpwfd  other   743936 Nov 13 13:42 ..
-rw-r--r--  1 ftpwfd  other   119701 Nov 12 19:15 00.00.50.xml
-rw-r--r--  1 ftpwfd  other   122014 Nov 12 19:16 00.01.50.xml
-rw-r--r--  1 ftpwfd  other   118441 Nov 12 19:17 00.02.50.xml

11/13/2003 1:53:45 PM Sent ->CWD /usr/local/apache-2.0.47/htdocs/Data/Tracks
...
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 13, 2003 2:10 PM

I'm curious why you say, "I hope this helps". The point of my previous post was to acknowledge that problem was recorded and I was giving you the workaround. Was there something else you wanted to report?

Also, the listing you just posted is different from the one you posted before. The group and owner fields are there.


larryaasen

From: Herndon, VA USA
Posts: 14
Member Since: 10/24/03
posted November 14, 2003 9:05 AM

I was trying to provide additional information for analysis of the problem. What I provided earlier was the WS_FTP Pro listing, which may be different from the your component listing. So, I upgraded the component and I provided the listing returned from your component so you would have a more accurate picture of my problem.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 14, 2003 9:12 AM

Oh ok, thanks. So you are saying that with the latest DLLs, the type of that listing is Unknown?

larryaasen

From: Herndon, VA USA
Posts: 14
Member Since: 10/24/03
posted November 14, 2003 11:06 AM

I checked the listing format and it came back DOS instead of Unix. There are hundreds of files in about 3 directories so I printed out the ToString length. Here is my output:

11/14/2003 10:56:52 AM ftp1.List
11/14/2003 10:56:52 AM Sent ->PASV
11/14/2003 10:56:52 AM Rec -->227 Entering Passive Mode (172,27,173,195,193,107)
11/14/2003 10:56:52 AM Sent ->LIST *
11/14/2003 10:56:52 AM Rec -->150 ASCII data connection for /bin/ls (172.27.66.42,4629) (0 bytes).
11/14/2003 10:56:52 AM Rec -->226 ASCII Transfer complete.
11/14/2003 10:56:53 AM Listing.Count=0
11/14/2003 10:56:53 AM Listing.Format=DOS
11/14/2003 10:56:53 AM Listing.ToString().Length=154510
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 14, 2003 11:38 AM

I'm working on why this is failing. However, I don't have anything to offer you to test with yet. For now you will have to parse the Listing manually to get the file names.
Reply | PowerTCP FTP for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX