How to ignore SessionRemoteException

Advertisement

Guest

How to ignore SessionRemoteException

Hi,

I have a script in powershell to synchronize to server but i receive this error :
WinSCP.SessionRemoteException: Error listing directory '/System Volume Information'. ---> WinSCP.SessionRemoteException: Permission denied.
Error code: 3
Error message from server: Permission denied
   --- End of inner exception stack trace ---

Is it possible to ignore this type of error and continue to other directory ?

Thanks Regards
Stephane

Reply with quote

Advertisement

Stephane Tinseau
Joined:
Posts:
7
Location:
Paris

Hi,

I have successfully ignore this folder with adding the folder name in FileMask options parameter.

$transferOptions.FileMask = "|*.log; *.7z; *.zip; *.ric; *.pag; */System Volume Information/; */`$RECYCLE.BIN/"

But the issue still present with this other error

(f);WinSCP.SessionRemoteException: Terminated by user. ---> WinSCP.SessionRemoteException: Error listing directory '/dir1/dir2/file1'.
Error deleting file '/dir1/dir2/file1'.
   --- End of inner exception stack trace ---

I think it's again a permission issue but i can't manage all of them.
So the first question is still available:
How to catch these error without stop the copy.

Thanks
Regards
Stephane

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,426
Location:
Prague, Czechia

There's no way to ignore "all errors".
_________________
Martin Prikryl

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,426
Location:
Prague, Czechia

I'm not sure about a cause of the error. Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate 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.
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum