Search code examples
ftpfilezillaftp-server

Is an FTP error (503 Bad sequence of commands) the result of a client issue or a server issue


I have an FTP server running on an AWS virtual server. We have about 100 users connecting to it over the course of a day, uploading images and other files. All but one are working perfectly. Files come in, not a problem.

We have 1 single user that causes the following log lines to be generated - the username and IP has been removed intentionally and the "***" has been added to highlight the error line:

> 227 Entering Passive Mode (54,79,122,6,195,96)
> STOR media/UV1358A_3.jpg
> 150 Opening data channel for file upload to server of "/media/UV1358A_3.jpg"
> 226 Successfully transferred "/media/UV1358A_3.jpg"
> PASV
> 227 Entering Passive Mode (54,79,122,6,195,141)
> STOR media/UV1358A_4.jpg
> 150 Opening data channel for file upload to server of "/media/UV1358A_4.jpg"
> PASV
> 227 Entering Passive Mode (54,79,122,6,195,136)
> 226 Successfully transferred ""
> STOR media/UV1358A_5.jpg
***********************************************
> 503 Bad sequence of commands.
***********************************************
> PASV
> 227 Entering Passive Mode (54,79,122,6,195,80)
> PORT 122,99,115,5,212,227
> 200 Port command successful
> PORT 122,99,115,5,226,227
> 200 Port command successful
> PORT 122,99,115,5,130,124
> 200 Port command successful
> STOR media/UV1358A_9.jpg
> 150 Opening data channel for file upload to server of "/media/UV1358A_9.jpg"
> PORT 122,99,115,5,152,62
> 200 Port command successful
> STOR media/UV1358A_10.jpg
> 150 Opening data channel for file upload to server of "/media/UV1358A_10.jpg"
> PORT 122,99,115,5,161,49
> 200 Port command successful

We're using FileZilla Server 0.9.55 on a Windows 2012 box.

My question, as stated in the title is essentially.. Is this our issue on the server end, or is this theirs? Is this 503 error always caused by the FTP client screwing something up or is there the possibility that the FTP server is interpreting something wrongly?

I'm happy to go back to the customer and say "It is our issue", but I suspect it's not at our end.

Thanks


Solution

  • The client sends the PASV command to initiate another file transfer before waiting for the previous transfer (the STOR command) to be finished (226 response):


    The first transfer starts:

    > PASV
    < 227 Entering Passive Mode (54,79,122,6,195,141)
    > STOR media/UV1358A_4.jpg
    < 150 Opening data channel for file upload to server of "/media/UV1358A_4.jpg"
    

    The PASV command for another transfer before the first transfer finished:

    > PASV
    < 227 Entering Passive Mode (54,79,122,6,195,136)
    

    The first transfer finishes only now. The filename in the message is missing, because the FileZilla Server resets a file transfer data (including the file name) upon processing of the out-of-order PASV command (it actually should have better rejected the PASV command already with the 503).

    > 226 Successfully transferred ""
    

    A request for the another transfer. It fails because the FileZilla server forgets the out-of-order PASV command upon completion of the first file transfer.

    > STOR media/UV1358A_5.jpg
    < 503 Bad sequence of commands.