Community discussions

MikroTik App
 
User avatar
k6ccc
Forum Guru
Forum Guru
Topic Author
Posts: 1490
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)
Contact:

One router can't send ftp - other can

Wed May 31, 2023 1:39 am

I have a script in my RB4011iGS+ (running 6.49.6) that creates backup, export, and version text file every night and then sends those files via E-Mail and also via ftp to my file server. Works perfectly on the 4011 - has for a long time.

I had a need to dig out one of my old RB750r2 (running 6.49.8) routers for a specific purpose and ported that script to the RB750r2. After changing the file names to be appropriate for the RB750r2, the script creates the three files and sends them via E-Mail just fine, but the ftp fails.

While troubleshooting, I entered a print command to verify that the files were there, and then the /tool fetch command from the script. This works perfectly on the RB4011 (with appropriate filenames), but gets the 550 error message shown below on the RB750r2.
[Admin@RB750r2] /file> print
 # NAME                              TYPE                                    SIZE CREATION-TIME       
 0 RB750r2_Daily.backup              backup                               73.1KiB may/30/2023 11:23:53
 1 RB750r2_Version.txt               .txt file                               1051 may/30/2023 11:23:55
 2 RB750r2_Daily.rsc                 script                               24.6KiB may/30/2023 11:23:55
 3 flash                             disk                                         jan/01/1970 17:00:51
 4 flash/skins                       directory                                    dec/31/1969 17:00:01
 5 flash/pub                         directory                                    jan/01/1970 17:00:51
 6 flash/log.0.txt                   .txt file                            60.0KiB oct/17/2021 22:28:11
 7 flash/log.1.txt                   .txt file                            90.8KiB oct/02/2021 11:15:20
 8 flash/auto-before-reset.backup    backup                               61.4KiB dec/31/1969 17:00:11

[Admin@RB750r2] /file> /tool fetch address=192.168.201.11 src-path="RB750r2_Version.txt" user=
<Redacted> mode=ftp password="<redacted>" port=21 dst-path="RB750r2_Version.txt" upload=yes
  status: failed

failure: FTP server said: 550 File unavailable/inaccesable
I have a vague recollection that on certain versions of hardware, file locations are specified differently, but for the life of me, I could not find that in the Wiki. What seems odd is that the E-Mail command can find the files, but fetch can't.

Am I missing something?
Last edited by k6ccc on Thu Jun 01, 2023 9:19 pm, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: File locations?

Wed May 31, 2023 1:55 am

Read better: is FTP server said, not RouterOS said...

Try to set the name identically to what you have already used for the 4011, probably dst-path="RB4011iGSplus_Version.txt",
The problem is on your FTP server... the user have the right to write on that user folder, or user folder already exist? Etc.
 
User avatar
k6ccc
Forum Guru
Forum Guru
Topic Author
Posts: 1490
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)
Contact:

Re: File locations?

Wed May 31, 2023 2:21 am

Nope. Odd wording as it may seem, that error is from RouterOS. To prove that, on the 4011 (where the command works), change the filename to a non-exist name and that is the error message sent from RouterOS. Also note, that the FTP servers never sees the connection attempt at all if the filename is not correct.

I assume that wording is that way because RouterOS is using the same ftp engine for both client and server operation.

Both routers are using the same logon credentials and folder location for the ftp server.

Here's the same info from the 4011 (where it works perfectly):
Admin@RB4011iGS+] /file> print
 # NAME                    TYPE                         SIZE CREATION-TIME       
 0 pub                     directory                         jan/01/1970 17:19:23
 1 RB4011_Daily.backup     backup                  1341.4KiB may/29/2023 22:31:00
 2 RB4011_Version.txt      .txt file                    1051 may/29/2023 22:31:01
 3 AREDN_Ping.txt          .txt file                    2504 may/30/2023 16:10:09
 4 log.1.txt               .txt file                105.4KiB may/17/2023 23:04:53
 5 log.0.txt               .txt file                102.1KiB may/30/2023 16:10:50
 6 RB4011_Daily.rsc        script                   246.5KiB may/29/2023 22:31:01

[Admin@RB4011iGS+] /file> /tool fetch address=192.168.201.11 src-path="RB4011_V
ersion.txt" user=<redacted> mode=ftp password="<redacted>" port=21 dst-path="
RB4011_Version.txt upload=yes
      status: finished
  downloaded: 1KiBC-z pause]
    duration: 1s

 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: File locations?

Wed May 31, 2023 2:25 am

you have tried on 750 with dst-path="RB4011_Version.txt" ?
and also, check on server if the IP make the difference....

try also src-path="/RB750r2_Version.txt"

Everynight I do ftp backup from 2000+ devices that have flash memory and file stored on root for to not wear the flash, and all work correctly....
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: File locations?

Thu Jun 01, 2023 12:42 pm

...
Any news?
 
User avatar
k6ccc
Forum Guru
Forum Guru
Topic Author
Posts: 1490
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)
Contact:

Re: File locations?

Thu Jun 01, 2023 4:50 pm

Did not have time to do anything until last night, and nothing that I did would make it work. I didn't see your added / suggestion until just now, so I'll give that a try next.
.
 
User avatar
k6ccc
Forum Guru
Forum Guru
Topic Author
Posts: 1490
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)
Contact:

Re: File locations?

Thu Jun 01, 2023 5:02 pm

[Admin@RB750r2] /file> /tool fetch address=192.168.201.11 src-path="/RB750r2_Version.txt" user=<redacted>
 mode=ftp password="<redacted>" port=21 dst-path="RB750r2_Version.txt" upload=yes
  status: failed

failure: FTP server said: 550 File unavailable/inaccesable
According to the FTP server on my file server, the router is never attempting to access the file server.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: File locations?

Thu Jun 01, 2023 5:04 pm

You try to swap the IPs of the two device for see if some firewall rule drop the connection?
 
User avatar
k6ccc
Forum Guru
Forum Guru
Topic Author
Posts: 1490
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)
Contact:

Re: File locations?

Thu Jun 01, 2023 8:41 pm

You try to swap the IPs of the two device for see if some firewall rule drop the connection?
Unfortunately, that would be a royal pain in the ass. Router 1 (the RB4011) is my main router so EVERYTHING is routing through it. Changing it's IP would cause a lot of stuff to fail, or a lot of work to change things.
As far as routing, both routers and the file server for my .201 LAN are connected to ports on the same CSS326 switch. On router 2 (the RB750r2), traceroute confirms a single hop to the file server.
I have confirmed that the IP access rules in the FTP server on the file server are allowing the IP for all three routers.

Next step is to fire up WireShark on the server and make damn sure that packets are or are not making it to the ftp server. That will be this evening.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: File locations?

Thu Jun 01, 2023 8:52 pm

Sorry if I can't help :(
 
User avatar
k6ccc
Forum Guru
Forum Guru
Topic Author
Posts: 1490
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)
Contact:

Re: File locations?

Fri Jun 02, 2023 2:41 am

Sorry if I can't help :(
You have been very helpful in many ways over the years - so thank you for trying here. One of these days I (or someone else) will figure this out and the result will get posted here...
 
User avatar
k6ccc
Forum Guru
Forum Guru
Topic Author
Posts: 1490
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)
Contact:

Re: One router can't send ftp - other can

Tue Jun 06, 2023 11:27 pm

Update - specifically for Rextended...

It's working now, and I don't know why. All three routers working perfectly. The last step (after getting the ftp all working) was to add a .cmd file on the server that added the date on all nine files every night after the ftp uploads completed - easier to that in Windows than ROS...
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: One router can't send ftp - other can

Tue Jun 06, 2023 11:31 pm

(thanks!)

??? !!! ???

¯\(°_o)/¯

Who is online

Users browsing this forum: ko00000000001 and 22 guests