There are three main reasons for the 421 in the reply to the PASV command:
- The server has a too narrow passive mode port range configured
- There is a general exhaustion of ports on the server system
- Some firewall is interfering with creating the listen socket
Apart from this there are two oddities:
The client always sends _both_ PASV and PORT, first switching to passive mode only to immediately switch back to active mode. That's just pointless.
The client uses the ABOR command. The semantics of the ABOR command are ill-defined by the FTP specifications, it should not be used by modern clients. Modern clients if they wish to abort should simply close the connection.
Explanation for the ABOR issue: In FTP there must be exactly one reply for every command. The exception is the ABOR command which aborts any previous command, skipping its reply. The problem is that ABOR can be issued after the reply to the prior command has already been sent but not yet received by the client. The client thus does not know whether there will be one or two replies to receive after sending ABOR, screwing up FTP's command-reply sequence if it takes the wrong guess. The only way to prevent this is to stay idle for a long time to ensure there's no outstanding reply, but even that is no guarantee as it may take minutes for the reply to reach the client, e.g. under very high system load. Thus ABOR should be avoided at all costs.