Opened 11 years ago

Closed 11 years ago

#674 closed defect (wontfix)

Celery should not fail if audiolab is not installed

Reported by: Simon Fondrie-Teitler Owned by:
Priority: major Milestone:
Component: programming Keywords: bitesized, audiolab, celery, audio
Cc: Parent Tickets:


The docs say that audiolab is for spectrograms. I don't think this should be a critical feature for audio uploading and transcoding to work. It is possible that I'm missing something and audiolab is more important than I thought though. When I upload a flac file without audiolab installed I get the following error:

2013-04-03 22:11:30,136 ERROR   [celery] Task mediagoblin.processing.task.ProcessMedia[c1ac8460-95b5-44bc-bc5d-f02a9204be1b] raised exception: NameError("global name 'audiolab' is not defined",)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/celery/execute/", line 181, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/share/mediagoblin/mediagoblin/processing/", line 92, in run
  File "/usr/share/mediagoblin/mediagoblin/media_types/audio/", line 122, in process_audio
  File "/usr/share/mediagoblin/mediagoblin/media_types/audio/", line 76, in spectrogram  
  File "/usr/share/mediagoblin/mediagoblin/media_types/audio/", line 109, in __init__
    max_level = get_max_level(input_filename)
  File "/usr/share/mediagoblin/mediagoblin/media_types/audio/", line 79, in get_max_level
    audio_file = audiolab.Sndfile(filename, 'r')
NameError: global name 'audiolab' is not defined

Change History (1)

comment:1 by Christopher Allan Webber, 11 years ago

Resolution: wontfix
Status: newclosed

I think it makes sense for celery to fail if audiolab is not enabled here, since audiolab is a requirement of this media type. We could "not require" audiolab, but our entire method of displaying audio presently expects it..

What maybe would be a more useful thing is to have media types fail with a more useful method if they see that they are being enabled without all the dependencies they need. I'd be open to that, but I think that's a different bug, so if you're interested in that, I think we should file that separately.

Note: See TracTickets for help on using tickets.