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

[musicbrainz] KeyError: 'disc' #22

Closed
neitsab opened this issue Jun 11, 2016 · 5 comments
Closed

[musicbrainz] KeyError: 'disc' #22

neitsab opened this issue Jun 11, 2016 · 5 comments
Labels
Bug Generic bug: can be used together with more specific labels

Comments

@neitsab
Copy link

neitsab commented Jun 11, 2016

Hi, when trying to rip a disc I'm having the following traceback:

...
CDDB disc id: 610ee607                        
MusicBrainz disc id Prl80A5pLQK5FAWqsdcwYwpX.UM-
MusicBrainz lookup URL https://musicbrainz.org/cdtoc/attach?toc=1+7+286270+150+46504+94265+137781+182147+214584+253420&tracks=7&id=Prl80A5pLQK5FAWqsdcwYwpX.UM-
Disc duration: 01:03:34.933, 7 audio tracks
Traceback (most recent call last):
  File "/usr/bin/rip", line 41, in <module>
    sys.exit(main.main(sys.argv[1:]))
  File "/usr/lib/python2.7/site-packages/morituri/rip/main.py", line 45, in main
    ret = c.parse(argv)
  File "/usr/lib/python2.7/site-packages/morituri/rip/main.py", line 123, in parse
    logcommand.LogCommand.parse(self, argv)
  File "/usr/lib/python2.7/site-packages/morituri/common/logcommand.py", line 62, in parse
    command.Command.parse(self, argv)
  File "/usr/lib/python2.7/site-packages/morituri/extern/command/command.py", line 401, in parse
    return self.subCommands[command].parse(args[1:])
  File "/usr/lib/python2.7/site-packages/morituri/common/logcommand.py", line 62, in parse
    command.Command.parse(self, argv)
  File "/usr/lib/python2.7/site-packages/morituri/extern/command/command.py", line 401, in parse
    return self.subCommands[command].parse(args[1:])
  File "/usr/lib/python2.7/site-packages/morituri/common/logcommand.py", line 62, in parse
    command.Command.parse(self, argv)
  File "/usr/lib/python2.7/site-packages/morituri/extern/command/command.py", line 363, in parse
    ret = self.do(args)
  File "/usr/lib/python2.7/site-packages/morituri/rip/cd.py", line 101, in do
    prompt=self.options.prompt)
  File "/usr/lib/python2.7/site-packages/morituri/common/program.py", line 344, in getMusicBrainz
    record=self._record)
  File "/usr/lib/python2.7/site-packages/morituri/common/mbngs.py", line 289, in musicbrainz
    len(result['disc']['release-list']),
KeyError: 'disc'

This is on an up-to-date Arch box with whipper-git from AUR.

Thanks!

@neitsab neitsab changed the title [msicbrainz] KeyError: 'disc' [musicbrainz] KeyError: 'disc' Jun 11, 2016
@JoeLametta JoeLametta added the Bug Generic bug: can be used together with more specific labels label Jun 12, 2016
@JoeLametta
Copy link
Collaborator

JoeLametta commented Jun 12, 2016

Good catch!
The error occurs because of the following old bug that was never fixed upstream:

thomasvs/morituri#50

Could you try ripping again the same CD but, this time, using the --unknown argument? I'd like to know if this way it works correctly.
In the meantime I'll think how to handle this case gracefully.

Thanks for the bug report.

@neitsab
Copy link
Author

neitsab commented Jun 14, 2016

Hey thank you for your quick reply! I confirm this also happens when using --unknown when connected to the Net:

$ rip cd rip --unknown
Using configured read offset 6
Checking device /dev/sr0
eject: échec de la commande de fermeture du plateau de CD: Erreur d'entrée/sortie
CDDB disc id: 610ee607                        
MusicBrainz disc id Prl80A5pLQK5FAWqsdcwYwpX.UM-
MusicBrainz lookup URL https://musicbrainz.org/cdtoc/attach?toc=1+7+286270+150+46504+94265+137781+182147+214584+253420&tracks=7&id=Prl80A5pLQK5FAWqsdcwYwpX.UM-
Disc duration: 01:03:34.933, 7 audio tracks
^[  Traceback (most recent call last):
  File "/usr/bin/rip", line 41, in <module>
    sys.exit(main.main(sys.argv[1:]))
  File "/usr/lib/python2.7/site-packages/morituri/rip/main.py", line 45, in main
    ret = c.parse(argv)
  File "/usr/lib/python2.7/site-packages/morituri/rip/main.py", line 123, in parse
    logcommand.LogCommand.parse(self, argv)
  File "/usr/lib/python2.7/site-packages/morituri/common/logcommand.py", line 62, in parse
    command.Command.parse(self, argv)
  File "/usr/lib/python2.7/site-packages/morituri/extern/command/command.py", line 401, in parse
    return self.subCommands[command].parse(args[1:])
  File "/usr/lib/python2.7/site-packages/morituri/common/logcommand.py", line 62, in parse
    command.Command.parse(self, argv)
  File "/usr/lib/python2.7/site-packages/morituri/extern/command/command.py", line 401, in parse
    return self.subCommands[command].parse(args[1:])
  File "/usr/lib/python2.7/site-packages/morituri/common/logcommand.py", line 62, in parse
    command.Command.parse(self, argv)
  File "/usr/lib/python2.7/site-packages/morituri/extern/command/command.py", line 363, in parse
    ret = self.do(args)
  File "/usr/lib/python2.7/site-packages/morituri/rip/cd.py", line 101, in do
    prompt=self.options.prompt)
  File "/usr/lib/python2.7/site-packages/morituri/common/program.py", line 344, in getMusicBrainz
    record=self._record)
  File "/usr/lib/python2.7/site-packages/morituri/common/mbngs.py", line 289, in musicbrainz
    len(result['disc']['release-list']),
KeyError: 'disc'

However it worked when I tried with no Internet connexion:

Using configured read offset 6
Checking device /dev/sr0
eject: échec de la commande de fermeture du plateau de CD: Erreur d'entrée/sortie
CDDB disc id: 610ee607                        
MusicBrainz disc id Prl80A5pLQK5FAWqsdcwYwpX.UM-
MusicBrainz lookup URL https://musicbrainz.org/cdtoc/attach?toc=1+7+286270+150+46504+94265+137781+182147+214584+253420&tracks=7&id=Prl80A5pLQK5FAWqsdcwYwpX.UM-
Disc duration: 01:03:34.933, 7 audio tracks
Warning: network error: NetworkError()
Error: NetworkError()
Continuing without metadata
Submit this disc to MusicBrainz at the above URL.

Warning: network error: IOError('socket error', gaierror(-2, 'Name or service not known'))
** Message: pygobject_register_sinkfunc is deprecated (GstObject)
Creating output directory Unknown Artist/0000 - Prl80A5pLQK5FAWqsdcwYwpX.UM-
Ripping track 1 of 7: 01. Unknown Track 1.flac

Go figure!

@JoeLametta
Copy link
Collaborator

JoeLametta commented Jun 14, 2016

The issue should now be fixed: could you try updating whipper (latest git) and ripping that CD again with the --unknown argument (while being connected to the internet) to check if the error still occurs?

Thanks in advance.

@neitsab
Copy link
Author

neitsab commented Jun 15, 2016

Thank you very much for the quick fix!

I had to hand back the CD to the friend who had lent it to me so I can't try again, but if I ever stumble upon such a release again I'll be sure to confirm here it works.

Feel free to close this issue meanwhile, except if you think another user may find it while faced to the same situation :)

@JoeLametta
Copy link
Collaborator

JoeLametta commented Jun 16, 2016

I managed to test it with a disc only available as cdstub entry in the MusicBrainz DB and can confirm it's working as expected.
I tested while being connected to the internet and whipper correctly reports (then exit):

Error: NotFoundException(ResponseError(),)
[...]
Submit this disc to MusicBrainz at the above URL.

If the rip is invoked with the --unknown argument it rips, as expected, continuing without metadata:

Error: NotFoundException(ResponseError(),)
Continuing without metadata
Submit this disc to MusicBrainz at the above URL.

I'm closing this issue: if you still experience issues related to this one do not hesitate to report them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Generic bug: can be used together with more specific labels
Projects
None yet
Development

No branches or pull requests

2 participants