Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError u'ALBUM_GAIN' #1855

Closed
petwri opened this issue Feb 1, 2016 · 10 comments
Closed

KeyError u'ALBUM_GAIN' #1855

petwri opened this issue Feb 1, 2016 · 10 comments
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."

Comments

@petwri
Copy link

petwri commented Feb 1, 2016

I'm on Ubuntu 15.10, python 2.7.10, beets 1.3.16. When running the replaygain plugin, I occasionally get this error (depending on the album I am analyzing):

Traceback (most recent call last):
  File "/usr/local/bin/beet", line 9, in <module>
    load_entry_point('beets==1.3.16', 'console_scripts', 'beet')()
  File "/usr/local/lib/python2.7/dist-packages/beets/ui/__init__.py", line 1207, in main
    _raw_main(args)
  File "/usr/local/lib/python2.7/dist-packages/beets/ui/__init__.py", line 1197, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/usr/local/lib/python2.7/dist-packages/beetsplug/replaygain.py", line 932, in func
    self.handle_album(album, write)
  File "/usr/local/lib/python2.7/dist-packages/beetsplug/replaygain.py", line 864, in handle_album
    album_gain = self.backend_instance.compute_album_gain(album)
  File "/usr/local/lib/python2.7/dist-packages/beetsplug/replaygain.py", line 505, in compute_album_gain
    return AlbumGain(Gain(last_tags["ALBUM_GAIN"],
KeyError: u'ALBUM_GAIN'

Can provide more information if required.

@sampsyo sampsyo added the needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." label Feb 1, 2016
@sampsyo
Copy link
Member

sampsyo commented Feb 1, 2016

Can you please provide instructions for reproducing this? Specifically, how is your RG plugin configured, and what files trigger the problem?

@petwri
Copy link
Author

petwri commented Feb 2, 2016

Ok, here's the excerpt from my config.yaml

replaygain: auto: no backend: gstreamer overwrite: no

Running 'beet replaygain -a' produces the error. I just realized that every once in a while, #1841 happens. So I assume this is also due to a gstreamer problem.

@petwri
Copy link
Author

petwri commented Feb 2, 2016

Ok, I just found that simply re-running the command solves the issue. After every start of 'beet replaygain -a', gstreamer complains about a different file. At some point, it then just finishes.

@sampsyo
Copy link
Member

sampsyo commented Feb 2, 2016

That's incredibly weird!

In any case, I just added some error handling for this case. If you can, please try that out and see if the crash goes away.

@petwri
Copy link
Author

petwri commented Feb 3, 2016

I assume the fix you just added is only for the latest version on github. I am still on beets 1.3.16, installed via pip. I guess an upgrade would be required.

@petwri
Copy link
Author

petwri commented Feb 3, 2016

Just found out, that when the gstreamer error always keeps coming up with the same file, running 'beet replaygain' without the -a flag works:

beet replaygain -a
replaygain: ReplayGain error: Error GLib.Error('GStreamer encountered a general stream error.', 'gst-stream-error-quark', 1) - 'gstbaseparse.c(3457): gst_base_parse_loop (): /GstPipeline:pipeline0/GstDecodeBin:decbin/GstMpegAudioParse:mpegaudioparse1:\nstreaming stopped, reason error' on file '/media/Music/Cage the Elephant/Cage the Elephant/01-02 James Brown.mp3'

while

beet replaygain
replaygain: analyzing Cage the Elephant - Cage the Elephant - James Brown

finished with no errors.

@sampsyo
Copy link
Member

sampsyo commented Feb 3, 2016

The FAQ has instructions for running the latest source.

Thanks for the extra info.

@petwri
Copy link
Author

petwri commented Feb 4, 2016

Just updated to the latest version from github. So far, the files that failed before, seem to work now. I will watch this whole issue, if the error mentioned above occurs again, I will post the output here.

@petwri
Copy link
Author

petwri commented Feb 4, 2016

For some files, the gstreamer error keeps coming up, I filed a bug report on their bugzilla page (https://bugzilla.gnome.org/show_bug.cgi?id=761540)

@sampsyo
Copy link
Member

sampsyo commented Feb 4, 2016

Good call. Here's hoping something comes out of the gstreamer bug.

@sampsyo sampsyo closed this as completed Feb 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."
Projects
None yet
Development

No branches or pull requests

2 participants