Curl, git, other commands hang while trying to download file on Ubuntu 18
Currently on Ubuntu 18.04.12, when I try to download something from the terminal, or push to git or any similar command it always hangs on the download either indefinitely or for a very long time. However when I Ctrl+C and try again it usually works after a couple of tries.
I was able to diagnose a bit and the hanging happens when curl tries to resolve the ipv6 address of the server instead of the ipv4. Problem is, I don't have ipv6 configured or an ipv6 DNS server setup for that matter, so I'm really lost why it would try that (or at least why it would try that so many times and not revert back to ipv4). I disabled ipv6 with sysctl but it doesn't make a difference. I'm a bit lost here since this doesn't seem to happen on other machines in the same network, but I believe this one is the only one with Ubuntu 18. |
Sounds like a general networking problem.
Let's start with Code:
ping -4 archive.org |
Quote:
ping -4 works fine, ping -6 gives Code:
connect: Network is unreachable |
Quote:
AFAIK, an IPv4 nameserver can still return IPv6 addrsses, so... have you completely disabled IPv6 on your system? There's something in /etc, sysctl.conf IIRC, that needs to be edited accordingly. or kernel command line. |
Quote:
|
what exactly did or did you not do?
we need information if you want help. please read the first two links in my signature. |
make curl noisy
Code:
curl -v ifconfig.me sometimes you may need to ask curl to follow redirects with -L long shot when you are having network troubles one of the causes can be your system clock being out of sync Unlikely, and I have no idea why I thought of that. still, confirm the date/time is correct |
I have to disable ipv6 some times or my system will hang. Try this temp fix on ipv6. See if it makes a difference:
Code:
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 && sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 |
Quote:
Code:
* Rebuilt URL to: ifconfig.me/ |
Quote:
|
Quote:
the one that fails is going through a local squid proxy |
Quote:
This is the response on another machine: Code:
* Rebuilt URL to: ifconfig.me/ |
Quote:
they are each using their own ( localhost:3128 ) Edit ahh, wait I may have got confused a little it is working, eventually Code:
curl -v --proxy localhost:3128 ifconfig.me |
are you getting an IP from ifconfig.me?
add on echo to the end, as it can get lost Code:
curl ifconfig.me;echo |
Quote:
Yes, both get an IP from ifconfig.me (I clipped it from the code, sorry if that was confusing), and only one of them gets the timeouts, the other works perfectly. |
All times are GMT -5. The time now is 08:15 PM. |