FTP bug in 3.20.0 logic
Posted: Sun 28 Aug 2022 5:49 pm
My webhosting server has a very old version of FTP that requires a delete of the file before uploading a new file (rename to a file that already exists generates an error). Recently I upgraded to 3.20.0. (I was running the prior release for less than a week in production so I don't know if this bug existed earlier.)
All works well, unless there is an upload error which results in the new file NOT making it to the server. Occasionally (perhaps once every few days) an upload will fail due to a "connection closed" error. This results in no file on the server. Typically this happens to a file that is uploaded very frequently like realtimegauges.txt, but I've also observed it with other files such as websitedata.json.
When the upload fails I get an error that says: Error uploading web/realtimegauges.txt to /realtimegauges.txt : Error while uploading the file to the server. See InnerException for more information.
Inner Exception: Connection closed; aborted transfer of ""
Process Complete
When this happens the destination file does not exist, due to the upload error. The next time CMX tries to upload the file, it first tries to delete the file (due the need to do so if the file exists). The bug is that when the delete fails because the file does not exist, CMX gives up and does not try to upload the file....this repeats forever until I manually copy the file to the server, then things return to normal.
If CMX tries to delete a file on the server before uploading a replacement, it should NOT give up if the delete fails. It should try to upload the file anyway.
All works well, unless there is an upload error which results in the new file NOT making it to the server. Occasionally (perhaps once every few days) an upload will fail due to a "connection closed" error. This results in no file on the server. Typically this happens to a file that is uploaded very frequently like realtimegauges.txt, but I've also observed it with other files such as websitedata.json.
When the upload fails I get an error that says: Error uploading web/realtimegauges.txt to /realtimegauges.txt : Error while uploading the file to the server. See InnerException for more information.
Inner Exception: Connection closed; aborted transfer of ""
Process Complete
When this happens the destination file does not exist, due to the upload error. The next time CMX tries to upload the file, it first tries to delete the file (due the need to do so if the file exists). The bug is that when the delete fails because the file does not exist, CMX gives up and does not try to upload the file....this repeats forever until I manually copy the file to the server, then things return to normal.
If CMX tries to delete a file on the server before uploading a replacement, it should NOT give up if the delete fails. It should try to upload the file anyway.