Error condition remote serve file 'in use'

Advertisement

Philky001
Donor
Joined:
Posts:
20

Error condition remote serve file 'in use'

HI I got this error: it seems the file trying to delete was in use. How would you explain this happening, since we only use the batch process now?

Is only explanation that someone was looking at this order at the moment the batch process was running?

Going further, what would you do to code to fix this issue?


Looping for WALMART
File Path \\SERVER-W02\ARCUST\IBS\DATA\ORDERS\WALMART\
File Tranfer successful from /outgoing/orders/WALMART//1277157481.md.neworders to \\SERVER-W02\ARCUST\IBS\DATA\ORDERS\WALMART\1277157481.md.neworders
Error Occurse:WinSCP.SessionRemoteException: Error deleting file '/outgoing/orders/WALMART/1277172050.md.neworders'. ---> WinSCP.SessionRemoteException: Permission denied.
Error code: 3
Error message
from server: Failed to delete file /outgoing/orders/WALMART/1277172050.md.neworders: The process cannot access the file
'\\COMPLETEFTPFS01\sftp_share\sftp_fs\outgoing\orders\WALMART\1277172050.md.neworders' because it is being used by another process.



--- End of inner exception stack trace ---
at WinSCP.OperationResultBase.Check()
at SFTPGetConsole.Program.Main()

Reply with quote

Advertisement

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

Re: Error condition remote serve file 'in use'

Well, we can hardly explain that.
We do not know anything about your server.

Is it happening always, with some files, randomly, ...?

Reply with quote

Philky001
Donor
Joined:
Posts:
20

on the scp getfiles - can it have the delete portion put on a slight delay
or something like

session.GetFiles(RemotePath + "/" + fileInfo.Name, LocalPath + fileInfo.Name, ).Check();
// make some time delay for 5 seconds.

// now run to delete
session.GetFiles(RemotePath + "/" + fileInfo.Name, LocalPath + fileInfo.Name, true).Check();

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Call the Session.GetFiles without the "remove" flag, wait 5 seconds, and then iterate the list of downloaded files returned by the function, calling Session.RemoveFiles for each.

Reply with quote

hyptechdev@...
Guest

thank you

martin wrote:

Call the Session.GetFiles without the "remove" flag, wait 5 seconds, and then iterate the list of downloaded files returned by the function, calling Session.RemoveFiles for each.

thank you, this solution works

Reply with quote

Advertisement

You can post new topics in this forum