Skip to content

Direct Download with IPv6 only fails #3047

Description

@wido
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.

Activity

  1. yadvr commented on Nov 22, 2018

    @yadvr
    Member
  2. wido commented on Nov 22, 2018

    @wido
    ContributorAuthor
    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.

  3. added this to the 4.13.0.0 milestone on May 27, 2019
  4. yadvr commented on Jun 25, 2019

    @yadvr
    Member

    ping @nvazquez can you advise?

  5. nvazquez commented on Jun 25, 2019

    @nvazquez
    Contributor

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

  6. modified the milestones: 4.13.0.0, 4.13.1.0 on Jul 4, 2019
  7. yadvr commented on Jul 4, 2019

    @yadvr
    Member

    Moved to next minor milestone @nvazquez

  8. DaanHoogland commented on Jan 3, 2020

    @DaanHoogland
    Contributor

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

  9. wido commented on Jan 3, 2020

    @wido
    ContributorAuthor

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

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

  10. DaanHoogland commented on Jan 3, 2020

    @DaanHoogland
    Contributor

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

  11. 9 remaining items

  12. modified the milestones: 4.16.0.0, unplanned on Jul 19, 2021
  13. sureshanaparti commented on Dec 16, 2021

    @sureshanaparti
    Contributor

    Not sure yet. We will try.

    Hi @wido Any work done on this one?

  14. wido commented on Dec 16, 2021

    @wido
    ContributorAuthor

    Not sure yet. We will try.

    Hi @wido Any work done on this one?

    No, not yet.

  15. sureshanaparti commented on Dec 16, 2021

    @sureshanaparti
    Contributor

    thanks @wido any plan to work on it.

  16. GabrielBrascher commented on Jan 6, 2022

    @GabrielBrascher
    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.

  17. sureshanaparti commented on Jan 28, 2022

    @sureshanaparti
    Contributor

    Fixed in #5900

  18. Repository owner moved this from Ready For Review to Done in Apache CloudStack 4.16.1on Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions