I have been obtaining errors like below because I did not specify enough ports for the active FTP connections.
Response: 150 Opening data channel for directory list.
Response: 425 Can't open data connection.Error: Failed to retrieve directory listing
Things seem to work nicely with limited ports, but when I perform actions that cause very rapid short-lived connections, something like 20-30% of the connections drop with the error above.
I started with ports 50000-50100.
When I opened up to 50000-52000, the errors disappeared.
Why did this fix my problem? I would like to understand why adding ports fixed it.
I have a suspicion that ports become "locked down" for a few moments surrounding when they are used in a connection. If connections are happening so rapidly, there may be no ports available, thus the above error.
Can anybody confirm?