bitrise-steplib / steps-ftp-upload

Bitrise step to upload a single file or a folder to an FTP server
MIT License
4 stars 12 forks source link

Fails to upload when there are files to overwrite (MLSD support) #15

Closed motorro closed 7 years ago

motorro commented 7 years ago

Noticed the issue with FTP uploader since version 2.2.1 I'm uploading to Azure having MS FTP server based on IIS I believe Upload works great if there are no files to overwrite. Here is the log abstract:

+------------------------------------------------------------------------------+
| (0) ftp-upload@2.1.2                                                         |
+------------------------------------------------------------------------------+
| id: ftp-upload                                                               |
| version: 2.1.2                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2017-08-11T02:57:04Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
INFO[02:57:04] Start installing (golang) with apt-get       
INFO[02:57:04]  * [OK] Step dependency (go) installed, available. 

Configs:
- HostName: waws-prod-sn1-107.ftp.azurewebsites.windows.net:21
- Username: ***
- Password: ***
- SourcePath: ./build
- TargetPath: /site/wwwroot

Connecting to server...
Connected

Authenticating user...
2017/08/11 02:57:05 < 220 Microsoft FTP Service
2017/08/11 02:57:05 220 Microsoft FTP Service
2017/08/11 02:57:05 > USER angry-dragon\bitrise
2017/08/11 02:57:05 < 331 Password required
2017/08/11 02:57:05 > PASS UpL0ad3r
2017/08/11 02:57:05 < 230 User logged in.
2017/08/11 02:57:05 > MKD /
Successful

Uploading...
Warning: 550 Access is denied. 

2017/08/11 02:57:05 < 550 Access is denied. 
2017/08/11 02:57:05 > MKD /site
Warning: 550 Cannot create a file when that file already exists. 

2017/08/11 02:57:05 < 550 Cannot create a file when that file already exists. 
2017/08/11 02:57:05 > MKD /site/wwwroot
2017/08/11 02:57:05 < 550 Cannot create a file when that file already exists. 
2017/08/11 02:57:05 > MKD /site/wwwroot
Warning: 550 Cannot create a file when that file already exists. 

2017/08/11 02:57:05 < 550 Cannot create a file when that file already exists. 
Warning: 550 Cannot create a file when that file already exists. 

2017/08/11 02:57:05 > TYPE I
2017/08/11 02:57:05 < 200 Type set to I.
2017/08/11 02:57:05 > PASV
2017/08/11 02:57:05 < 227 Entering Passive Mode (13,84,40,212,39,131).
2017/08/11 02:57:05 > STOR /site/wwwroot/app.bundle.js
2017/08/11 02:57:05 Connecting to waws-prod-sn1-107.ftp.azurewebsites.windows.net:10115
2017/08/11 02:57:05 < 150 Opening BINARY mode data connection.
2017/08/11 02:57:06 < 226 Transfer complete.
2017/08/11 02:57:06 > MKD /site/wwwroot/fonts
2017/08/11 02:57:06 < 257 "/site/wwwroot/fonts" directory created.
2017/08/11 02:57:06 > TYPE I
2017/08/11 02:57:06 < 200 Type set to I.
2017/08/11 02:57:06 > PASV
2017/08/11 02:57:06 < 227 Entering Passive Mode (13,84,40,212,39,132).
2017/08/11 02:57:06 > STOR /site/wwwroot/fonts/din_alternate_bold.ttf
2017/08/11 02:57:06 Connecting to waws-prod-sn1-107.ftp.azurewebsites.windows.net:10116
2017/08/11 02:57:06 < 150 Opening BINARY mode data connection.
2017/08/11 02:57:06 < 226 Transfer complete.
2017/08/11 02:57:06 > MKD /site/wwwroot/img
2017/08/11 02:57:06 < 257 "/site/wwwroot/img" directory created.
2017/08/11 02:57:06 > TYPE I
2017/08/11 02:57:06 < 200 Type set to I.
2017/08/11 02:57:06 > PASV
2017/08/11 02:57:06 < 227 Entering Passive Mode (13,84,40,212,39,133).
2017/08/11 02:57:06 > STOR /site/wwwroot/img/boom.png
2017/08/11 02:57:06 Connecting to waws-prod-sn1-107.ftp.azurewebsites.windows.net:10117
2017/08/11 02:57:06 < 150 Opening BINARY mode data connection.
2017/08/11 02:57:06 < 226 Transfer complete.
2017/08/11 02:57:06 > TYPE I
2017/08/11 02:57:06 < 200 Type set to I.
2017/08/11 02:57:06 > PASV
2017/08/11 02:57:06 < 227 Entering Passive Mode (13,84,40,212,39,134).
2017/08/11 02:57:06 > STOR /site/wwwroot/img/dragon-items.png
2017/08/11 02:57:06 Connecting to waws-prod-sn1-107.ftp.azurewebsites.windows.net:10118
2017/08/11 02:57:07 < 150 Opening BINARY mode data connection.
2017/08/11 02:57:07 < 226 Transfer complete.

If files are already there upload fails:

+------------------------------------------------------------------------------+
| (0) ftp-upload                                                               |
+------------------------------------------------------------------------------+
| id: ftp-upload                                                               |
| version: 2.1.2                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2017-08-11T02:41:52Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
INFO[02:41:52] Start installing (golang) with apt-get       
INFO[02:41:52]  * [OK] Step dependency (go) installed, available. 

Configs:
- HostName: waws-prod-sn1-107.ftp.azurewebsites.windows.net:21
- Username: ***
- Password: ***
- SourcePath: ./build
- TargetPath: /site/wwwroot

Connecting to server...
Connected

Authenticating user...
2017/08/11 02:41:53 < 220 Microsoft FTP Service
2017/08/11 02:41:53 220 Microsoft FTP Service
2017/08/11 02:41:53 > USER angry-dragon\bitrise
2017/08/11 02:41:53 < 331 Password required
2017/08/11 02:41:53 > PASS UpL0ad3r
Successful

Uploading...
2017/08/11 02:41:54 < 230 User logged in.
2017/08/11 02:41:54 > MKD /
Warning: 550 Access is denied. 

2017/08/11 02:41:54 < 550 Access is denied. 
2017/08/11 02:41:54 > MKD /site
Warning: 550 Cannot create a file when that file already exists. 

2017/08/11 02:41:54 < 550 Cannot create a file when that file already exists. 
2017/08/11 02:41:54 > MKD /site/wwwroot
Warning: 550 Cannot create a file when that file already exists. 

2017/08/11 02:41:54 < 550 Cannot create a file when that file already exists. 
2017/08/11 02:41:54 > MKD /site/wwwroot
Warning: 550 Cannot create a file when that file already exists. 

2017/08/11 02:41:54 < 550 Cannot create a file when that file already exists. 
2017/08/11 02:41:54 > TYPE I
2017/08/11 02:41:54 < 200 Type set to I.
2017/08/11 02:41:54 > PASV
2017/08/11 02:41:54 < 227 Entering Passive Mode (13,65,89,174,39,18).
2017/08/11 02:41:54 > STOR /site/wwwroot/app.bundle.js
2017/08/11 02:41:54 Connecting to waws-prod-sn1-107.ftp.azurewebsites.windows.net:10002
2017/08/11 02:41:54 < 150 Opening BINARY mode data connection.
2017/08/11 02:41:54 < 226 Transfer complete.
2017/08/11 02:41:54 > MKD /site/wwwroot/fonts
2017/08/11 02:41:55 < 550 Cannot create a file when that file already exists. 
2017/08/11 02:41:55 > TYPE A
2017/08/11 02:41:55 < 200 Type set to A.
2017/08/11 02:41:55 > PASV
2017/08/11 02:41:55 < 227 Entering Passive Mode (13,65,89,174,39,19).
2017/08/11 02:41:55 > MLSD /site/wwwroot/fonts/
2017/08/11 02:41:55 Connecting to waws-prod-sn1-107.ftp.azurewebsites.windows.net:10003
2017/08/11 02:41:55 < 500 Command not understood.
2017/08/11 02:41:55 > LIST /site/wwwroot/fonts/
Failed to upload files, error: 125 Data connection already open; Transfer starting.

2017/08/11 02:41:55 < 125 Data connection already open; Transfer starting.

There are some reports MS servers do not support MLSD command. May be that's the problem and there is an alternative way?

trapacska commented 7 years ago

Thank you for the report! It will be fixed soon.

trapacska commented 7 years ago

The issue is resolved in the new version: 2.1.3

Thanks @motorro 🚀