SFTP Issue

Advertisement

Gianluca
Joined:
Posts:
3

SFTP Issue

Good Afternoon,
We need your help to properly address some technical issue we are having when copying files on SFTP channel.
We have several flows which moves high number of files on the channel and quite often we are getting error message during the file copy.

As I said, the problem seems to be random, sometimes it could happen after having copied already 2000 files, sometimes it could happen after having copied 100 files, in some other case doesn’t even happen.
Inside the log we have this information:
Answer: Abort
(ESkipFile) **Upload of file 'XXXX.XML' 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.
General failure (server should provide error description).
Error code: 4
Error message from server: failed to set attributes: /Home/XXXX.XML

Common reasons for the Error code 4 are:
- Renaming a file to a name of already existing file.
- Creating a directory that already exists.
- Moving a remote file to a different filesystem (HDD).
- Uploading a file to a full filesystem (HDD).
- Exceeding a user disk quota.
Copying finished: Transferred: 6,923,883, Elapsed: 0:03:03, CPS: 37,655/s
Script: Failed
Script: exit
Script: Exit code: 1
We use this WinSCP Scripting (wsf), below a part:
Set sessionOptions = WScript.CreateObject("WinSCP.SessionOptions")
With sessionOptions
   .Protocol = Protocol_SFtp
   .HostName = "xxxx"
   .UserName = "xxxx"
   .Password = "xxxx"
   .SshHostKeyFingerprint = "xxxx"
End With
 
session.Open sessionOptions
 
transferOptions.TransferMode = TransferMode_Binary
transferOptions.FilePermissions = Nothing
transferOptions.PreserveTimestamp = False
transferOptions.AddRawSettings "IgnorePermErrors", "1"
transferOptions.filemask = "*.xml"
 
Set transferResult = session.PutFiles ("D:\HOME\*.xml", "/HOME/", False, transferOptions)      
session.Close
WinSCP version 6.3.2.14890
OS Windows Server 2016

Thanks in advance
Gianluca

Reply with quote

Advertisement

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

Re: SFTP Issue

Your code sample does not show how you initialize transferOptions variable – do you at all?

Additionally, please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

Gianluca
Joined:
Posts:
3

Hi Martin,
I declare transferOptions as Dim.
<job>
<reference object="WinSCP.Session" />
<script language="VBScript">
 
Dim session, transferOptions, transfer
Set session = WScript.CreateObject("WinSCP.Session")
Inside log I see:
Script: put  -nopermissions -preservetime -transfer="binary" -- "I:\INTERF\SD\PA\*.xml" "/IN/PROD/CustomerInvoice/"
Attached full session log file.

Thanks
Gianluca
  • Session_LOG.txt (336.22 KB, Private file)

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum