Error 550 in FTP NLST and solution

Discussion in 'Windows / IIS' started by mapick, Nov 4, 2008.




  1. Hi, I recently migrated to IIS7 and may be I'm wrong, but peraphsI found a little bug I hadn'tin previous version.


    However I report it, in case could help others...


    weuseaPython software that comunicatethorought FTP with our DASP site, in previous IIS6 it worked fine, but in IIS7 we discoverd a bug (as I told before, may be the bug was already present and we didn't find it, however se solution is always good!).


    Trying to use ftplib.FTP.nlst() method to list the files in a directory on server (corresponding to directFTP command NSLT or similar in other languages) it works fine, except when there are no files in the directory. Then it gives the error 'ftplib.error_perm: 550 No files found', and in our case the connession drops down.


    We handled it with a simple try:


    try:
    files = ftp.nlst()
    except ftplib.error_perm, resp:
    if str(resp) == "550 No files found":
    print "Directory is empty."
    else:
    raise

    But ifit's theresponse which comes straight from the server that causes ftplib to raise the error_perm exception, it shouldn't return that kind of
    response which clashes with the RFC-959 standard specification (at least according what I know... always if I'm not wrong...).


    However this is only a little bug and I find new IIS7and in general DASP service realy excellent!!!</BLOCKQUOTE>
     
  2. The 550 error is inRFC-959. Perhaps that Python libraryisnot able to handle the "No files found" part of the error properly and simply just return an emply list.

    Aristotle

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. As I told, probablyitwas mewrong,but that's the problem: when the directory is empty the connection drops down instead returning the empty list, whilebefore migrating to IIS7 it didn't happen, or at least we never noticed it...


    You can testit also directly using ftp commandusing the dos prompt from your PC: if you connect to a ftp address and call a "dir" command no problem, butifthe directory is empty the ftp connection drops down...


    Hi and thanks for your attention
     
  4. I tested through the command prompt and it didn't drop my FTP connection.

    Aristotle

    DiscountASP.NET
    www.DiscountASP.NET
     
  5. Then probably there is something wrong in our settings or similar!


    Thanks for your attention
     

Share This Page