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

Deano82

Thank you @Martin this has resolved our issue.
martin

It's likely due to the doubled-double quotes in your put command:
put -delete ".\Downloads\...d79d255c4b09.xml" ""cacs/""

Use just "cacs/", or even no quotes at all: cacs/.
Deano82

and this is when we do a manual drag and drop via the GUI (which works fine and the files get coped over)
. Getting current directory name.
. 2025-04-09 14:36:46.486 Getting real path for '.'
> 2025-04-09 14:36:46.486 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2025-04-09 14:36:46.502 Type: SSH_FXP_NAME, Size: 23, Number: 16
. 2025-04-09 14:36:46.502 Real path is '/'
. 2025-04-09 14:36:46.533 Listing directory "/".
> 2025-04-09 14:36:46.533 Type: SSH_FXP_OPENDIR, Size: 10, Number: 267
< 2025-04-09 14:36:46.549 Type: SSH_FXP_HANDLE, Size: 13, Number: 267
> 2025-04-09 14:36:46.549 Type: SSH_FXP_READDIR, Size: 13, Number: 524
< 2025-04-09 14:36:46.564 Type: SSH_FXP_NAME, Size: 413, Number: 524
> 2025-04-09 14:36:46.564 Type: SSH_FXP_READDIR, Size: 13, Number: 780
< 2025-04-09 14:36:46.580 Type: SSH_FXP_STATUS, Size: 28, Number: 780
< 2025-04-09 14:36:46.580 Status code: 1
> 2025-04-09 14:36:46.580 Type: SSH_FXP_CLOSE, Size: 13, Number: 1028
. 2025-04-09 14:36:46.580 ..;d;0;2025-01-23T10:48:43.000Z;4;"0" [0];"1028" [1028];rwxr-xr-x;0
. 2025-04-09 14:36:46.580 dtf;d;0;2025-03-21T04:55:25.000Z;4;"1076" [1076];"1101" [1101];rwxr-xr-x;0
. 2025-04-09 14:36:46.580 cacs;d;0;2025-04-09T11:10:03.000Z;4;"1076" [1076];"1101" [1101];rwxrwxrwx;1
. 2025-04-09 14:36:46.626 Startup conversation with host finished.
. 2025-04-09 14:36:49.392 Cached directory change via "cacs" to "/cacs".
. 2025-04-09 14:36:49.392 Getting current directory name.
. 2025-04-09 14:36:49.392 Listing directory "/cacs".
> 2025-04-09 14:36:49.392 Type: SSH_FXP_OPENDIR, Size: 14, Number: 1291
< 2025-04-09 14:36:49.392 Type: SSH_FXP_STATUS, Size: 24, Number: 1028
. 2025-04-09 14:36:49.392 Discarding reserved response
< 2025-04-09 14:36:49.408 Type: SSH_FXP_HANDLE, Size: 13, Number: 1291
> 2025-04-09 14:36:49.424 Type: SSH_FXP_READDIR, Size: 13, Number: 1548
< 2025-04-09 14:36:49.439 Type: SSH_FXP_NAME, Size: 645, Number: 1548
> 2025-04-09 14:36:49.439 Type: SSH_FXP_READDIR, Size: 13, Number: 1804
< 2025-04-09 14:36:49.455 Type: SSH_FXP_STATUS, Size: 28, Number: 1804
< 2025-04-09 14:36:49.455 Status code: 1
> 2025-04-09 14:36:49.470 Type: SSH_FXP_CLOSE, Size: 13, Number: 2052
. 2025-04-09 14:36:49.470 ..;d;0;2025-01-23T10:48:43.000Z;4;"0" [0];"1028" [1028];rwxr-xr-x;0
. 2025-04-09 14:36:49.470 72509020_REFER-b9ee2c14-bfba-4066-aeb3-bdcb7947cd76.processed;-;7956;2025-04-09T08:37:41.000Z;4;"1076" [1076];"1101" [1101];rw-r--r--;0
. 2025-04-09 14:36:49.470 72510160_NOTIFY-6c203ff1-e2eb-4fb6-9b03-4309b7b43c58.processed;-;10829;2025-04-09T11:00:57.000Z;4;"1076" [1076];"1101" [1101];rw-r--r--;0
. 2025-04-09 14:36:54.252 Copying 1 files/directories to remote directory "/cacs/" - total size: 20,869
. 2025-04-09 14:36:54.252   PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: Yes; Mask: *.*
. 2025-04-09 14:36:54.252   TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; EncryptNewFiles: Yes; ExcludeHiddenFiles: No; ExcludeEmptyDirectories: No; InclM: ; ResumeL: 0
. 2025-04-09 14:36:54.252   AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2025-04-09 14:36:54.252 File: 'C:\Program Files\DataMotion\DataMotion Adapter Service\Downloads\72511367_NOTIFY-31a8bf94-1d58-427f-a6f8-d79d255c4b09.xml' [2025-04-09T13:31:07.282Z] [20869]
. 2025-04-09 14:36:54.252 Copying "C:\Program Files\DataMotion\DataMotion Adapter Service\Downloads\72511367_NOTIFY-31a8bf94-1d58-427f-a6f8-d79d255c4b09.xml" to remote directory started.
. 2025-04-09 14:36:54.252 Binary transfer mode selected.
. 2025-04-09 14:36:54.252 Opening remote file.
> 2025-04-09 14:36:54.252 Type: SSH_FXP_OPEN, Size: 87, Number: 2307
< 2025-04-09 14:36:54.252 Type: SSH_FXP_STATUS, Size: 24, Number: 2052
. 2025-04-09 14:36:54.252 Discarding reserved response
< 2025-04-09 14:36:54.267 Type: SSH_FXP_HANDLE, Size: 13, Number: 2307
> 2025-04-09 14:36:54.267 Type: SSH_FXP_WRITE, Size: 20894, Number: 2822
> 2025-04-09 14:36:54.267 Type: SSH_FXP_CLOSE, Size: 13, Number: 3076
> 2025-04-09 14:36:54.267 Type: SSH_FXP_SETSTAT, Size: 83, Number: 2569
< 2025-04-09 14:36:54.299 Type: SSH_FXP_STATUS, Size: 24, Number: 2822
< 2025-04-09 14:36:54.299 Status code: 0
< 2025-04-09 14:36:54.299 Type: SSH_FXP_STATUS, Size: 24, Number: 3076
< 2025-04-09 14:36:54.299 Status code: 0
. 2025-04-09 14:36:54.299 Preserving timestamp [2025-04-09T13:31:07.000Z]
< 2025-04-09 14:36:54.299 Type: SSH_FXP_STATUS, Size: 24, Number: 2569
< 2025-04-09 14:36:54.299 Status code: 0
. 2025-04-09 14:36:54.299 Transfer done: 'C:\Program Files\DataMotion\DataMotion Adapter Service\Downloads\72511367_NOTIFY-31a8bf94-1d58-427f-a6f8-d79d255c4b09.xml' => '/cacs/72511367_NOTIFY-31a8bf94-1d58-427f-a6f8-d79d255c4b09.xml' [20869]
Deano82

This is the session log when we run the script where its failing:
. 2025-04-09 14:31:08.860 Getting real path for '.'
> 2025-04-09 14:31:08.860 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2025-04-09 14:31:08.876 Type: SSH_FXP_NAME, Size: 23, Number: 16
. 2025-04-09 14:31:08.876 Real path is '/'
. 2025-04-09 14:31:08.876 Startup conversation with host finished.
< 2025-04-09 14:31:08.876 Script: Session started.
< 2025-04-09 14:31:08.876 Script: Active session: [1] xxxxxx@xxxxxxxxxxxxxxx
> 2025-04-09 14:31:08.876 Script: put -delete ".\Downloads\72511367_NOTIFY-31a8bf94-1d58-427f-a6f8-d79d255c4b09.xml" ""cacs/""
. 2025-04-09 14:31:08.876 Copying 1 files/directories to remote directory ""cacs/" - total size: 20,869
. 2025-04-09 14:31:08.876   PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask: "
. 2025-04-09 14:31:08.876   TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; EncryptNewFiles: Yes; ExcludeHiddenFiles: No; ExcludeEmptyDirectories: No; InclM: ; ResumeL: 0
. 2025-04-09 14:31:08.876   AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2025-04-09 14:31:08.876 File: '.\Downloads\72511367_NOTIFY-31a8bf94-1d58-427f-a6f8-d79d255c4b09.xml' [2025-04-09T13:31:07.282Z] [20869]
. 2025-04-09 14:31:08.907 Copying ".\Downloads\72511367_NOTIFY-31a8bf94-1d58-427f-a6f8-d79d255c4b09.xml" to remote directory started.
. 2025-04-09 14:31:08.907 Binary transfer mode selected.
. 2025-04-09 14:31:08.907 Opening remote file.
> 2025-04-09 14:31:08.907 Type: SSH_FXP_OPEN, Size: 33, Number: 259
< 2025-04-09 14:31:08.923 Type: SSH_FXP_STATUS, Size: 29, Number: 259
< 2025-04-09 14:31:08.923 Status code: 2, Message: 259, Server: No such file, Language: 
> 2025-04-09 14:31:08.923 Type: SSH_FXP_LSTAT, Size: 17, Number: 519
< 2025-04-09 14:31:08.954 Type: SSH_FXP_STATUS, Size: 29, Number: 519
< 2025-04-09 14:31:08.954 Status code: 2, Message: 519, Server: No such file, Language: 
* 2025-04-09 14:31:08.954 (ETerminal) No such file or directory.
* 2025-04-09 14:31:08.954 Error code: 2
* 2025-04-09 14:31:08.954 Error message from server: No such file
. 2025-04-09 14:31:08.954 Asking user:
. 2025-04-09 14:31:08.954 Cannot create remote file '/"cacs/"'. ("No such file or directory.
. 2025-04-09 14:31:08.954 Error code: 2
. 2025-04-09 14:31:08.954 Error message from server: No such file")
< 2025-04-09 14:31:08.954 Script: Cannot create remote file '/"cacs/"'.
< 2025-04-09 14:31:08.954 Script: No such file or directory.
< 2025-04-09 14:31:08.954 Error code: 2
< 2025-04-09 14:31:08.954 Error message from server: No such file
. 2025-04-09 14:31:08.954 Answer: Abort
* 2025-04-09 14:31:08.954 (ESkipFile) Cannot create remote file '/"cacs/"'.
* 2025-04-09 14:31:08.954 No such file or directory.
* 2025-04-09 14:31:08.954 Error code: 2
* 2025-04-09 14:31:08.954 Error message from server: No such file
Deano82

Script adding an extra "/"

Hi,

We have a bat script set up to move files from a local folder to a SFTP site using a program called Datamotion adapter which executes WinSCP to copy the files.
It is moving files to a folder called cacs on the SFTP site but we are getting the following error in the logs

Cannot create remote file '/"/cacs/"'.
No such file or directory.

The cacs folder already exists but it looks like the script is trying to add an extra / and trying to create a new folder. But we cant see anywhere in the script where it is doing this.
Has anyone come across this issue before?