Scripted SFTP fails with Cannot Overwrite Remote File

Advertisement

pixel1138
Joined:
Posts:
2
Location:
West Virginia

Scripted SFTP fails with Cannot Overwrite Remote File

WinSCP version: 5.1.0
Windows version: Windows XP SP3
SFTP protocol version: SFTP-4
SFTP Server: WS_FTP 7.5.1.2
Authentication: Both key and password

Error Message: Cannot overwrite remote file '/users/home/generic_filename.pdf.filepart'.

Press 'Delete' to delete the file and create new one instead of overwriting it.
General failure (server should provide error description).
Error code: 4
Error message from server: Failed to open local file
Request code: 3

I have a VBScript that runs every hour and uploads pdf files. 80% of the time, it works with no problems. The rest of the time it fails on a random one of the files with the above error message. After that happens, the script will not upload any more files behind the failed file until the .filepart of the offending file is deleted on the server.

The command line used: winscp.exe /script="upload.txt" /log="log.xml"
Upload.txt reads:
option batch abort
option confirm off
open username@ftp.example.com
put C:\Local_Directory\*.pdf /users/home/ -delete -nopreservetime
exit

I have had WS_FTP Support look at the server side of the transfer and they say it rests on the client side. I am at a loss as to the cause considering that it doesn't always happen. Plus, I've never been able to recreate the error when using the GUI. Any help would be appreciated, and I can provide the xml log generated from the script, as well as the server log. I can't post them here, but I would be more than happy to email them to you.

Thank you

Reply with quote

Advertisement

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

Re: Scripted SFTP fails with Cannot Overwrite Remote File

Any chance that two instances of the script happen to run at the same time?

If not, please attach complete log file.

Reply with quote

pixel1138

No, it runs hourly, and the files are not that large, plus the timeout on the server is not set high enough to cause an overlap from the previous instance. I'll email you the logs. Thank you.

Reply with quote

martin
Site Admin
martin avatar

I have checked the logs. But there's nothing I can help you with. It's the server who's failing to open the file (Error message from server: Failed to open local file).

Reply with quote

Advertisement

You can post new topics in this forum