0
votes

We developed an ftp file upload application using c# The application has worked flawlessly for a long time. For past few days, user reported that he got an error "The remote server returned an error: (550) File unavailable (e.g., file not found, no access)." We quite surprised as we do not make any changing in the coding and environment.

This error is pop out by

   WebRequest request = WebRequest.Create(directoryPath);
    request.Method = WebRequestMethods.Ftp.MakeDirectory;
    request.Credentials = new NetworkCredential(ftpUser, ftpPassword);
    using (var resp = (FtpWebResponse)request.GetResponse())
    {
        resp.Close();
    }

So we do some testing to try to figure out the issue

  1. Use filezilla to create a directory ,it works fine.
  2. Create a directory through window explorer, it works fine too

we found that if we delete some directory with files from ftp directory ,it will resumed normal, user can upload an file through the c# ftp upload application again.

I guess if the ftp can set the max no of directory or file, if the no of directory reach the setting ,it will close the connection

Finally we try to use Wireshark to see the ftp packet. And found an info that the different between the normal ftp packet and unnormal ftp packet is "Response: 550 The specified network name is no longer available. "

Normal ftp packet Response: 250 CWD command successful. Request: PASV Response: 227 Entering Passive Mode (172,25,230,110,212,41). Request: NLST OAP Response: 125 Data connection already open; Transfer starting. Response: 226 Transfer complete. Request: CWD / Response: 250 CWD command successful.

unnormal ftp packet Response: 250 CWD command successful. Request: PASV Response: 227 Entering Passive Mode (172,25,230,110,201,251). Request: NLST OAP Response: 125 Data connection already open; Transfer starting. Response: 550 The specified network name is no longer available. Response: 220 Microsoft FTP Service

Does anyone know if the ftp can set the max directory per directory? And help will be appreciated.

2
Show us a full FtpWebRequest log (or a Wireshark capture) showing a failure and full (and verbose) FileZilla log file showing a success with the same operation, both from the same moment.Martin Prikryl
I got the same error performing a upload. I resolved by setting proxy property to null. Default is null, but somehow, change the internal state.MiguelSlv

2 Answers

0
votes

MSDN seems to suggest that your path is considered relative, and therefore it tries to log in to the FTP server using the supplied credentials, then sets the current directory to the /path directory. If this isn't the same directory where your file is, you'll get a 550 error.

0
votes

Apparently this could also be from antivirus interference.

We have done some additional testing so I figured I would come back with an update. Ever since I disabled AVG's resident shield we stopped receiving the error message

and

This was happening to me between VPN locations. The SonicWALL had Gateway Antivirus turned on and it was blocking CIFS/Netbios communication. I just turned that portion of the Gateway AV off. Works now.

https://community.spiceworks.com/topic/239423-the-specified-network-name-is-no-longer-available-while-writing-to-shared-dir