Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Error Code 4 - Just started today

It looks like you are trying move files from SFTP server to local folder.

You cannot use mv command for that. The mv command can move remote files to another remote folder only. This could have never worked.

You have to use get -delete.
https://winscp.net/eng/docs/scriptcommand_get
sniper-187

Error Code 4 - Just started today

We are using version 5.9.5 using the sFTP protocol on a Windows 2012 server. I am running a .bat file using the windows task scheduler. Yesterday we were able to move the files from the remote server to the target server with out any issues. Today, we started getting Error Code 4. I checked and the AD user has full control of the target folder. There are no files in the folder when running the .bat file. Disk quota's are not enabled for this drive.

Below is the information from the .bat file (minus the connection information)

@echo off

"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="E:\WinscpLog\WinSCP.log" /ini=nul ^
/command ^
"Connection informaiton here:^
"cd /Files" ^
"mv *.pftap E:\Incoming\" ^
"mv *.scap E:\Incoming\" ^
"mv *.scgl E:\Incoming\" ^
"mv *.pftgl E:\Incoming\" ^
"exit"

set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)

exit /b %WINSCP_RESULT%


Here is the log message:



> 2017-05-16 10:43:26.647 Script: mv *.scgl E:\Incoming\
. 2017-05-16 10:43:26.647 Listing directory "/Files".
> 2017-05-16 10:43:26.647 Type: SSH_FXP_OPENDIR, Size: 19, Number: 2827
< 2017-05-16 10:43:26.676 Type: SSH_FXP_STATUS, Size: 47, Number: 2316
. 2017-05-16 10:43:26.676 Discarding reserved response
< 2017-05-16 10:43:26.706 Type: SSH_FXP_STATUS, Size: 17, Number: 2564
. 2017-05-16 10:43:26.706 Discarding reserved response
< 2017-05-16 10:43:26.706 Type: SSH_FXP_HANDLE, Size: 11, Number: 2827
> 2017-05-16 10:43:26.706 Type: SSH_FXP_READDIR, Size: 11, Number: 3084
< 2017-05-16 10:43:26.736 Type: SSH_FXP_NAME, Size: 545, Number: 3084
> 2017-05-16 10:43:26.736 Type: SSH_FXP_READDIR, Size: 11, Number: 3340
> 2017-05-16 10:43:26.736 Type: SSH_FXP_CLOSE, Size: 11, Number: 3588
. 2017-05-16 10:43:26.737 .;D;0;2017-05-16T14:43:26.736Z;3;"" [0];"" [0];rwxrwx---;0
. 2017-05-16 10:43:26.737 ..;D;0;2017-05-16T14:43:26.736Z;3;"" [0];"" [0];rwxrwx---;0
. 2017-05-16 10:43:26.737 Archive;D;0;2017-05-15T21:33:07.000Z;3;"" [0];"" [0];rwxrwx---;0
. 2017-05-16 10:43:26.737 brcm_fw_nic_17.0.4.5a_linux_32-64.bin;-;4866048;2017-05-10T19:21:09.000Z;3;"" [0];"" [0];rw-rw----;0
. 2017-05-16 10:43:26.737 ECMC_KS_20170516_1584955.scgl;-;23134;2017-05-16T06:00:18.000Z;3;"" [0];"" [0];rw-rw----;0
. 2017-05-16 10:43:26.737 ECMC_KS_20170516_1584965.pftgl;-;4176;2017-05-16T07:00:14.000Z;3;"" [0];"" [0];rw-rw----;0
. 2017-05-16 10:43:26.737 TB;D;0;2017-05-16T14:16:28.000Z;3;"" [0];"" [0];rwxrwx---;0
. 2017-05-16 10:43:26.737 Moving file "ECMC_KS_20170516_1584955.scgl" to "E:Incoming".
> 2017-05-16 10:43:26.737 Type: SSH_FXP_RENAME, Size: 84, Number: 3858
< 2017-05-16 10:43:26.766 Type: SSH_FXP_STATUS, Size: 47, Number: 3340
. 2017-05-16 10:43:26.766 Discarding reserved response
< 2017-05-16 10:43:26.796 Type: SSH_FXP_STATUS, Size: 17, Number: 3588
. 2017-05-16 10:43:26.796 Discarding reserved response
< 2017-05-16 10:43:26.796 Type: SSH_FXP_STATUS, Size: 50, Number: 3858
< 2017-05-16 10:43:26.796 Status code: 4, Message: 3858, Server: The requested operation failed., Language: en
. 2017-05-16 10:43:26.796 Asking user:
. 2017-05-16 10:43:26.796 Error moving file 'ECMC_KS_20170516_1584955.scgl' to 'E:Incoming'. ("General failure (server should provide error description).
. 2017-05-16 10:43:26.796 Error code: 4
. 2017-05-16 10:43:26.796 Error message from server (en): The requested operation failed.
. 2017-05-16 10:43:26.796
. 2017-05-16 10:43:26.796 Common reasons for the Error code 4 are:
. 2017-05-16 10:43:26.796 - Renaming a file to a name of already existing file.
. 2017-05-16 10:43:26.796 - Creating a directory that already exists.
. 2017-05-16 10:43:26.796 - Moving a remote file to a different filesystem (HDD).
. 2017-05-16 10:43:26.796 - Uploading a file to a full filesystem (HDD).
. 2017-05-16 10:43:26.796 - Exceeding a user disk quota.")
< 2017-05-16 10:43:26.797 Script: Error moving file 'ECMC_KS_20170516_1584955.scgl' to 'E:Incoming'.
< 2017-05-16 10:43:26.797 Script: General failure (server should provide error description).
< 2017-05-16 10:43:26.797 Error code: 4
< 2017-05-16 10:43:26.797 Error message from server (en): The requested operation failed.
< 2017-05-16 10:43:26.797 Common reasons for the Error code 4 are:
< 2017-05-16 10:43:26.797 - Renaming a file to a name of already existing file.
< 2017-05-16 10:43:26.797 - Creating a directory that already exists.
< 2017-05-16 10:43:26.797 - Moving a remote file to a different filesystem (HDD).
< 2017-05-16 10:43:26.797 - Uploading a file to a full filesystem (HDD).
< 2017-05-16 10:43:26.797 - Exceeding a user disk quota.
. 2017-05-16 10:43:26.797 Script: Failed
. 2017-05-16 10:43:26.797 Script: Exit code: 1
. 2017-05-16 10:43:26.797 Closing connection.
. 2017-05-16 10:43:26.797 Sending special code: 12
. 2017-05-16 10:43:26.797 Sent EOF message



One thing I noticed is the "\" is missing from the to"E:Incoming".

I tried different target folders, but I am still getting the Error Code 4 error.

Again this worked yesterday, but started failing today. No patches/updates were applied to this server last night.

I am also not sure where to find a description of the error on the server as mentioned in the error message. I checked the even viewer and did not see any errors.


Thoughts?

Thank you.