Post a reply

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 5

It is not trying to create any directory. It is trying to read the directory you told it to. And the directory does not seem to exist. WinSCP won't create the root directory of the synchronization. It must exist upfront.
StuartJolley

Error Code 5

> 2022-04-06 08:23:30.076 Script: synchronize remote -filemask=*.pdf -delete "D:\TRUST\Reports\2022\04\06\" /EAS-MET/2022/04/06/
< 2022-04-06 08:23:30.091 Script: Comparing...
. 2022-04-06 08:23:30.091 Collecting synchronization list for local directory 'D:\TRUST\Reports\2022\04\06\' and remote directory '/EAS-MET/2022/04/06/', mode = Remote, params = 0x3 (Delete, NoConfirmation), file mask = '*.pdf'
. 2022-04-06 08:23:30.091 Local file 'D:\TRUST\Reports\2022\04\06\.' [2022-04-05T23:00:16.384Z] [0] excluded from synchronization
. 2022-04-06 08:23:30.091 Local file 'D:\TRUST\Reports\2022\04\06\..' [2022-04-05T23:00:16.384Z] [0] excluded from synchronization
. 2022-04-06 08:23:30.091 Local file 'D:\TRUST\Reports\2022\04\06\STATION' [2022-04-06T04:00:25.530Z] [0] included to synchronization
. 2022-04-06 08:23:30.091 Listing directory "/EAS-MET/2022/04/06".
> 2022-04-06 08:23:30.091 Type: SSH_FXP_OPENDIR, Size: 28, Number: 523
< 2022-04-06 08:23:30.091 Type: SSH_FXP_STATUS, Size: 28, Number: 523
< 2022-04-06 08:23:30.091 Status code: 5, Message: 523, Server: Bad message, Language: 
. 2022-04-06 08:23:30.091 Asking user:
. 2022-04-06 08:23:30.091 Error listing directory '/EAS-MET/2022/04/06'. ("Bad message (badly formatted packet or protocol incompatibility).
. 2022-04-06 08:23:30.091 Error code: 5
. 2022-04-06 08:23:30.091 Error message from server: Bad message")
< 2022-04-06 08:23:30.091 Script: Error listing directory '/EAS-MET/2022/04/06'.
< 2022-04-06 08:23:30.091 Script: Bad message (badly formatted packet or protocol incompatibility).
< 2022-04-06 08:23:30.091 Error code: 5
< 2022-04-06 08:23:30.091 Error message from server: Bad message
. 2022-04-06 08:23:30.091 Script: Failed
. 2022-04-06 08:23:30.091 Script: Exit code: 1
. 2022-04-06 08:23:30.091 Closing connection.
. 2022-04-06 08:23:30.091 Sending special code: 1
. 2022-04-06 08:23:30.091 Session sent command exit status 0
. 2022-04-06 08:23:30.122 Main session channel closed
. 2022-04-06 08:23:30.122 All channels closed

My script fails when trying to create a new folder /EAS-MET/2022/04/06 on the remote server. When I manually create, the script works fine including creating sub folders automatically. It doesn't seem to want to create the root folder.