Context: I'm using WinSCP to transfer 2 reporting files daily from a local directory on D:\ drive to a clients remote server. I keep raising the error The system cannot find the path specified I'm really at a loss for why this is happening.
I've checked the directory for both of these files and the exact directory that is written when searched in the file explorer correctly accesses the files. For a few days during testing I did change the file names but changed them back exactly to the previous names that were used.
I thought this could be an issue with the Cache so I manually logged in & cleared the WinSCP directory cache. But that didnt solve the problem.
Questions: How can I solve this problem to allow WinSCP to find the correct directory? Is it possible the issue is that the default local directory is set to C:\ drive? Perhaps I need to use UNC naming convention or need to include the local server name in the directory path? Please advise.
Again, I've checked the directory D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items in the file explorer and the exact file is opened, so I know for sure this directory is correct. Below is detail from the WinSCP log for one of the transfer attempts.
. 2019-09-06 21:59:40.429 Access granted
. 2019-09-06 21:59:40.429 Opening session as main channel
. 2019-09-06 21:59:40.496 Opened main channel
. 2019-09-06 21:59:40.629 Started a shell/command
. 2019-09-06 21:59:40.629 --------------------------------------------------------------------------
. 2019-09-06 21:59:40.629 Using SFTP protocol.
. 2019-09-06 21:59:40.630 Doing startup conversation with host.
> 2019-09-06 21:59:40.630 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2019-09-06 21:59:40.821 Type: SSH_FXP_VERSION, Size: 95, Number: -1
. 2019-09-06 21:59:40.821 SFTP version 3 negotiated.
. 2019-09-06 21:59:40.821 Unknown server extension [email protected]="1"
. 2019-09-06 21:59:40.821 Supports [email protected] extension version "2"
. 2019-09-06 21:59:40.821 Unknown server extension [email protected]="2"
. 2019-09-06 21:59:40.821 We believe the server has signed timestamps bug
. 2019-09-06 21:59:40.821 We will use UTF-8 strings until server sends an invalid UTF-8 string as with SFTP version 3 and older UTF-8 strings are not mandatory
. 2019-09-06 21:59:40.821 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2019-09-06 21:59:40.821 Getting current directory name.
. 2019-09-06 21:59:40.821 Getting real path for '.'
> 2019-09-06 21:59:40.821 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2019-09-06 21:59:40.888 Type: SSH_FXP_NAME, Size: 23, Number: 16
. 2019-09-06 21:59:40.888 Real path is '/'
. 2019-09-06 21:59:40.888 Startup conversation with host finished.
< 2019-09-06 21:59:40.888 Script: Active session: [1] REDACTED
> 2019-09-06 21:59:40.888 Script: synchronize remote D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items /upload/bics_inventory
< 2019-09-06 21:59:40.888 Script: Comparing...
. 2019-09-06 21:59:40.888 Collecting synchronization list for local directory 'D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items' and remote directory '/upload/bics_inventory', mode = Remote, params = 0x2 (NoConfirmation), file mask = ''
* 2019-09-06 21:59:40.889 (EOSExtException) Error retrieving file list for "D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items\*.*".
* 2019-09-06 21:59:40.889 System Error. Code: 3.
* 2019-09-06 21:59:40.889 The system cannot find the path specified
. 2019-09-06 21:59:40.889 Asking user:
. 2019-09-06 21:59:40.889 Error listing directory 'D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items'. ("Error retrieving file list for ""D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items\*.*"".","System Error. Code: 3.","The system cannot find the path specified")
< 2019-09-06 21:59:40.889 Script: Error listing directory 'D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items'.
< 2019-09-06 21:59:40.889 Script: Error retrieving file list for "D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items\*.*".
< 2019-09-06 21:59:40.889 System Error. Code: 3.
< 2019-09-06 21:59:40.889 The system cannot find the path specified
< 2019-09-06 21:59:40.889 Script: Error listing directory 'D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items'.
< 2019-09-06 21:59:40.889 Error retrieving file list for "D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items\*.*".
< 2019-09-06 21:59:40.889 System Error. Code: 3.
< 2019-09-06 21:59:40.889 The system cannot find the path specified
. 2019-09-06 21:59:40.889 Script: Failed
. 2019-09-06 21:59:40.889 Script: Exit code: 1
. 2019-09-06 21:59:40.889 Closing connection.
. 2019-09-06 21:59:40.889 Sending special code: 12
. 2019-09-06 21:59:40.889 Sent EOF message
Ok looks like I fixed the problem. Setting a file path that includes the actual file name appears to be too granular.
I needed to set the directories to the locations of the folders in which the files are located (ex: D:\Div32_Daily_Reports\BICS_Inventory_New_Items)then the transfers are successful.