'SFTP Rename File' Command Query

Discuss RoboTask here
Post Reply
stuartbannon
Posts: 3
Joined: Wed Jul 20, 2022 11:54 am

'SFTP Rename File' Command Query

Post by stuartbannon »

Hi there,

I've gone through the process of automating one of our daily tasks that has been long overdue to be moved away from a manual run each day. The process is as follows and is rather straightforward:

- A client uploads a file to the root of a folder (Inbound) on their FTP site
- We log in and download the file to a network folder on our server, which imports the file into our system

The above is already automated, but the next part is where the anomaly occurs.

Note: The file in question has the naming convention of 'OR123112.CSV' which is 'Order-MM-DD-HH.CSV'.

I'm using the SFTP Rename File command as I saw recommended on another forum post on here to move the file from the root of the 'Inbound' folder to a folder found in the same directory 'Inbound/Archive'. When the automated step in the task runs, we appears in red and reads:

E: 20/07/2022 11:12:18: Rename error: /Inbound/OR123112.CSV -> Inbound/Archive/OR123112.CSV
E: 20/07/2022 11:12:18: An error occurred. Step #6 (SFTP Rename file "{FILETODOWNLOAD}" to "/Inbound/Archive").
E: 20/07/2022 11:12:18: Task execution is aborted

However, when I check and refresh the directory and folders on the FTP site, the file has been successfully moved.

Can you advise why the error is showing in the log even after it has performed the task successfully? I'm currently running Robotask 9.1.0.1079.

Thanks in advance.
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: 'SFTP Rename File' Command Query

Post by Oleg »

Unfortunately I can say nothing without your task.
Please send your task to me for investigation. Maybe you broke the logic of the task.
SFTP Rename File of Folder action woks correctly. I tested this
Oleg Yershov
stuartbannon
Posts: 3
Joined: Wed Jul 20, 2022 11:54 am

Re: 'SFTP Rename File' Command Query

Post by stuartbannon »

Hi Oleg,

Thanks for getting back to me on this.

Please find the task listed out below.

1. SFTP Open (Using Port 22 and not using private certificate)
2. SFTP File Loop
3. SFTP Download
- Remote File or Folder: {FILETODOWNLOAD}
- Local Folder: 'V:\'
4. Log Message
5. SFTP Rename file "{FILETODOWNLOAD}" to "/Inbound/Archive"
- Old File Name (or Directory Name): {FILETODOWNLOAD}
- New File Name (or Directory Name): /Inbound/Archive
6. Log Message
7. End Loop
8. SFTP LogOff

As I mentioned, the task runs correctly, even though it appears as a error in the Robotask log. However, if there are multiple files in the FTP to be picked up per run (which can happen from time-to-time), as the task errors out, it doesn't try pickup the second file, as the process is terminated on error.

Therefore, if I'm doing something wrong in the logic, please let me know because if I can get this process running and repeat until the relevant files are picked up in the root in the file loop I've set up, that would be outstanding.

Let me know if you have any other queries or need any further information.

Many thanks,
Stuart
Last edited by stuartbannon on Tue Aug 02, 2022 12:42 pm, edited 1 time in total.
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: 'SFTP Rename File' Command Query

Post by Oleg »

Please find the task listed out below.
This is NOT a task.
Select the task and use menu Task->Export to export the task to a file
Send this file and complete log of the task (with error messages) to me to oleg(at)robotask.com
5. SFTP Rename file "{FILETODOWNLOAD}" to "/Inbound/Archive"
Are you sure that the folder "/Inbound/Archive" exists?
E: 20/07/2022 11:12:18: Rename error: /Inbound/OR123112.CSV -> Inbound/Archive/OR123112.CSV
Pay attention that folders "/Inbound/" and "Inbound/" are different folders
"/Inbound/" - is a folder from root folder
"Inbound/" - is a subfolder from current folder (equals to "./Inbound/")
Are you sure that you are in the root folder when you try to rename file?
Oleg Yershov
stuartbannon
Posts: 3
Joined: Wed Jul 20, 2022 11:54 am

Re: 'SFTP Rename File' Command Query

Post by stuartbannon »

Hi Oleg,

I've sent the task and error log to your email address, as per your request.

Many thanks,
Stuart
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: 'SFTP Rename File' Command Query

Post by Oleg »

Thank you for your information.

It seems we have found the problem. It will be fixed in next release.
New version will be released in next week.
Oleg Yershov
stuartbannon
Posts: 3
Joined: Wed Jul 20, 2022 11:54 am

Re: 'SFTP Rename File' Command Query

Post by stuartbannon »

Brilliant, thanks so much for investigating this issue.

I will look forward to the new release and come back to this thread, should I need to.

Thanks again!
Post Reply