Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Pipeline steps unable to connect to host the agent is running on #2293
I'm running into a strange networking issue where pipeline steps are unable to connect to a domain that resolves to the same host the agent is running on.
As far as I've been able to isolate, this is specifically related to Drone as I've confirmed both the host itself and containers ran directly on the host can connect.
Here’s my pipline config:
pipeline: test: image: byrnedo/alpine-curl commands: - ping -c 1 HOST - curl -s http://ifconfig.co - curl --connect-timeout 5 http://HOST
And the output when it’s ran:
+ ping -c 1 HOST PING HOST (188.8.131.52): 56 data bytes 64 bytes from 184.108.40.206: seq=0 ttl=64 time=0.199 ms --- HOST ping statistics --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max = 0.199/0.199/0.199 ms + curl -s http://ifconfig.co 220.127.116.11 + curl --connect-timeout 5 http://HOST curl: (28) Connection timed out after 5001 milliseconds
When I run the same command on the host, they run fine:
root@host01:~# curl --connect-timeout 5 http://HOST <html> <head>…
To ensure this isn’t a Docker issue, I also tested running the image/command from the pipeline above directly in Docker:
root@host01:~# docker run byrnedo/alpine-curl --connect-timeout 5 http://HOST <html> <head>…
I believe this may also be related to drone-plugins/drone-docker#156
hey there, we have a discourse thread for user support. We can re-open if we determine this is a drone issue, however, we I think we've seen this before  and it is related to host machine network setup with respect to user-defined docker networks.
Your example running from the command line does not entirely mirror how drone is running the container. You would need to create and attach a network, like this:
Sometimes this can be resolved with host machine IP tables rules. Other times it can be resolved by providing http_proxy, https_proxy and no_proxy variables. Depends on the host machine configuration and root cause.