Twisted web client does not support IPv6 address

Bug #1372767 reported by Jeroen T. Vermeulen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Jeroen T. Vermeulen
Twisted
Unknown
Unknown

Bug Description

When I configure the default MAAS URL to an IPv6 address (e.g. http://[fd0d:1727:6eb6:db5::1]/MAAS ) the cluster controller can no longer connect to the region controller, even though they are running on the same server.

The pserv.log shows errors like:

«
Unhandled Error
        Traceback (most recent call last):
          File "/usr/lib/python2.7/dist-packages/twisted/internet/task.py", line 218, in __call__
            d = defer.maybeDeferred(self.f, *self.a, **self.kw)
          File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 139, in maybeDeferred
            result = f(*args, **kw)
          File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1237, in unwindGenerator
            return _inlineCallbacks(None, gen, Deferred())
          File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1099, in _inlineCallbacks
            result = g.send(result)
        --- <exception caught here> ---
          File "/usr/lib/python2.7/dist-packages/provisioningserver/rpc/clusterservice.py", line 409, in update
            info = yield self._fetch_rpc_info(info_url)
          File "/usr/lib/python2.7/dist-packages/provisioningserver/rpc/clusterservice.py", line 431, in _fetch_rpc_info
            return getPage(url).addCallback(json.loads)
          File "/usr/lib/python2.7/dist-packages/twisted/web/client.py", line 718, in getPage
            *args, **kwargs).deferred
          File "/usr/lib/python2.7/dist-packages/twisted/web/client.py", line 692, in _makeGetterFactory
            uri = _URI.fromBytes(url)
          File "/usr/lib/python2.7/dist-packages/twisted/web/client.py", line 608, in fromBytes
            host, port = host.split(b':')
        exceptions.ValueError: too many values to unpack

Logged OOPS id OOPS-199af31e45ee2462dd0c64c369e7b27f: ValueError: too many values to unpack
»

The failure happens when ClusterClientService tries to obtain the RPC information page from the region server, using the IPv6 URL. Twisted's _URI.fromBytes tries to parse a URL, but assumes that only a port number can introduce a colon into the URL's network location.

Related branches

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :
Changed in maas:
assignee: nobody → Jeroen T. Vermeulen (jtv)
status: Triaged → In Progress
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.