"cannot find the path specified" - even if it exists

Advertisement

nitmws
Joined:
Posts:
2
Location:
Vienna, Austria

"cannot find the path specified" - even if it exists

I'm using WinSCP 5.17.10 on a Windows 10 computer and I call the DLL with PowerShell.
With the PutFiles method files selected by the wildcard 20*.ics should be transferred to the folder /ftp102050957-3/20/ in the target FTPS server
This line of PowerShell script is executed:
$session.PutFiles("C:\LocalData\Uploads\20*.ics", "/ftp102050957-3/20/")

But this does not work, a session log of this transfer shows:
. 2021-05-29 17:21:58.313 Binary transfer mode selected.
. 2021-05-29 17:21:58.313 Upload of C:\LocalData\Uploads\20_20210516122829.ics is started
> 2021-05-29 17:21:58.313 CWD /ftp102050957-3/20
< 2021-05-29 17:21:58.337 550 The system cannot find the path specified. 
> 2021-05-29 17:21:58.337 CWD /ftp102050957-3
< 2021-05-29 17:21:58.361 550 The system cannot find the file specified. 
> 2021-05-29 17:21:58.361 CWD /
< 2021-05-29 17:21:58.385 250 CWD command successful.
> 2021-05-29 17:21:58.385 MKD ftp102050957-3
< 2021-05-29 17:21:58.409 550 Access is denied. 
> 2021-05-29 17:21:58.409 CWD /ftp102050957-3
< 2021-05-29 17:21:58.433 550 The system cannot find the file specified. 
. 2021-05-29 17:21:58.433 Copying of files to the remote computer did not work (translated from German)

Simply said: this session cannot change to any folder on the remote computer except to the root /.

But connecting to this server with the WinSCP-GUI version I see this directory /ftp102050957-3/20 as the screenshot 29-05-_2021_17-44-16.png (below) shows.

And the log of the WinSCP-GUI is different:
. 2021-05-29 17:53:02.133 Startup conversation with host finished.
. 2021-05-29 17:53:24.174 Cached directory change via "20" to "/ftp102050957-3/20".
. 2021-05-29 17:53:24.174 Getting current directory name.
. 2021-05-29 17:53:24.177 Retrieving directory listing...
> 2021-05-29 17:53:24.177 CWD /ftp102050957-3/20
< 2021-05-29 17:53:24.199 250 CWD command successful.
With the GUI version the CWD /ftp102050957-3/20 is successful while with the assembly CWD /ftp102050957-3/20 results in "550 The system cannot find the path specified."

What makes the difference???

I want to point at the fact that the session is run using FTP with FTPS-Mode "Implicit" – and we noticed that sometimes actions on folders cause such "not found" or "can't access" problems, in WinSCP and other software like FileZilla.

Description: Screenshot showing the path which cannot be found.

29-05-_2021_17-44-16.png

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,587
Location:
Prague, Czechia

Re: "cannot find the path specified" - even if it exists

Please post full session log files both from the script and the GUI.

Reply with quote

nitmws
Joined:
Posts:
2
Location:
Vienna, Austria

Re: "cannot find the path specified" - even if it exists

Sorry, but digging into details of the logs showed that this is not an error of WinSCP.

About 10 days before doing these tests I resolved the host name to an IP address and used the IP address in the PowerShell script.
For the WinSCP GUI I used the host name.
Now I found out: the IP address of the server has changed prior to the tests, last part from .17 (used in PowerShell) to .18 (used in GUI).
But strange enough: it is still possible to access the .17 server with the same user name as registered for the host name/.18 IP address.
This way I fell prey to this IP address change.

Now I tested the PowerShell script using the host name: it worked!

Reply with quote

Advertisement

You can post new topics in this forum