FTP_Result shows success, although ftpgetfile did not work

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
matthiasR
Pro Scripter
Posts: 52
Joined: Tue Jan 20, 2004 3:45 pm
Location: Lübbecke, Germany

FTP_Result shows success, although ftpgetfile did not work

Post by matthiasR » Sat Jun 14, 2008 9:38 pm

Hi,

i am running into a strange problem wit MacroScheduler 10.1.15.

I want to download a file with ftpgetfile.


If i specifiy a non existing host file, ftp_result contains success anyway.


If i specifiy a wrong username or password, ftp_result contains the error-message, that authentication was not successfull.

But why do i get a success, when downloading a non-existing file?

Does anyone has an idea?

Regards,

Matthias
Last edited by matthiasR on Sat Jun 14, 2008 9:48 pm, edited 1 time in total.

matthiasR
Pro Scripter
Posts: 52
Joined: Tue Jan 20, 2004 3:45 pm
Location: Lübbecke, Germany

Post by matthiasR » Sat Jun 14, 2008 9:47 pm

Hi,

i´ve just tested this with MacroScheduler 8.0.3.

And there it works. If i try to download a non existing file, i get a 550 error.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sat Jun 14, 2008 10:37 pm

Please show us the macro script so that we can see what you are doing.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

matthiasR
Pro Scripter
Posts: 52
Joined: Tue Jan 20, 2004 3:45 pm
Location: Lübbecke, Germany

Post by matthiasR » Sat Jun 14, 2008 10:57 pm

Hi,

after running into this problem, i tested with 2 simple lines.
I replaced server,userid and password for security reason.

Code: Select all

ftpgetfile>ftpserver,userid,password,21,C:\local.xls,/remote.xls,i
messagemodal>%ftp_result%
If remote.xls does not exist on the ftp-server

ftp_result contains success under MacroScheduler 10.1.15

and under V 8.0.3 ftp_result contains the correct error message

matthiasR
Pro Scripter
Posts: 52
Joined: Tue Jan 20, 2004 3:45 pm
Location: Lübbecke, Germany

Post by matthiasR » Sun Jun 15, 2008 2:16 pm

Hi,

in the meantime i tried this behaviour with another FTP-Server.

Trying to download a non existing file from that FTP-Server shows the correct FTP-Result.

So i tried both FTP-Servers again but now with the windows FTP to see the communication.

"Not-Working" FTP-Server (Pure-FTP)

ftp> get
Remotedatei PC-Spot.xl
Lokale Datei c:\PC-Spot.xls
200 PORT command successful
550 Can't open PC-Spot.xl: No such file or directory


"Working" FTP-Server (TeraStation Raid System)
ftp> get
Remotedatei PC-Spot.xl
Lokale Datei c:\PC-Spot.xls
200 PORT command successful
550 TeraStation.htm: No such file or directory

Why does MS 10 show succes in ftp_result?

If this would be general problem with that FTP-server, then why does it work with MacroScheduler 8?


Matthias

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sun Jun 15, 2008 4:36 pm

Syntax looks like all parameters are there, with no extra ones. Just some random thoughts now that might trigger a move in the right direction.......

Don't know if it makes a difference with Case, but try changing the final mode parameter from "i" to "I".

Also what if "/remote.xls" is changed to "\remote.xls" ?
What if you use PC-Spot.xl vs. remote.xls?

Also, what do you read in the FTP_STATUS window (Set to 1).
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

matthiasR
Pro Scripter
Posts: 52
Joined: Tue Jan 20, 2004 3:45 pm
Location: Lübbecke, Germany

Post by matthiasR » Sun Jun 15, 2008 7:22 pm

Hi,

tried I instead of i already. Also tried to use \ instead of /. No success

I had to do a screen record to see, what the status window shows. But i am not sure, that i got all recorded, as the status windows just opens for 1 or 2 seconds and within this time there a plenty of messages shown.

Here´s what is shown in status windows in MacroScheduler 10.1.15
>USER xxxxxxxx
>PASS ********
>CWD
>PORT 192.168.168.55.194,41
>NLST
>Transmitted 0 bytes
>QUIT

And this is shown in MS 8.03
>USER xxxxxxxx
>PASS ********
>TYPE I
>PORT 192.168.168.3.1374,171
>RETR

Regards,

Matthias

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Jun 16, 2008 1:53 pm

Just as a follow up - Matthias gave us a test account on his "FTP Pure" FTP server. This is what we found:
I can see what is happening. The first thing FTPGetFile list does is an LS command - in order to get a list of matching files. This is where things differ to version 8. Version 10 is capable of retrieving multiple files. In order to do this it has to get a directory listing, so it does an LS. Now, for some reason FTP Pure does NOT return an error if you try to do an LS against a filespec which does not exist. Instead it returns a SUCCESS code followed by "0 matches total". You can reproduce this using the Windows command line FTP client. As such Macro Scheduler gets a success code when you try to retrieve a non existant file because Pure FTP returns a success code but says "0 files". Our own ftp server (proFTPD) and others we have tested against, including IIS, return an error code.

We will have to decide whether we should workaround this or not. If the server correctly returns a success code, then arguably we should just pass that on. If the server thinks it is successful then we should report that. OR we could say if it is successful but ZERO files are found, we should treat this is a failure. Is it a failure, or is it just that zero files were transferred successfully as the server reports? Another option is we could maybe return a new variable called "FTP_NUMFILES" which holds the number of files transferred. That way you could check that value.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Jun 16, 2008 4:07 pm

Personally, I like the idea of the number coming back. The FTP connection was successful, but nothing was there to download, so that is not a failure.

Will you be making the change backwards compatible so that all versions will behave the same way? You usually do, and I understand that is always a difficult criteria, but somehow you always seem to find a way.

Good work on the analysis, there is no way we would have found that. Thanks Marcus.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Jun 16, 2008 5:45 pm

Adding FTP_NUMFILES to report the number of files returned/affected would be backwards compatible because it doesn't change anything. Just adds a new optional variable that can be used.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts