Empty File after Upload

Advertisement

MPrimeur
Joined:
Posts:
3
Location:
Germany

Empty File after Upload

Hello,

The following problem is quite rare on some Windows PCs: 10 to 15 text files are transferred to an FTP server using WinSCP at a time. Sometimes a file of it is on the FTP with no content. The file arrives empty on the server.
Here is an excerpt from the WinSCP log:

This file has a content and arrived empty on the server (Error 550):
. 2024-02-02 11:24:28.007 File: "WY240202001501402E01.json"
. 2024-02-02 11:24:28.008 Copying "WY240202001501402E01.json" to remote directory started.
. 2024-02-02 11:24:28.009 Binary transfer mode selected.
. 2024-02-02 11:24:28.009 Beginne WY240202001501402E01.json heraufzuladen
> 2024-02-02 11:24:28.010 TYPE I
< 2024-02-02 11:24:28.685 200 Type set to I
> 2024-02-02 11:24:28.685 PASV
< 2024-02-02 11:24:29.431 227 Entering Passive Mode (195,160,230,202,199,115).
> 2024-02-02 11:24:29.432 STOR WY240202001501402E01.json
< 2024-02-02 11:24:31.006 150 Opening BINARY mode data connection for WY240202001501402E01.json
< 2024-02-02 11:24:32.107 226 Transfer complete
> 2024-02-02 11:24:32.108 MFMT 20240202094751 WY240202001501402E01.json
< 2024-02-02 11:24:32.972 550 WY240202001501402E01.json: No such file or directory
. 2024-02-02 11:24:32.972 Heraufladen erfolgreich
This file has a content and arrived with Content on the server:
. 2024-02-02 11:24:32.974 File: "WY240202001601402E01.json"
. 2024-02-02 11:24:32.975 Copying "WY240202001601402E01.json" to remote directory started.
. 2024-02-02 11:24:32.976 Binary transfer mode selected.
. 2024-02-02 11:24:32.976 Beginne WY240202001601402E01.json heraufzuladen
> 2024-02-02 11:24:32.977 TYPE I
< 2024-02-02 11:24:33.522 200 Type set to I
> 2024-02-02 11:24:33.522 PASV
< 2024-02-02 11:24:33.988 227 Entering Passive Mode (195,160,230,202,246,5).
> 2024-02-02 11:24:33.989 STOR WY240202001601402E01.json
< 2024-02-02 11:24:34.975 150 Opening BINARY mode data connection for WY240202001601402E01.json
< 2024-02-02 11:24:35.489 226 Transfer complete
> 2024-02-02 11:24:35.489 MFMT 20240202095232 WY240202001601402E01.json
< 2024-02-02 11:24:36.013 213 Modify=20240202095232; WY240202001601402E01.json
. 2024-02-02 11:24:36.013 Heraufladen erfolgreich
This file has a content and arrived with Content on the server (but Error 550):
. 2024-02-02 11:24:45.486 File: "WY240202002001402E01.json"
. 2024-02-02 11:24:45.488 Copying "WY240202002001402E01.json" to remote directory started.
. 2024-02-02 11:24:45.488 Binary transfer mode selected.
. 2024-02-02 11:24:45.488 Beginne WY240202002001402E01.json heraufzuladen
> 2024-02-02 11:24:45.489 TYPE I
< 2024-02-02 11:24:45.952 200 Type set to I
> 2024-02-02 11:24:45.952 PASV
< 2024-02-02 11:24:46.452 227 Entering Passive Mode (195,160,230,202,243,220).
> 2024-02-02 11:24:46.452 STOR WY240202002001402E01.json
< 2024-02-02 11:24:47.518 150 Opening BINARY mode data connection for WY240202002001402E01.json
< 2024-02-02 11:24:48.140 226 Transfer complete
> 2024-02-02 11:24:48.140 MFMT 20240202102254 WY240202002001402E01.json
< 2024-02-02 11:24:48.872 550 WY240202002001402E01.json: No such file or directory
. 2024-02-02 11:24:48.872 Heraufladen erfolgreich
When a file arrives on the server with no content, the Error 550 occurs. Is the problem known? Are there any settings to ensure that the files have been transferred correctly (with content, complete) to the server?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Empty File after Upload

I do not think this is WinSCP problem. It's rather the server.

Also you possibly have two distinct problems (the 550 and the empty file). Though they might be related to some extent.

The 550 error happens likely because the server takes the uploaded file away for (or after) some processing. So when WinSCP tries to update timestamp of the uploaded file and the server managed to more the file away already, the timestamp update fails. You can "solve" that by disabling timestamp update. See Upload of file .. was successful, but error occurred while setting the permissions and/or timestamp. If the problem persists, turn off setting permissions or preserving timestamp. Alternatively you can turn on ‘Ignore permission errors’ option.

Regarding the empty upload: From WinSCP perspective, the upload was successful. Though you have trimmed the log too much, so I cannot tell, if WinSCP saw the file as empty or not. Post a complete log. Anyway, see Why are all uploaded files empty? Another possibility is that the "move", mentioned above, is badly implemented on the server and it happens in a middle of the upload, leading to a file corruption.

Reply with quote

Advertisement

You can post new topics in this forum