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

crash when using Discogs plugin #2965

Closed
goodzack opened this issue Jun 20, 2018 · 8 comments · Fixed by #3338
Closed

crash when using Discogs plugin #2965

goodzack opened this issue Jun 20, 2018 · 8 comments · Fixed by #3338
Labels
bug bugs that are confirmed and actionable discogs good first issue https://github.com/beetbox/beets/pull/5479

Comments

@goodzack
Copy link

Problem

Running an incremental import on a folder of files that may either be new or have duplicates in the library. When the import comes across a certain album-- not sure if it's precipitated by encountering the one that it is prompting me for, or if it's crashing on encountering another album it's processing in the background (which I'm pretty sure beets does?). I don't think it's the former, because

If I come across this, I'll turn off the discogs plugin and continue through the import. Later, if there are albums that I would have skipped because it wasn't found in MB, I'll run an import on those albums with discogs turned back on with no problem.

Running this command in verbose (-vv) mode:

$ beet -vv import -il ../logfile1 ../Inbox/

Led to this problem:

beginning of logfile...

/Volumes/CritterKeeper/Tunes/Inbox/A Sunny Day In Glasgow/(2007) Scribble Mural Comic Journal (3 items)
Looking up: /Volumes/CritterKeeper/Tunes/Inbox/A Tribe Called Quest/(2016) We Got It from Here... Thank You 4 Your Service
Sending event: before_choose_candidate
Finding tags for album "A Sunny Day In Glasgow - Scribble Mural Comic Journal".
Tagging A Tribe Called Quest - We got it from Here... Thank You 4 Your service
Candidates:
1. A Sunny Day in Glasgow - Scribble Mural Comic Journal (60.8%) (missing tracks, tracks) (CD, 2007, US, Notenuf Records)
Searching for discovered album ID: eb3a43ff-34cf-4c17-9be6-9ffa06e7ac40
Requesting MusicBrainz release eb3a43ff-34cf-4c17-9be6-9ffa06e7ac40
2. A Sunny Day In Glasgow - Scribble Mural Comic Journal (60.0%) (missing tracks, source, tracks) (Discogs, CD, 2007, US, Notenuf Records)
3. A Sunny Day In Glasgow - Scribble Mural Comic Journal (60.0%) (missing tracks, source, tracks) (Discogs, CD, 2008, Japan, Octave)
4. A Sunny Day In Glasgow - Scribble Mural Comic Journal (59.9%) (missing tracks, source, tracks) (Discogs, CD, 2008, UK, Europe & US, Mis Ojos Discos)
5. A Sunny Day in Glasgow - Scribble Mural Comic Journal (52.4%) (missing tracks, mediums, tracks) (2x12" Vinyl, 2008, US, Ruined Potential Records)
6. A Sunny Day In Glasgow - Scribble Mural Comic Journal (52.2%) (missing tracks, mediums, source, ...) (Discogs, 2xVinyl, 2008, US, Ruined Potential Records)
7. A Sunny Day in Glasgow - Nitetime Rainbows (44.6%) (missing tracks, tracks, album, ...) (12" Vinyl, 2010, US, Mis Ojos Discos)
8. A Sunny Day in Glasgow - The Sunniest Day Ever (43.2%) (tracks, album, missing tracks, ...) (2006, US)
9. A Sunny Day In Glasgow - Tout New Age (41.1%) (missing tracks, tracks, album, ...) (Discogs, CDr, 2007, US, Not On Label (A Sunny Day In Glasgow Self-released))
10. A Sunny Day in Glasgow - XMAS MIXER (37.7%) (tracks, album, year) (Digital Media, 2013, XW)
# selection (default 1), Skip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort? Sending event: import_task_created
primary MB release type: album
Sending event: albuminfo_received
Candidate: A Tribe Called Quest - We Got It from Here... Thank You 4 Your Service (eb3a43ff-34cf-4c17-9be6-9ffa06e7ac40)
Computing track assignment...
...done.
Success. Distance: 0.36

(it continues even though I haven't given an input... I assume it's supposed to happen like that. It continues without incident I can see until the following event)


Requesting MusicBrainz release 66343625-48b8-4d95-9b79-6d0590e806e3
Sending event: import_task_created
primary MB release type: album
Sending event: albuminfo_received
Candidate: AJJ - Home Style (66343625-48b8-4d95-9b79-6d0590e806e3)
Computing track assignment...
...done.
Success. Distance: 0.67
Sending event: import_task_created
discogs: Searching for master release 418779
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created

(occasionally I'll hit enter if beets doesn't appear to be prompting me - this is what happened here)

Correcting tags from:
    A Sunny Day In Glasgow - Scribble Mural Comic Journal
To:
    A Sunny Day in Glasgow - Scribble Mural Comic Journal
URL:
    https://musicbrainz.org/release/21951976-a87b-4118-a7dd-9ee319c3a32a
(Similarity: 60.8%) (missing tracks, tracks) (CD, 2007, US, Notenuf Records)
 * Our Change Into Rain Is No Change At All (Talkin' 'bout Us) ->
   Our Change Into Rain Is No Change at All (Talkin' 'Bout Us)
 * Watery (Drowining Is Just Another Word for Being Burried Alive Under Water) ->
   Watery (Drowning Is Just Another Word for Being Buried Alive Under Water) (title)
Missing tracks (10/13 - 76.9%):
 ! Wake Up Pretty (#1) (2:00)
 ! No. 6 Von Karman Street (#2) (4:16)
 ! A Mundane Phonecall to Jack Parsons (#3) (3:21)
 ! Ghost in the Graveyard (#5) (5:59)
 ! 5:15 Train (#6) (4:12)
 ! Lists, Plans (#7) (4:54)
 ! C'mon (#8) (4:28)
 ! The Horn Song (#9) (1:28)
 ! Things Only I Can See (#12) (5:06)
 ! The Best Summer Ever (#13) (4:44)
Apply, More candidates, Skip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort? A
Sending event: import_task_choice
found duplicates: [6, 2350]
default action for duplicates: a
This album is already in the library!
Old: 2 items, MP3, 199kbps, 9:40, 14.0 MiB
Old: 13 items, MP3 10, AAC 3, 207kbps, 54:10, 81.9 MiB
New: 3 items, AAC, 256kbps, 13:42, 25.1 MiB
[S]kip new, Keep both, Remove old, Merge all? S
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/bin/beet", line 11, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/ui/__init__.py", line 1256, in main
    _raw_main(args)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/ui/__init__.py", line 1243, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/ui/commands.py", line 943, in import_func
    import_files(lib, paths, query)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/ui/commands.py", line 913, in import_files
    session.run()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/importer.py", line 329, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/util/pipeline.py", line 445, in run_parallel
    six.reraise(exc_info[0], exc_info[1], exc_info[2])
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/util/pipeline.py", line 312, in run
    out = self.coro.send(msg)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/util/pipeline.py", line 194, in coro
    func(*(args + (task,)))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/importer.py", line 1351, in lookup_candidates
    task.lookup_candidates()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/importer.py", line 641, in lookup_candidates
    autotag.tag_album(self.items, search_ids=self.search_ids)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/autotag/match.py", line 460, in tag_album
    va_likely):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/plugins.py", line 561, in decorated
    for v in generator(*args, **kwargs):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/autotag/hooks.py", line 610, in album_candidates
    for candidate in plugins.candidates(items, artist, album, va_likely):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/plugins.py", line 371, in candidates
    for candidate in plugin.candidates(items, artist, album, va_likely):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beetsplug/discogs.py", line 151, in candidates
    return self.get_albums(query)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beetsplug/discogs.py", line 216, in get_albums
    return [album for album in map(self.get_album_info, releases[:5])
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beetsplug/discogs.py", line 303, in get_album_info
    original_year = self.get_master_year(master_id) if master_id else year
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beetsplug/discogs.py", line 230, in get_master_year
    self._log.debug(u'API Error: {0} (query: {1})', e, result._uri)
AttributeError: 'Master' object has no attribute '_uri'

Setup

  • OS: OS X 10.13.5
  • Python version: 2.7.14
  • beets version: 1.4.7
  • Turning off plugins made problem go away (yes/no): yes - discogs

My configuration (output of beet config) is:

directory: /Volumes/CritterKeeper/Tunes/Newer Library/
library : /Volumes/CritterKeeper/Tunes/beetlibrary/library.db

import:
  bell : yes
  resume : ask
  write: yes
log: /Volumes/CritterKeeper/Tunes/beetlibrary/
replace:
  '[\\/]': ''
  '^\.': ''
  '[\x00-\x1f]': ''
  '[<>:"\?\*\|]': ''
  '\.$': ''
  '\s+$': ''
  '^\s+': ''
  '^-': ''
  '\/': ''
paths:
  default: /$albumartist/($original_year) $album [$format]/$track $title
  singleton: /$albumartist/'non-album tracks'/$title/$title
  compilations: /Compilations/%if{$original_year,$original_year,%if{$year,$year,""}} $album%aunique{} [$format]/$track $title
missing:
    format: $albumartist - $album - $title
chroma:
    auto: no
convert:
    dest: /Volumes/CritterKeeper/Tunes/Converted/
    max_bitrate: 320000
duplicates:
    tiebreak:
        items: [bitrate]
plugins: fetchart duplicates missing chroma embedart convert discogs
@sampsyo
Copy link
Member

sampsyo commented Jun 20, 2018

Thank you for reporting! This looks like it might be related to #2893. @dbogdanov, can you please take a look at the traceback?

Meanwhile, do you think it’s feasible to narrow down the album that’s causing this error?

@sampsyo sampsyo added the needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." label Jun 20, 2018
@goodzack
Copy link
Author

I ran it again and it looks like this is where it crashed:

Looking up: /Volumes/CritterKeeper/Tunes/Inbox/Daft Punk/(2005) Human After All
Tagging Daft Punk - Human After All
No album ID found.
Search terms: Daft Punk - Human After All
Album might be VA: False
Searching for MusicBrainz releases with: {'release': u'human after all', 'tracks': u'1', 'artist': u'daft punk'}
Requesting MusicBrainz release 86d4299f-810e-3c4c-a324-2cc03672ed00
Sending event: import_task_created
primary MB release type: album
Sending event: albuminfo_received
Candidate: Daft Punk - Human After All (86d4299f-810e-3c4c-a324-2cc03672ed00)
Computing track assignment...
...done.
Success. Distance: 0.47
Requesting MusicBrainz release 9c02dc5c-6725-314b-a5d1-b6097ff0c6ce
primary MB release type: album
Sending event: albuminfo_received
Candidate: Daft Punk - Human After All (9c02dc5c-6725-314b-a5d1-b6097ff0c6ce)
Computing track assignment...
...done.
Success. Distance: 0.47
Requesting MusicBrainz release 77a2f001-ae10-45fe-8d56-6069edfe20fe
primary MB release type: album
Sending event: albuminfo_received
Candidate: Daft Punk - Human After All (77a2f001-ae10-45fe-8d56-6069edfe20fe)
Computing track assignment...
...done.
Success. Distance: 0.47
Requesting MusicBrainz release 134d357c-9cd9-4b30-90c9-900744a24e4a
primary MB release type: single
Sending event: albuminfo_received
Candidate: Daft Punk - Human After All (134d357c-9cd9-4b30-90c9-900744a24e4a)
Computing track assignment...
...done.
Success. Distance: 0.47
Requesting MusicBrainz release 56736173-8988-3b4f-b56a-1b36acec0e24
primary MB release type: single
Sending event: albuminfo_received
Candidate: Daft Punk - Human After All (56736173-8988-3b4f-b56a-1b36acec0e24)
Computing track assignment...
...done.
Success. Distance: 0.47
discogs: Searching for master release 26833
discogs: Searching for master release 26833
discogs: Searching for master release 26833
discogs: Searching for master release 27058
discogs: Searching for master release 26833

(duplicate album prompt, and I chose to skip new)

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/bin/beet", line 11, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/ui/__init__.py", line 1256, in main
    _raw_main(args)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/ui/__init__.py", line 1243, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/ui/commands.py", line 943, in import_func
    import_files(lib, paths, query)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/ui/commands.py", line 913, in import_files
    session.run()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/importer.py", line 329, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/util/pipeline.py", line 445, in run_parallel
    six.reraise(exc_info[0], exc_info[1], exc_info[2])
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/util/pipeline.py", line 312, in run
    out = self.coro.send(msg)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/util/pipeline.py", line 194, in coro
    func(*(args + (task,)))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/importer.py", line 1351, in lookup_candidates
    task.lookup_candidates()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/importer.py", line 641, in lookup_candidates
    autotag.tag_album(self.items, search_ids=self.search_ids)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/autotag/match.py", line 460, in tag_album
    va_likely):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/plugins.py", line 561, in decorated
    for v in generator(*args, **kwargs):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/autotag/hooks.py", line 610, in album_candidates
    for candidate in plugins.candidates(items, artist, album, va_likely):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets/plugins.py", line 371, in candidates
    for candidate in plugin.candidates(items, artist, album, va_likely):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beetsplug/discogs.py", line 151, in candidates
    return self.get_albums(query)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beetsplug/discogs.py", line 216, in get_albums
    return [album for album in map(self.get_album_info, releases[:5])
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beetsplug/discogs.py", line 303, in get_album_info
    original_year = self.get_master_year(master_id) if master_id else year
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beetsplug/discogs.py", line 230, in get_master_year
    self._log.debug(u'API Error: {0} (query: {1})', e, result._uri)
AttributeError: 'Master' object has no attribute '_uri'

looking this up at Discogs, both master release numbers 26833 and 27058 go to what is called a "master release" for "Human After All"; they have the same artist name and release title, so that is where I am supposing there is an issue.

@sampsyo
Copy link
Member

sampsyo commented Jun 20, 2018

Great. The problem seems to be that the error handling code here assumed we were dealing with an album when we’re in fact dealing with a Master object. It will be need to be updated—to fix it, we’ll need to figure out what field we can use to specify which Master we’re dealing with. Any insight, @dbogdanov?

@sampsyo sampsyo added bug bugs that are confirmed and actionable and removed needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." labels Jun 20, 2018
@dbogdanov
Copy link
Contributor

Correct, we should be using result.data['resource_url'] instead of result._uri.

@sampsyo
Copy link
Member

sampsyo commented Jun 21, 2018

Great! Can you please send a pull request?

@beamsbox
Copy link

Was this ever fixed? I'm getting the exact same issue... the last line reads as follows:
'
File "/volume1/@appstore/beets/env/lib/python2.7/site-packages/beetsplug/discogs.py", line 230, in get_master_year
self._log.debug(u'API Error: {0} (query: {1})', e, result._uri)
'
Any fix/workaround would be greatly appreciated. Thx.

@Yannovitch
Copy link

I'm getting this problem too, any way to help this bug getting fixed ?

@sampsyo
Copy link
Member

sampsyo commented Jan 28, 2019

@Yannovitch The best way to ensure it gets fixed is to help out yourself! You could try putting together a PR following the instructions from @dbogdanov above.

@arcresu arcresu added good first issue https://github.com/beetbox/beets/pull/5479 good first issue labels Apr 7, 2019
miketoth added a commit to miketoth/beets that referenced this issue Apr 15, 2019
@sampsyo sampsyo mentioned this issue May 6, 2019
@snejus snejus added the discogs label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs that are confirmed and actionable discogs good first issue https://github.com/beetbox/beets/pull/5479
Projects
None yet
7 participants