locked
FTP: 501 server cannot accept argument RRS feed

  • Question

  • User639188962 posted

    Okay I have tried all the articles, blogs, and posts but nothing seems to solve anything. I have iis7 with FTP 7.5 and a ftp site created. my router points all request on ports 20-22 to the server and the ports are open on the firewall (even tried disabling the firewall) I've also gone thru the ftp firewall support. I have a network location to the ftp site and when opened it prompts for user name and password which I enter host|username it accepts and errors out with the 501 server cannot accept argument. How do you get this to work? any help will be appreciated

    Saturday, May 23, 2009 5:43 PM

All replies

  • User690216013 posted

    Please check explanation on 501 from here,

    http://support.microsoft.com/kb/318380

    I can understand that you checked a lot of materials, but did you ever check FTP protocol itself, which explains every details.

    In your case, I suggest you install Network Monitor or Wireshark to capture conversation between the client and the server, then based on the protocol itself it will not be hard to figure what command is sent to the server and triggers this 501 error.

    Saturday, May 23, 2009 9:19 PM
  • User639188962 posted

    I download Wireshark

    172 21.983091 192.168.1.111 **.***.**.** FTP Request: PORT 192,168,1,111,193,230

    is what was sent just before the 501 cannot accept argumnet.

    Saturday, May 23, 2009 9:39 PM
  • User690216013 posted

    PORT command means your FTP client uses Active mode for the conversation. Can you check if this mode is supported by your client side firewall rules and so on.

    For example, the above PORT command indicates your client side opened port 49638 and waited for the server to connect to. If there is a firewall rule that blocks the server from connecting, such an error can happen.

    The following KB contains more technical information you may need,

    http://support.microsoft.com/kb/283679

    Saturday, May 23, 2009 11:25 PM
  • User639188962 posted

    I've been trying this on the server itself, and have even tried it with the firwall turned off with the same results. and port 49638 is within the range i have set in my router

    Saturday, May 23, 2009 11:42 PM
  • User690216013 posted

    So what about passive mode? Is it working? Most clients now use passive mode.

    If you really need active mode, contact Microsoft support and open a case. We have experts that can help.

    http://support.microsoft.com

    Sunday, May 24, 2009 2:05 AM
  • User639188962 posted

    If i try from another computer i get the entering passive and then nothing.

    Sunday, May 24, 2009 1:05 PM
  • User639188962 posted

    I now got it to the point of 227 entering passive mode.

    I have firewall turned off and the port range set in the router

    still cannot access directory

    Monday, May 25, 2009 12:16 AM
  • User-1157530656 posted

     Did you ever get this to work? I have the same problem. All the online info I found so far have many assumptions that do not help solve the problem.

    Friday, October 29, 2010 4:10 AM
  • User33089778 posted
    Windows Server 2008 R2, IIS 7.5 I am also getting this message when using SSL, without SSL it works fine. The first log which follows is with no SSL which works, and the second is with Explicit SSL which fails with the 501 error. Can anyone explain this as it's certainly not a port problem as the first connection works just fine.
    [1st Log: No SSL]
    220 Microsoft FTP Service
    USER FtpTestUser
    331 Password required for FtpTestUser.
    PASS *******
    230 User logged in.
    SYST
    215 Windows_NT
    FEAT
    211-Extended features supported:
     LANG EN*
     UTF8
     AUTH TLS;TLS-C;SSL;TLS-P;
     PBSZ
     PROT C;P;
     CCC
     HOST
     SIZE
     MDTM
     REST STREAM
    211 END
    OPTS UTF8 ON
    200 OPTS UTF8 command successful - UTF8 encoding now ON.
    Connected
    --------------------------------------------------------------------------
    Using FTP protocol.
    Doing startup conversation with host.
    PWD
    257 "/" is current directory.
    Getting current directory name.
    Retrieving directory listing...
    TYPE A
    200 Type set to A.
    PORT 192,168,0,4,231,4
    200 PORT command successful.
    LIST -a
    125 Data connection already open; Transfer starting.
    226 Transfer complete.
    Directory listing successful
    Startup conversation with host finished.
    
    
    [2nd Log: Explicit SSL]
    220 Microsoft FTP Service
    AUTH SSL
    234 AUTH command ok. Expecting TLS Negotiation.
    SSL connection established. Waiting for welcome message...
    USER FtpTestUser
    331 Password required for FtpTestUser.
    PASS *******
    230 User logged in.
    SYST
    215 Windows_NT
    FEAT
    211-Extended features supported:
     LANG EN*
     UTF8
     AUTH TLS;TLS-C;SSL;TLS-P;
     PBSZ
     PROT C;P;
     CCC
     HOST
     SIZE
     MDTM
     REST STREAM
    211 END
    OPTS UTF8 ON
    200 OPTS UTF8 command successful - UTF8 encoding now ON.
    PBSZ 0
    200 PBSZ command successful.
    PROT P
    200 PROT command successful.
    Connected
    --------------------------------------------------------------------------
    Using FTP protocol.
    Doing startup conversation with host.
    PWD
    257 "/" is current directory.
    Getting current directory name.
    Retrieving directory listing...
    TYPE A
    200 Type set to A.
    PORT 192,168,0,4,231,10
    501 Server cannot accept argument.
    Could not retrieve directory listing
    Retrieving directory listing...
    TYPE A
    200 Type set to A.
    PORT 192,168,0,4,231,11
    501 Server cannot accept argument.
    Could not retrieve directory listing
    (ECommand) Error listing directory '/'.
    Could not retrieve directory listing
    Server cannot accept argument.
    Startup conversation with host finished.
    
    Monday, November 1, 2010 9:51 PM
  • User33089778 posted
    1: If there is a firewall involved server side check what ports are allowed for FTP Passive mode
    2: In IIS set "Data Channel Port Range" under "FTP Firewall Support" to the passive port range gleamed from step 1 (normally this is 49152-65535) (Click on the server not the FTP Site to set the port range)
    3: Check the passive port range is actually in effect by opening a command prompt and typing:
    netsh int ipv4 show dynamicport tcp
    If the range is not as it should be then adjust it with:
    netsh int ipv4 set dynamicport tcp <Start Port> <number of ports> persistent
    (for the default 49152-65535 this would be 49152 16383)
    4: Set your FTP client to use Passive mode

    I think the reason for using Passive mode is, with FTP Active mode your router firewall or whatever is expected to find out which port you are using from inspecting the FTP traffic, it cannot do this if the control channel is encrypted so I think you have to use Passive mode FTP.

    The problem came when I changed the Passive mode Data Channel Port Range under "FTP Firewall Support" to the silly range the ISP had set up 20000-21000 and it didn't actually update the the ftp server.
    Tuesday, November 2, 2010 9:00 AM
  • User1968158477 posted
    You've just saved my skin. For some reason instead of this:- (for the default 49152-65535 this would be 49152 16383) I had:- (for the default 49152-65536 this would be 49152 16384) I think my initial dynamic port was blocked by my firewall. If you are struggling try connecting with two connections logging in at the same time. You may notice that the second connection logs in fine meaning maybe your firewall is blocking initial connections. Thanks chap I can now open up sites using sftp in VS2010... joy! I found FileZilla client helped me get a load of ftp chatter I could work with. ;)
    Thursday, April 21, 2011 1:10 PM