2018-01-16, 08:07
Something odd is happening with curl. It appears to be failing left, right and centre in my logs. So let's take an example URL:
http://mirrors.kodi.tv/addons/krypton/pl...fanart.jpg
As you can see, that works fine, now let's try it with curl (which Kodi uses extensively):
The distro I am using is Retropie, but from what I gather the mainline distro has turned on ipv6 by default.
http://mirrors.kodi.tv/addons/krypton/pl...fanart.jpg
Quote:wget http://mirrors.kodi.tv/addons/krypton/pl...fanart.jpg
--2018-01-16 16:56:41-- http://mirrors.kodi.tv/addons/krypton/pl...fanart.jpg
Resolving mirrors.kodi.tv (mirrors.kodi.tv)... 89.16.176.16
Connecting to mirrors.kodi.tv (mirrors.kodi.tv)|89.16.176.16|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://ftp.halifax.rwth-aachen.de/xbmc/a...fanart.jpg [following]
--2018-01-16 16:56:42-- http://ftp.halifax.rwth-aachen.de/xbmc/a...fanart.jpg
Resolving ftp.halifax.rwth-aachen.de (ftp.halifax.rwth-aachen.de)... 137.226.34.46, 2a00:8a60:e012:a00::21
Connecting to ftp.halifax.rwth-aachen.de (ftp.halifax.rwth-aachen.de)|137.226.34.46|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 465479 (455K) [image/jpeg]
Saving to: ‘fanart.jpg.1’
fanart.jpg.1 100%[==============================================================================>] 454.57K 66.0KB/s in 6.9s
2018-01-16 16:56:50 (66.0 KB/s) - ‘fanart.jpg.1’ saved [465479/465479]
As you can see, that works fine, now let's try it with curl (which Kodi uses extensively):
Quote:curl -Lv http://mirrors.kodi.tv/addons/krypton/pl...fanart.jpgNow isn't that strange? Further investigation reveals that it only fails when ipv6 is used, if I force curl to use --ipv4 it works fine. So as a cheap and dirty fix I disabled ipv6 by adding 'ipv6.disable=1' to /boot/cmdline.txt and rebooted. Hey presto, curl starts working again.
* Hostname was NOT found in DNS cache
* Trying 89.16.176.16...
* Connected to mirrors.kodi.tv (89.16.176.16) port 80 (#0)
> GET /addons/krypton/plugin.video.giantbomb/fanart.jpg HTTP/1.1
> User-Agent: curl/7.38.0
> Host: mirrors.kodi.tv
> Accept: */*
>
< HTTP/1.1 302 Moved Temporarily
* Server nginx is not blacklisted
< Server: nginx
< Date: Tue, 16 Jan 2018 05:57:51 GMT
< Content-Type: text/html
< Content-Length: 154
< Connection: close
< Location: http://ftp.halifax.rwth-aachen.de/xbmc/a...fanart.jpg
< X-Frame-Options: SAMEORIGIN
<
* Closing connection 0
* Issue another request to this URL: 'http://ftp.halifax.rwth-aachen.de/xbmc/addons/krypton/plugin.video.giantbomb/fanart.jpg'
* Hostname was NOT found in DNS cache
* Trying 137.226.34.46...
* Trying 2a00:8a60:e012:a00::21...
* connect to 2a00:8a60:e012:a00::21 port 80 failed: Network is unreachable
* Failed to connect to ftp.halifax.rwth-aachen.de port 80: Network is unreachable
* Closing connection 1
curl: (7) Failed to connect to ftp.halifax.rwth-aachen.de port 80: Network is unreachable
The distro I am using is Retropie, but from what I gather the mainline distro has turned on ipv6 by default.