Trying to download a file from a ftp server (ftp://ftp.bmf.com.br/MarketData/)


#1

Hello,

In my tests, I’m trying to download files from a FTP server. To be precise it is ftp://ftp.bmf.com.br/MarketData/.

but I keep getting this error

REvalError: Error in function (type, msg, asError = TRUE) : Failed to connect to ftp.bmf.com.br port 21: No route to host

I have already tried to create a VPN connection as in https://docs.travis-ci.com/user/common-build-problems/?utm_source=blog&utm_medium=web&utm_campaign=ftp_blog#ftpsmtpother-protocol-does-not-work

but it didn’t work… Have someone experienced a similiar issue?

https://travis-ci.com/guilhermebodin/RfinBr/builds/98550975


#2

No route to host means a network problem. Unless your network/server was down at the time of the build or does some very strange traffic filtering for Travis IPs (sends ICMP destination unreachable instead of the standard RST or dropping packets), it’s a problem on Travis’ side or somewhere in between.

I can connect to ftp.bmf.com.br now. Does the problem still happen? Can you traceroute any of Travis’ IPs from that server?


#3

I don’t know exactly how to traceroute from the server as I’m not the server administrator. But I added a traceroute line to the before install script and it gave me this:

traceroute to ftp.bmf.com.br (177.54.222.80), 30 hops max, 60 byte packets
1 production-1-nat-c-1-g3fp.c.eco-emissary-99515.internal (10.10.0.6) 2.054 ms 2.032 ms production-1-nat-a-2-xfnr.c.eco-emissary-99515.internal (10.10.0.5) 1.505 ms
2 72.14.233.11 (72.14.233.11) 12.718 ms 209.85.250.34 (209.85.250.34) 13.079 ms 11.401 ms
3 108.170.244.7 (108.170.244.7) 12.431 ms 108.170.243.172 (108.170.243.172) 11.600 ms 108.170.244.5 (108.170.244.5) 17.838 ms
4 * * *
5 * * *
6 * * *
7 * * *
8 122.22.125.189.static.impsat.net.br (189.125.22.122) 147.878 ms 154.917 ms 155.964 ms
9 177.54.222.80 (177.54.222.80) 155.967 ms 146.954 ms 146.066 ms
10 * * *
11 * * 177.54.222.5 (177.54.222.5) 337.137 ms !H

I think the !H means that the ftp server is unreachable from Travis IPs as you pointed out.


#4

FTP traffic is unreliable from Travis CI build workers due to our use of NAT servers. (More details here: https://blog.travis-ci.com/2018-07-23-the-tale-of-ftp-at-travis-ci)

If you’re having troubles setting up VPN, I suggest you consider how badly you need this FTP server.

Do you really need this network connection to complete the tests? More external dependencies such as third-party packages and network connexions make your tests inherently more fragile. These should be kept to a minimum.

What from ftp://ftp.bmf.com.br/MarketData do you need? Do you need data? Or do you want to test the network connectivity? If it is just data and the up-to-date data are not required, I suggest downloading the data to your machine and adding it to the repository.


#5

I’m going to redesign the test structure, thank you for the advice!


#6

The traceroute says that this host sends ICMP host unreachable. By the IP, this seems like some router in the same network as your server. You should contact the network administrator for that network so they diagnose the problem.

The problems that @BanzaiMan referred to is that control and data connections may come from different IPs – which violates a security check that many FTP servers make by default. This typically doesn’t manifest itself like this, but you never know…

In any case, @BanzaiMan’s advice applies as well.