lucasmotta / dploy

⛔️ currently unmaintained ⛔️
http://lucasmotta.github.io/dploy/
MIT License
990 stars 90 forks source link

Upload fails if folder already exists #35

Open straight-shoota opened 10 years ago

straight-shoota commented 10 years ago

I tried to update a project which had already been uploaded to the ftp server before manually. During the upload process dploy caught itself in an infinite loop.

This is caused by the fact that Deploy.checkBeforeUpload silently ignores the error that mkdir returns if a directory already exists. The file in question therefore stays in the upload queue and never gets uploaded.

As far as I can tell, this behavior regarding existing directories could easily be fixed by checking if the error message says "File exists" and if so, set the folder as created. But it would probably be a good idea to react to other errors that could occur in this place too, to prevent dploy from running in a never ending loop.

lucasmotta commented 10 years ago

Are you using FTP or SFTP? I ran a few tests on a FTP server to create directories on top of already pre-existing directories and I didn't get any errors... Can you give me a bit more details of your setup? And it's a bit hard to work with the error messages, because they are not all well documented and I can't reproduce all possible errors :(

straight-shoota commented 10 years ago

I'm using FTP and tried it on two different servers, each with pre-existing directories. Unfortunately I can't tell which ftp server they are running. Both times the files in the root directory were uploaded and then nothing else happened. An investigation showed that the callback for mkdir recieved an error object code 550 and message ": File exists".

Of course it's not possible to have every possible error covered. Any command might produce any kind of error that is probably not expectable. But since an error in the mkdir callback puts the total upload process on hold I suggest at least handling errors at that point in a way that allows anything else to proceed as intended and/or give the user a hint on why its not working.

ghost commented 10 years ago

Running across the same issue attempting to make directories that already exist with pure-ftp. If you could output an error message that would be helpful.