beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.73k stars 1.82k forks source link

Occasional crashes with Lyrics plugin #3518

Closed sposker closed 4 years ago

sposker commented 4 years ago

Occasional crashes with Lyrics plugin

This seems to occur about once every 10 import sessions-- I only attempted to import two albums in this session, so I will post the full console output as it is relatively short:

PS C:\Users\Oliver> beet import J:\new -m

J:\new\2004 - [flac] - paco doesn't love me [cds] (4 items)
Correcting tags from:
    Spazzys - Paco Doesn't Love Me [Cds]
To:
    Spazzys - Paco Doesn't Love Me
URL:
    https://musicbrainz.org/release/3e1f4948-952d-403d-877c-d33ab482f603
(Similarity: 99.1%) (album) (2004, AU)
 * I Don't Want To Go To The Party -> I Don't Want to Go to the Party

J:\new\Grimes - Miss Anthropocene [DLX] (2020) [WEB FLAC] (15 items)
Tagging:
    Grimes - Miss Anthropocene
URL:
    https://musicbrainz.org/release/d2b5056b-bd41-4272-997b-7f2470e0c2e2
(Similarity: 100.0%) (Digital Media, 2020, CA, Crystal Math Music, deluxe)
 * So Heavy I Fell Through the Earth (Art Mix) ->
   So Heavy I Fell Through the Earth (Art mix)
 * My Name is Dark (Art Mix) ->
   My Name Is Dark (Art mix)
 * You'll miss me when I'm not around ->
   You’ll miss me when I’m not around
 * So Heavy I Fell Through the Earth (Algorithm Mix) ->
   So Heavy I Fell Through the Earth (Algorithm mix)
 * Violence (Club Mix) ->
   Violence (club mix)
 * My Name is Dark (Algorithm Mix) ->
   My Name Is Dark (Algorithm mix)
 * IDORU (Algorithm Mix) ->
   IDORU (Algorithm mix)
Traceback (most recent call last):
  File "C:\Python\python38\Scripts\beet-script.py", line 11, in <module>
    load_entry_point('beets==1.4.9', 'console_scripts', 'beet')()
  File "c:\python\python38\lib\site-packages\beets\ui\__init__.py", line 1266, in main
    _raw_main(args)
  File "c:\python\python38\lib\site-packages\beets\ui\__init__.py", line 1253, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "c:\python\python38\lib\site-packages\beets\ui\commands.py", line 955, in import_func
    import_files(lib, paths, query)
  File "c:\python\python38\lib\site-packages\beets\ui\commands.py", line 925, in import_files
    session.run()
  File "c:\python\python38\lib\site-packages\beets\importer.py", line 329, in run
    pl.run_parallel(QUEUE_SIZE)
  File "c:\python\python38\lib\site-packages\beets\util\pipeline.py", line 445, in run_parallel
    six.reraise(exc_info[0], exc_info[1], exc_info[2])
  File "c:\python\python38\lib\site-packages\six.py", line 696, in reraise
    raise value
  File "c:\python\python38\lib\site-packages\beets\util\pipeline.py", line 312, in run
    out = self.coro.send(msg)
  File "c:\python\python38\lib\site-packages\beets\util\pipeline.py", line 194, in coro
    func(*(args + (task,)))
  File "c:\python\python38\lib\site-packages\beets\importer.py", line 1511, in plugin_stage
    func(session, task)
  File "c:\python\python38\lib\site-packages\beets\plugins.py", line 143, in wrapper
    return func(*args, **kwargs)
  File "c:\python\python38\lib\site-packages\beetsplug\lyrics.py", line 826, in imported
    self.fetch_item_lyrics(session.lib, item,
  File "c:\python\python38\lib\site-packages\beetsplug\lyrics.py", line 840, in fetch_item_lyrics
    lyrics = [self.get_lyrics(artist, title) for title in titles]
  File "c:\python\python38\lib\site-packages\beetsplug\lyrics.py", line 840, in <listcomp>
    lyrics = [self.get_lyrics(artist, title) for title in titles]
  File "c:\python\python38\lib\site-packages\beetsplug\lyrics.py", line 873, in get_lyrics
    lyrics = backend.fetch(artist, title)
  File "c:\python\python38\lib\site-packages\beetsplug\lyrics.py", line 403, in fetch
    return self.lyrics_from_song_api_path(song_api_path)
  File "c:\python\python38\lib\site-packages\beetsplug\lyrics.py", line 357, in lyrics_from_song_api_path
    json = response.json()
  File "c:\python\python38\lib\site-packages\requests\models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "c:\python\python38\lib\json\__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "c:\python\python38\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "c:\python\python38\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)

Setup

My configuration (output of beet config) is:

lyrics:
    bing_lang_from: []
    auto: yes
    bing_client_secret: REDACTED
    bing_lang_to:
    google_API_key: REDACTED
    google_engine_ID: REDACTED
    genius_api_key: REDACTED
    fallback:
    force: no
    local: no
    sources:
    - google
    - lyricwiki
    - musixmatch
    - genius
directory: J:\Organized
library: C:\Users\Oliver\Music\Beets\library.db

import:
    copy: no
    move: no
    write: yes
    asciify_paths: yes

paths:
    default: $format/$albumartist/[$original_year] $album%aunique{}/$track $title
    singleton: $format/Non-Album/$artist/[$original_year] $title
    comp: $format/Various Artists/[$original_year] $album%aunique{}/$track $title

plugins: lastgenre lyrics discogs
lastgenre:
    canonical: yes
    whitelist: yes
    min_weight: 10
    count: 1
    fallback:
    source: album
    force: yes
    auto: yes
    separator: ', '
    prefer_specific: no
discogs:
    apikey: REDACTED
    apisecret: REDACTED
    tokenfile: discogs_token.json
    source_weight: 0.5
    user_token: REDACTED
sampsyo commented 4 years ago

Thanks! This is an annoying bug… to help track it down, could you provide the verbose output for a crashing run?

FWIW, the error is in the Genius backend, so disabling that would work around the problem temporarily.

sposker commented 4 years ago

Sure, unfortunately we'll have to wait until it happens again because it's not a deterministic bug-- I simply ran the same command and it completed without errors. This is maybe the third time I've encountered the bug? But the same input has always worked on the next try.

sampsyo commented 4 years ago

Aha, OK, that's definitely useful to know. If it's intermittent, then maybe the thing to do is to just catch this error and suppress it or retry. But even so, seeing that verbose log with the context would be useful!

Thanks again.

stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.