Ticket #276 (new defect)

Opened 2 years ago

Last modified 2 years ago

"Deferred instance has no attribute 'isLeaf"' while attempting to Transcode

Reported by: Augmented Insanity Assigned to: dev
Priority: major Milestone:
Component: MediaServer Backend FileSystem Version:
Keywords: transcoding, gstreamer Cc:

Description (Last modified by philn)

WARN  transcoder_manager          Jan 03 16:15:35  available transcoders {'thumb': <class 'coherence.transcoder.ThumbTranscoder'>, 'mp4': <class 'coherence.transcoder.MP4Transcoder'>, 'lpcm': <class 'coherence.transcoder.PCMTranscoder'>, 'mp3': <class 'coherence.transcoder.MP3Transcoder'>, 'mpegts': <class 'coherence.transcoder.MP2TSTranscoder'>, 'wav': <class 'coherence.transcoder.WAVTranscoder'>} (coherence/transcoder.py:738)
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/twisted/protocols/basic.py", line 231, in dataReceived
    why = self.lineReceived(line)
  File "/usr/lib/python2.5/site-packages/twisted/web/http.py", line 1325, in lineReceived
    self.allContentReceived()
  File "/usr/lib/python2.5/site-packages/twisted/web/http.py", line 1391, in allContentReceived
    req.requestReceived(command, path, version)
  File "/usr/lib/python2.5/site-packages/twisted/web/http.py", line 714, in requestReceived
    self.process()
--- <exception caught here> ---
  File "/usr/lib/python2.5/site-packages/Coherence-0.6.6.1-py2.5.egg/coherence/upnp/core/utils.py", line 243, in process
    resrc = self.site.getResourceFor(self)
  File "/usr/lib/python2.5/site-packages/twisted/web/server.py", line 567, in getResourceFor
    return resource.getChildForRequest(self.resource, request)
  File "/usr/lib/python2.5/site-packages/twisted/web/resource.py", line 44, in getChildForRequest
    while request.postpath and not resource.isLeaf:
exceptions.AttributeError: Deferred instance has no attribute 'isLeaf'

And it keeps looping until I stop "playing". I'm accessing the server from a PS3 trying to playback an .OGG. Running 0.6.6.1 on Ubuntu 8.04 Hardy. I never had such problem with 0.6.4.

Change History

03.01.2010 19:25:18 changed by philn

  • description changed.

05.01.2010 14:09:18 changed by dev

(In [1535]) adding something quick 'n dirty to get around the transcoder crashes, addresses #276

Currently only in the 0.6.6.x branch, to checkout the source use svn co https://coherence.beebits.net/svn/branches/Coherence-0.6.6.x and do a cd Coherence-0.6.6.x;sudo python ./setup.py install afterwards.

30.07.2010 04:03:37 changed by exarkun

This would be greatly aided by the resolution of <http://twistedmatrix.com/trac/ticket/3621>. Hopefully that's actually not too far off now (as in, maybe sometime this year), but who knows.

In the meanwhile, you might find twisted.web.util.DeferredResource? handy. You wrap it around a Deferred and return it. The URL traversal machinery knows how to deal with it (actually it's just a sort of normal Resource), and it takes care of finishing URL traversal once the Deferred fires and then rendering whatever the ultimate result is.

It shouldn't be much more of a change to switch to using it, and the result should hopefully be something that works better (I have no idea how the code there now is working, it seems like it should just fail slightly later with an AttributeError? for "render").

I'm not sure how to exercise this code or I'd try contributing a patch. If someone can give me some tips about testing, I might give it a try. I'm interested in having working transcoding support.