SFTP File Loop Problem

Discuss RoboTask here
Post Reply
salan
Posts: 2
Joined: Tue Mar 27, 2018 12:44 pm

SFTP File Loop Problem

Post by salan »

Hello,

this is my first post so please be gentle.

We have lots of Tasks with SFTP File Loop. Some of them are working and and the other don't find anything on the Server. All Tasks are the same (except for the servers and access data). How can i debug the Problem or get logs to analyse?

If somebody wish i can post a working and a not working Task.

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

Re: SFTP File Loop Problem

Post by Oleg »

What kind of problem servers?
Oleg Yershov
Oleg
Site Admin
Posts: 3116
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: SFTP File Loop Problem

Post by Oleg »

How can i debug the Problem or get logs to analyse?
You can run PSFTP utility (it is in RoboTask's folder), connect to server manually and use the command "dir" or "ls"
The command should return the list of files and folders. Try this, please

The command "help" returns available commands with short description
Oleg Yershov
salan
Posts: 2
Joined: Tue Mar 27, 2018 12:44 pm

Re: SFTP File Loop Problem

Post by salan »

Hi,

on the server there lots of folders with files. The name of the folders will change every day but this is not important. I just need to make a file loop and download the files in the folders.

I run PSFTP and find all the folders and files. I can see them with filezilla too. But for Robotask it seems to me that it doesn't find any files under these folders.

If you wish i can send you the task direktly to your emailadresse. I cannot post it hear in the forum.
Oleg
Site Admin
Posts: 3116
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: SFTP File Loop Problem

Post by Oleg »

If you wish i can send you the task direktly to your emailadresse. I cannot post it hear in the forum.
Yes, of course. It wold be great. My address is oleg(at)robotask.com

maybe your server use some another format of directory listing. So RoboTask get some parse error and get the empty list.
Once we have corrected similar problem.
We tested sFTP action on Linux SSH, but maybe there are some different versions
Oleg Yershov
tones15327
Posts: 1
Joined: Wed Nov 06, 2024 9:37 pm

Re: SFTP File Loop Problem

Post by tones15327 »

Hello,
Did you ever figure out this file looping problem? I am having the same exact problem as described here.

-Filezilla works to show directory of remote SFTP files.
-Robotask can connect and download an explicit file by filename.
-Robotask file loop or SFTP Sync commands act as if there are no files in the folder and no subdirectories.

Thank you,
Tony
Oleg
Site Admin
Posts: 3116
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: SFTP File Loop Problem

Post by Oleg »

-Filezilla works to show directory of remote SFTP files.
-Robotask can connect and download an explicit file by filename.
-Robotask file loop or SFTP Sync commands act as if there are no files in the folder and no subdirectories.
Look at my example below. It retrieves the listing of directory as text and writes listing.txt file in temporary folder
Change the login parameters and folder names for your server and run the task.
Then send file listing.txt and complete log of the to me by email for investigation

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|0
CatID=INTEGER|1604865554
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DisableOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task1351"
Hide=INTEGER|0
ID=INTEGER|-1271088640
LogOnAsUser=INTEGER|1
Name=STRING|"Get listing command-1"
OnErrorTaskID=INTEGER|1879502808
Priority=INTEGER|3
RestrictRESTAPIAccess=INTEGER|0
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
StepPause=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_SFTP_LOGON"
Enabled=INTEGER|-1
Name=STRING|"SFTP Open (<username>@localhost)"
Params=FOLDER

[Actions\Action1\Params]
host=STRING|"localhost"
output=STRING|"1"
password=STRING|"696917926583876828568003554383"
port=STRING|"22"
usecertificate=STRING|"0"
username=STRING|"<username>"

[Actions\Action10]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER

[Actions\Action10\Params]
message=STRING|"{txt}"
type=STRING|"3"

[Actions\Action11]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file {TempDir}\listing.txt"
Params=FOLDER

[Actions\Action11\Params]
encode=STRING|"0"
fileexists=STRING|"1"
filname=STRING|"{TempDir}\listing.txt"
line0=STRING|"*************************"
line1=STRING|"{txt}"
linecount=STRING|"2"
suppress=STRING|"0"

[Actions\Action12]
ActionID=STRING|"A_DIALOG_SHOWTEXT"
Enabled=INTEGER|-1
Name=STRING|"Show Text"
Params=FOLDER

[Actions\Action12\Params]
autoclose=STRING|"0"
filename=STRING|"{TempDir}\listing.txt"
fromfile=STRING|"0"
linecount=STRING|"0"
timeout=STRING|"10"

[Actions\Action2]
ActionID=STRING|"A_SFTP_COMMAND"
Enabled=INTEGER|-1
Name=STRING|"SFTP command (dir)"
Params=FOLDER

[Actions\Action2\Params]
_rt_variables_produced=STRING|"txt"
command=STRING|"dir"
variable=STRING|"txt"

[Actions\Action3]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER

[Actions\Action3\Params]
message=STRING|"{txt}"
type=STRING|"3"

[Actions\Action4]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file {TempDir}\listing.txt"
Params=FOLDER

[Actions\Action4\Params]
encode=STRING|"0"
fileexists=STRING|"0"
filname=STRING|"{TempDir}\listing.txt"
line0=STRING|"{txt}"
linecount=STRING|"1"
suppress=STRING|"0"
withoutprefix=STRING|"0"

[Actions\Action5]
ActionID=STRING|"A_SFTP_COMMAND"
Enabled=INTEGER|-1
Name=STRING|"SFTP command (dir test/*.zip)"
Params=FOLDER

[Actions\Action5\Params]
_rt_variables_produced=STRING|"txt"
command=STRING|"dir test/*.zip"
variable=STRING|"txt"

[Actions\Action6]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER

[Actions\Action6\Params]
message=STRING|"{txt}"
type=STRING|"3"

[Actions\Action7]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file {TempDir}\listing.txt"
Params=FOLDER

[Actions\Action7\Params]
encode=STRING|"0"
fileexists=STRING|"1"
filname=STRING|"{TempDir}\listing.txt"
line0=STRING|"*************************"
line1=STRING|"{txt}"
linecount=STRING|"2"
suppress=STRING|"0"

[Actions\Action8]
ActionID=STRING|"A_SFTP_CWD"
Enabled=INTEGER|-1
Name=STRING|"SFTP Change Folder (test)"
Params=FOLDER

[Actions\Action8\Params]
folder=STRING|"test"

[Actions\Action9]
ActionID=STRING|"A_SFTP_COMMAND"
Enabled=INTEGER|-1
Name=STRING|"SFTP command (dir)"
Params=FOLDER

[Actions\Action9\Params]
_rt_variables_produced=STRING|"txt"
command=STRING|"dir"
variable=STRING|"txt"


Oleg Yershov
Post Reply