No Such file or directory / Error changing directory

Advertisement

Guest

No Such file or directory / Error changing directory

Hi
I am countering this error after our client changed to a new SFTP Host and port. We have 2 servers involved in this change and I have managed to update the other one without any issues. Same steps performed and same version installed.

We have a batch file that executes the transfer of the file that is mapped to our SQL Database.
I have updated that get field path in the database but it still looks for a different file path when executing the exchange that I did not specify. I am not sure where it is coming from?

WinSCP Version: 6.3.6
Error:
< 2025-03-04 18:15:57.632 Script: Active session: [1] dmzhj@transfers-test.olliebear.com.au
> 2025-03-04 18:15:57.632 Script: cd OW_OUT_F*.txt
. 2025-03-04 18:15:57.632 Changing directory to "OW_OUT_F*.txt".
. 2025-03-04 18:15:57.632 Getting real path for '/ofw-corpapps-t-app-06-ap-southeast-2-btp-transferfamily-sftp/dmzhj/OW_OUT_F*.txt'
> 2025-03-04 18:15:57.632 Type: SSH_FXP_REALPATH, Size: 90, Number: 272
< 2025-03-04 18:15:57.632 Type: SSH_FXP_NAME, Size: 102, Number: 272
. 2025-03-04 18:15:57.632 Real path is '/ofw-corpapps-t-app-06-ap-southeast-2-btp-transferfamily-sftp/dmzhj/OW_OUT_F*.txt'
. 2025-03-04 18:15:57.632 Trying to open directory "/ofw-corpapps-t-app-06-ap-southeast-2-btp-transferfamily-sftp/dmzhj/OW_OUT_F*.txt".
> 2025-03-04 18:15:57.632 Type: SSH_FXP_LSTAT, Size: 90, Number: 519
< 2025-03-04 18:15:57.710 Type: SSH_FXP_STATUS, Size: 106, Number: 519
< 2025-03-04 18:15:57.710 Status code: 2, Message: 519, Server: /ofw-corpapps-t-app-06-ap-southeast-2-btp-transferfamily-sftp/dmzhj/OW_OUT_F*.txt, Language: US-ASCII 
* 2025-03-04 18:15:57.710 (ECommand) Error changing directory to 'OW_OUT_F*.txt'.
* 2025-03-04 18:15:57.710 No such file or directory.
* 2025-03-04 18:15:57.710 Error code: 2
* 2025-03-04 18:15:57.710 Error message from server (US-ASCII): /ofw-corpapps-t-app-06-ap-southeast-2-btp-transferfamily-sftp/dmzhj/OW_OUT_F*.txt
< 2025-03-04 18:15:57.710 Script: Error changing directory to 'OW_OUT_F*.txt'.
< 2025-03-04 18:15:57.710 No such file or directory.
< 2025-03-04 18:15:57.710 Error code: 2
< 2025-03-04 18:15:57.710 Error message from server (US-ASCII): /ofw-corpapps-t-app-06-ap-southeast-2-btp-transferfamily-sftp/dmzhj/OW_OUT_F*.txt
< 2025-03-04 18:15:57.710 Script: /ofw-corpapps-t-app-06-ap-southeast-2-btp-transferfamily-sftp/dmzhj
. 2025-03-04 18:15:57.710 Script: Failed
. 2025-03-04 18:15:57.710 Script: Exit code: 1
. 2025-03-04 18:15:57.710 Closing connection.
. 2025-03-04 18:15:57.710 Sending special code: 1
. 2025-03-04 18:15:57.710 Session sent command exit status 0
. 2025-03-04 18:15:57.710 Main session channel closed
. 2025-03-04 18:15:57.710 All channels closed
Path specified in the DB where it gets the value:
/ofw-corpapps-t-app-06-ap-southeast-2-btp-transferfamily-sftp/dmzhj/HJ/outbox/HJ_TEST/W962
I also tried hardcoding this value in the batch file program itself in the get part of the code but it still gives me the same error message.

I've been trying to solve this in a few weeks now. Will really Appreciate some inputs about this.

Thank you!

Reply with quote

Advertisement

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

Re: No Such file or directory / Error changing directory

It's hard to understand the problem without seeing complete script and complete log file.
But this seem just wrong:
cd OW_OUT_F*.txt
  1. You cannot use file masks in cd command
  2. The .txt hints that the mask to a file, not a folder – you cannot change a directory to a file
My wild guess is that you actually wanted to do get and not cd.

If you need further help, please post complete script and log.
A previous working script and its log might be useful too.

Reply with quote

Advertisement

You can post new topics in this forum