[Bug 1604608] Re: ipv6 client causes errors in twisted.web
LaMont Jones
lamont.jones at canonical.com
Tue Jul 26 22:37:24 UTC 2016
investigating this more, twisted's handling of ipv6 is fundamentally broken in some bad ways:
1) it allows "2001:db8::1:80" as an IP/Port combination, deciding that what you meant is [2001:db8::1]:80, rather than the default port on 2001:db8::1:80. 2001:db8::1:7f, on the other hand, means "default port on 2001:db8::1:7f.
2) if I have a hostname, it requires me to guess whether that will resolve to A or AAAA records, since I have to tell it which socket to create before I even know the answer (unless I look it up myself.)
2.1) Having said that, TCPClient doesn't even believe in ipv6 at all, as noted above.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to twisted in Ubuntu.
https://bugs.launchpad.net/bugs/1604608
Title:
ipv6 client causes errors in twisted.web
Status in twisted package in Ubuntu:
New
Bug description:
If the client connecting to the twisted (16.0.0-1, still present in upstream 16.3.0), then twisted dies as follows:
2016-07-18 15:40:21 [HTTPChannel,468,::ffff:127.0.0.1] Unhandled Error
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/twisted/web/http.py", line 1657, in lineReceived
self.allContentReceived()
File "/usr/lib/python3/dist-packages/twisted/web/http.py", line 1736, in allContentReceived
req.requestReceived(command, path, version)
File "/usr/lib/python3/dist-packages/maasserver/webapp.py", line 80, in requestReceived
command, path, version)
File "/usr/lib/python3/dist-packages/twisted/web/http.py", line 762, in requestReceived
self.process()
--- <exception caught here> ---
File "/usr/lib/python3/dist-packages/twisted/web/server.py", line 183, in process
self.render(resrc)
File "/usr/lib/python3/dist-packages/twisted/web/server.py", line 234, in render
body = resrc.render(self)
File "/usr/lib/python3/dist-packages/twisted/web/wsgi.py", line 561, in render
self._reactor, self._threadpool, self._application, request)
File "/usr/lib/python3/dist-packages/twisted/web/wsgi.py", line 293, in __init__
'REMOTE_ADDR': _wsgiString(request.getClientIP()),
File "/usr/lib/python3/dist-packages/twisted/web/wsgi.py", line 85, in _wsgiString
return string.decode("iso-8859-1")
builtins.AttributeError: 'NoneType' object has no attribute 'decode'
In the attached patch, the middle block addresses the above immediate
issue, and the other two blocks are my best guess at what the code
_should_ read for completeness.
We'll want to get this SRUed into xenial, once it's fixed in wily, as
it's required for MAAS 2.1 (which runs on "latest LTS release" ==
xenial.)
thanks
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/twisted/+bug/1604608/+subscriptions
More information about the foundations-bugs
mailing list