Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct Download with IPv6 only fails #3047

Closed
wido opened this issue Nov 22, 2018 · 16 comments · Fixed by #5900
Closed

Direct Download with IPv6 only fails #3047

wido opened this issue Nov 22, 2018 · 16 comments · Fixed by #5900

Comments

@wido
Copy link
Contributor

wido commented Nov 22, 2018

ISSUE TYPE
  • Bug Report
COMPONENT NAME
KVM Agent
CLOUDSTACK VERSION
master / 4.12
CONFIGURATION

Hypervisors are IPv6-only without a default IPv4 route to the internet.

OS / ENVIRONMENT

Ubuntu 18.04
OpenJDK 1.8

root@n03:~# java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-1ubuntu0.18.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
root@n03:~#
SUMMARY

When a hypervisor has no IPv4 default route Direct Download of a template failes.

2018-11-22 14:10:50,281 DEBUG [commons.httpclient.MultiThreadedHttpConnectionManager] (agentRequest-Handler-4:null) (logid:022777d5) HttpConnectionManager.getConnection:  config = HostConfiguration[host=http://packer-templates.o.auroraobjects.eu], timeout = 0
2018-11-22 14:10:50,282 DEBUG [commons.httpclient.MultiThreadedHttpConnectionManager] (agentRequest-Handler-4:null) (logid:022777d5) Allocating new connection, hostConfig=HostConfiguration[host=http://packer-templates.o.auroraobjects.eu]
2018-11-22 14:10:50,287 DEBUG [commons.httpclient.HttpConnection] (agentRequest-Handler-4:null) (logid:022777d5) Open connection to packer-templates.o.auroraobjects.eu:80
2018-11-22 14:10:50,322 DEBUG [commons.httpclient.HttpMethodDirector] (agentRequest-Handler-4:null) (logid:022777d5) Closing the connection.
2018-11-22 14:10:50,323 INFO  [commons.httpclient.HttpMethodDirector] (agentRequest-Handler-4:null) (logid:022777d5) I/O exception (java.net.ConnectException) caught when processing request: Network is unreachable (connect failed)
2018-11-22 14:10:50,323 DEBUG [commons.httpclient.HttpMethodDirector] (agentRequest-Handler-4:null) (logid:022777d5) Network is unreachable (connect failed)
root@n03:~# ip r
169.254.0.0/16 dev cloud0 proto kernel scope link src 169.254.0.1 
172.16.0.0/24 dev cloudbr1 proto kernel scope link src 172.16.0.13 
192.168.0.0/24 dev vlan300 proto kernel scope link src 192.168.0.13 
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown 
239.0.7.208 dev vlan300 scope link 
root@n03:~# 
root@n03:~# ip -6 r
2a00:f10:114::/64 dev enp4s0f1 proto ra metric 1024 pref medium
2a00:f10:114:2000::/64 dev brvx-2000 proto kernel metric 256 expires 2591725sec pref medium
default via fe80::a236:9fff:fe0d:abbe dev enp4s0f1 proto ra metric 1024 mtu 9000 pref medium
default via fe80::9889:27ff:fe04:896e dev brvx-2000 proto ra metric 1024 expires 1525sec hoplimit 64 pref medium
root@n03:~#

The hypervisor is IPv6 capable and the URL is reachable over IPv6 as well, but the hypervisor / KVM Agent fails to download it.

@rohityadavcloud
Copy link
Member

/cc @nvazquez

@wido
Copy link
Contributor Author

wido commented Nov 22, 2018

java.net.preferIPv6Addresses

That is set to True already in the Agent, so it should use IPv6 as well.

packer-templates.o.auroraobjects.eu is an alias for o.auroraobjects.eu.
o.auroraobjects.eu has address 185.107.215.161
o.auroraobjects.eu has IPv6 address 2a05:1500:ff01:7::161
root@n03:~# curl -I http://packer-templates.o.auroraobjects.eu/ubuntu1604-20G.qcow2
HTTP/1.1 200 OK
Bucket: packer-templates
x-amz-request-id: tx000000000000002883202-005bf6c446-26cf361-ams02
Date: Thu, 22 Nov 2018 14:59:18 GMT
Content-Length: 687472640
Last-Modified: Sun, 18 Nov 2018 04:51:48 GMT
ETag: "c0d732368be84093e92ca1727571d2b9-44"
x-amz-meta-s3cmd-attrs: atime:1542516274/ctime:1542516454/gid:999/gname:gitlab-runner/md5:ed9b4b7d8f2960b19057e49bc8a196b5/mode:33188/mtime:1542516454/uid:999/uname:gitlab-runner
Content-Type: application/octet-stream
Age: 1
Server: AuroraObjects
X-Cache-Hit: Yes
X-Cache-Hits: 1
Accept-Ranges: bytes
Connection: keep-alive

root@n03:~#

The host can reach the URL without any problems, but it is the Agent which seems to prefer IPv4 over IPv6.

@rohityadavcloud rohityadavcloud added this to the 4.13.0.0 milestone May 27, 2019
@rohityadavcloud
Copy link
Member

ping @nvazquez can you advise?

@nvazquez
Copy link
Contributor

Thanks, @wido for reporting this issue. I'll work on it

@rohityadavcloud
Copy link
Member

Moved to next minor milestone @nvazquez

@DaanHoogland
Copy link
Contributor

@nvazquez did #3374 solve this? (can we close this?)

@wido
Copy link
Contributor Author

wido commented Jan 3, 2020

No, this is not resolved and still on the todo.

It's on the internal todo of PCextreme as well.

@DaanHoogland
Copy link
Contributor

ok @wido will it make the next releases, you think?

@wido
Copy link
Contributor Author

wido commented Jan 6, 2020

Not sure yet. We will try.

@nvazquez
Copy link
Contributor

Hi @wido is there any work done related to this issue?

@wido
Copy link
Contributor Author

wido commented Jul 14, 2021

Hi @wido is there any work done related to this issue?

No, no work yet

@nvazquez nvazquez modified the milestones: 4.16.0.0, unplanned Jul 19, 2021
@sureshanaparti
Copy link
Contributor

Not sure yet. We will try.

Hi @wido Any work done on this one?

@wido
Copy link
Contributor Author

wido commented Dec 16, 2021

Not sure yet. We will try.

Hi @wido Any work done on this one?

No, not yet.

@sureshanaparti
Copy link
Contributor

thanks @wido any plan to work on it.

@GabrielBrascher
Copy link
Member

@sureshanaparti @nvazquez @wido I opened PR #5826 proposing a fix.
It is as basic as removing the conditional on the UriUtils.validateUrl which throws an exception in the case of IPv6.
That code is 10 years old, in "another era" where there was not much IPv6 support.

Nowadays most of the repositories support both IPv4 and IPv6. Including the CloudStack repository, which triggered my main interest in fixing it as soon as possible when I was not able to install the System VM template from the download.cloudstack.org on an IPv6 CloudStack Zone.

@sureshanaparti
Copy link
Contributor

Fixed in #5900

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment