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

cloudify

File permisson error when doing file sync to a SFTP using winscp assembly

Hi,

I am using winscp .net assembly in powershell for file synchronization with a SFTP server. I am using the following code for synchronization:

https://winscp.net/eng/docs/library_session_synchronizedirectories#powershell

Problem is, when this script sync files through upload to SFTP it generates error, although it actually uploads the file. The script gets terminated immediately with the following error:

------------------------------------------------------


Upload of C:\FileSync\files\test2.txt succeeded
Permissions of /Reports/test2.txt kept with their defaults
Setting timestamp of /Reports/test2.txt failed: WinSCP.SessionRemoteException: Upload of file 'test2.txt' 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. ---> WinSCP.SessionRemoteException: The server does not support the operation.
Error code: 8
Error message from server: SSHServerAPI.SFTP.fxp_attrs
--- End of inner exception stack trace ---
**Upload of file 'test2.txt' 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.
------------------------------------------------------

I am not finding any way how to "ignore permission error" as it's suggested in the errors.

The script does not complain when do the sync through downloading files from SFTP.

Any help please?