#167 closed defect (fixed)
fatal AttributeError on startup with Twisted 10.2.0
Reported by: | Zooko | Owned by: | Brian Warner |
---|---|---|---|
Priority: | critical | Milestone: | 0.6.0 |
Component: | negotiation | Version: | 0.5.1 |
Keywords: | Cc: |
Description
2010-11-29 21:56:17-0700 [-] Unhandled Error Traceback (most recent call last): File "/Library/Python/2.6/site-packages/Twisted-10.2.0_r30364-py2.6-macosx-10.6-universal.egg/twisted/internet/_baseprocess.py", line 60, in maybeCallProcessEnded proto.processEnded(Failure(reason)) File "/Library/Python/2.6/site-packages/Twisted-10.2.0_r30364-py2.6-macosx-10.6-universal.egg/twisted/internet/utils.py", line 89, in processEnded self.deferred.callback(self.s.getvalue()) File "/Library/Python/2.6/site-packages/Twisted-10.2.0_r30364-py2.6-macosx-10.6-universal.egg/twisted/internet/defer.py", line 361, in callback self._startRunCallbacks(result) File "/Library/Python/2.6/site-packages/Twisted-10.2.0_r30364-py2.6-macosx-10.6-universal.egg/twisted/internet/defer.py", line 455, in _startRunCallbacks self._runCallbacks() --- <exception caught here> --- File "/Library/Python/2.6/site-packages/Twisted-10.2.0_r30364-py2.6-macosx-10.6-universal.egg/twisted/internet/defer.py", line 542, in _runCallbacks current.result = callback(current.result, *args, **kw) File "/Library/Python/2.6/site-packages/allmydata/node.py", line 328, in _setup_tub portnum = l.getPortnum() File "/Library/Python/2.6/site-packages/foolscap-0.5.1-py2.6.egg/foolscap/pb.py", line 74, in getPortnum return self.s._port.getHost().port exceptions.AttributeError: 'StreamServerEndpointService' object has no attribute '_port'
Change History (6)
comment:1 Changed 14 years ago by
Component: | unknown → negotiation |
---|---|
Milestone: | undecided → 0.6.0 |
Owner: | set to Brian Warner |
Status: | new → assigned |
comment:2 Changed 14 years ago by
[628c8eecdc3b3990d4082c095d8b01e7cd006a9f] ought to fix this.. please give it a spin. If it seems ok, I'll aim for a new Foolscap release later this week.
comment:4 follow-up: 6 Changed 14 years ago by
comment:5 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Ok, marking this closed, the fix will be in the upcoming 0.6.0 release.
comment:6 Changed 14 years ago by
Replying to zooko:
before [628c8eecdc3b3990d4082c095d8b01e7cd006a9f], after [628c8eecdc3b3990d4082c095d8b01e7cd006a9f]
Both of these appear to fail due to http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1286 , which is caused by the same change to Twisted, but the failure is in Tahoe (when creating a web-API server) rather than foolscap.
Note: See
TracTickets for help on using
tickets.
Ok, so it looks like
TCPServer
still behaves the same way it used to, butstrports.service(port)
now returns something other than aTCPServer
. So the immediate solution is:pb.Listener
and don't usestrports
at all. That means manually parsing the subset of the strports spec that we care about ("tcp:", a port number, and maybe an:interface=a.b.c.d
), and then constructing aTCPServer
instance directly.TCPServer
when we get its._port
attribute, but we can probably get away with that for another Twisted release or two.The medium-term solution is to replace
pb.Listener
with a newIService
class that manages its ownreactor.listenTCP
. We can add agetYerKernelAllocatedPortNumber
method to it that's under our control. That might also make it easier to support IPv6, or not.The long-term solution is to pester Glyph to finish and/or explain the new "endpoints" support, and see if it makes sense to use them instead of raw
listenTCP
. It sounds like endpoints might also make it easier to support Tor, or certain kinds of proxies. Or not.