[Twisted-Python] Re: Traceback from pb-Server
Brian Warner
warner at lothar.com
Tue Sep 6 13:53:26 MDT 2005
> Popp> If the pythonscript named taskDescription.fileName isn't there
> Popp> self.serverErrorCB is called - thats ok. But it prints:
> Popp> reason [Failure instance: Traceback from remote host -- Traceback unavailable]
>
> Popp> But I need to know why the call failed. Can anyone please
> Popp> help me to get the traceback or the exception message that
> Popp> the server prints (exceptions.ImportError: No module named
> Popp> fitfunc2).
Also, you may want to enable the 'unsafeTracebacks' flag. In general, when PB
calls a method that raises an exception, the traceback is recorded to the log
on the "near" side of the connection, but very little information is sent to
the "far" side of the connection. (this is intended as a security feature..
tracebacks frequently contain copies of the code that failed, and you might
not want to expose that.. Failure instances can contain copies of stack
frames, local variables, all kinds of juicy stuff).
The 'unsafeTracebacks' flag tells PB to convey more information over the
wire. The remote side (the one which callRemote'ed the failing method) still
gets a Failure object, all asynchronous exceptions in Twisted are reported
this way, but it gets a Failure object with more attributes than it would get
if unsafeTracebacks==False. The "Traceback unavailable" message is
specifically a result of unsafeTracebacks==False.
But, in practice, I usually try to debug these sorts of failures on the
target side, closer to the code that raised the exception. You're always
going to get more information on that end of the wire.
hope that helps,
-Brian
More information about the Twisted-Python
mailing list