Opened 16 years ago
Last modified 15 years ago
#110 new defect
TypeError in CopiedFailure .parents serialization
Reported by: | Zooko | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | undecided |
Component: | error-handling | Version: | 0.3.0 |
Keywords: | Cc: |
Description
I'm sure that I'm doing something wrong in my use of foolscap, but maybe it shouldn't do this:
local#1990 20:44:28.717: response from peer iwlrbdlr: alreadygot=(), allocated=(9,) local#1991 20:44:28.717: peer selection successful for <Tahoe2PeerSelector for upload smt5x>: placed all 10 shares, sent 10 queries to 5 peers, 10 queries placed some shares, 0 pla ced none, got 0 errors local#1992 20:44:28.717: _send_shares, used_peers is set([<PeerTracker for peer a2niqogj and SI smt5x>, <PeerTracker for peer z3g3meyl and SI smt5x>, <PeerTracker for peer ncieuno4 and SI smt5x>, <PeerTracker for peer bduf2tsg and SI smt5x>, <PeerTracker for peer iwlrbdlr and SI smt5x>]) local#1993 20:44:28.717: <Encoder for smt5x> starting local#1994 20:44:28.733: starting shareholders local#1995 20:44:28.937: an inbound callRemote that we [ncie] executed (on behalf of someone else, TubID ncie) failed local#1996 20:44:28.937: reqID=5, rref=<BucketWriter C:\playground\allmydata\tahoe\trunk\_trial_temp\allmydata.test.test_repairer\Verifier\test_verify_no_problem\zzyjl8\temp\clien t0\storage\shares\sm\smt5xifqfpy6xecdu7d3q7vuqu\2>, methname=RIBucketWriter.write local#1997 20:44:28.937: args=[0, '\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x13\x00\x00\x00$\x00\x00\x007\x00\x00\x02\x17\x00\x00\x03\xf7\x00\x00\x05\xd7\x00\x00\x06\x81'] local#1998 20:44:28.937: kwargs={} local#2000 20:44:29.015: FAILURE: [CopiedFailure instance: Traceback from remote host -- Traceback (most recent call last): File "build\bdist.win32\egg\foolscap\eventual.py", line 26, in _turn cb(*args, **kwargs) File "build\bdist.win32\egg\foolscap\broker.py", line 538, in doNextCall d.addErrback(self.callFailed, delivery.reqID, delivery) File "c:\python25\lib\site-packages\twisted-8.1.0-py2.5-win32.egg\twisted\internet\defer.py", line 204, in addErrback errbackKeywords=kw) File "c:\python25\lib\site-packages\twisted-8.1.0-py2.5-win32.egg\twisted\internet\defer.py", line 186, in addCallbacks self._runCallbacks() --- <exception caught here> --- File "c:\python25\lib\site-packages\twisted-8.1.0-py2.5-win32.egg\twisted\internet\defer.py", line 328, in _runCallbacks self.result = callback(self.result, *args, **kw) File "build\bdist.win32\egg\foolscap\broker.py", line 610, in callFailed delivery.logFailure(f) File "build\bdist.win32\egg\foolscap\call.py", line 211, in logFailure level=log.NOISY, parent=lp) File "build\bdist.win32\egg\foolscap\logging\log.py", line 196, in msg File "build\bdist.win32\egg\foolscap\call.py", line 818, in getStateToCopy parents[i] = truncate(value, 200) File "build\bdist.win32\egg\foolscap\call.py", line 747, in truncate if s and len(s) > limit: exceptions.TypeError: object of type 'type' has no len() ]
Change History (3)
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
Summary: | TypeError in foolscap → TypeError in CopiedFailure .parents serialization |
---|
comment:3 Changed 15 years ago by
Component: | unknown → error-handling |
---|
Note: See
TracTickets for help on using
tickets.
Do you remember how you triggered this? It looks like you created a Failure around something that wasn't an Exception, like
Failure("bare string")
orFailure(42)
. Twisted should have stringified anything else. I can't seem to create a Failure like this on my own: the Failure constructor emits a warning and wraps my value with aDefaultException
when I try to use a bare string or a number.We could always stringify the values locally, but it'd be nice to get a test case for this in place. Let me know if you can remember how to reproduce it.