beetbox / beets

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

Fetchart stacktrace #3163

Closed mgerhardy closed 5 years ago

mgerhardy commented 5 years ago

Problem

Got a crash while trying to import (beet import -m folder) music into my library. It worked perfectly before and it looks like it doesn't happen anymore. I still think this might be worth a look as the stacktrace indicates a problem with data type conversions that others may hit, too.

Traceback (most recent call last):
  File "/usr/bin/beet", line 11, in <module>
    load_entry_point('beets==1.4.7', 'console_scripts', 'beet')()
  File "/usr/share/beets/beets/ui/__init__.py", line 1256, in main
    _raw_main(args)
  File "/usr/share/beets/beets/ui/__init__.py", line 1243, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/usr/share/beets/beets/ui/commands.py", line 943, in import_func
    import_files(lib, paths, query)
  File "/usr/share/beets/beets/ui/commands.py", line 913, in import_files
    session.run()
  File "/usr/share/beets/beets/importer.py", line 329, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/usr/share/beets/beets/util/pipeline.py", line 445, in run_parallel
    six.reraise(exc_info[0], exc_info[1], exc_info[2])
  File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise
    raise value
  File "/usr/share/beets/beets/util/pipeline.py", line 312, in run
    out = self.coro.send(msg)
  File "/usr/share/beets/beets/util/pipeline.py", line 194, in coro
    func(*(args + (task,)))
  File "/usr/share/beets/beets/importer.py", line 1511, in plugin_stage
    func(session, task)
  File "/usr/share/beets/beets/plugins.py", line 140, in wrapper
    return func(*args, **kwargs)
  File "/usr/share/beets/beetsplug/fetchart.py", line 807, in fetch_art
    candidate = self.art_for_album(task.album, task.paths, local)
  File "/usr/share/beets/beetsplug/fetchart.py", line 873, in art_for_album
    for candidate in source.get(album, self, paths):
  File "/usr/share/beets/beetsplug/fetchart.py", line 416, in get
    self.API_ALBUMS + album.mb_releasegroupid,
TypeError: can only concatenate str (not "int") to str

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

plugins: fetchart embedart chroma fromfilename discogs ftintitle fuzzy missing permissions lyrics replaygain
directory: /mnt/data/mymusic
library: /mnt/data/mymusic/beet.db

import:
    copy: yes
    write: yes
    log: /mnt/data/beetslog.txt
threaded: yes

ui:
    color: yes
    colors:
        text_success: green
        text_warning: yellow
        text_error: red
        text_highlight: red
        text_highlight_minor: lightgray
        action_default: turquoise
        action: blue
asciify_paths: yes
quiet_fallback: skip

match:
    strong_rec_thresh: 0.06
duplicate_action: skip

paths:
    default: '%lower{$albumartist/$album%aunique{}/$track} %lower{$title}'
    singleton: '%lower{Non-Album/$artist/$title}'
    comp: '%lower{Compilations/$album%aunique{}/$track} %lower{$title}'

replace:
    '[\\/]': _
    ^\.: ''
    '"': ''
    ',': ''
    "\xFC": ue
    "\xE4": ae
    "\xDF": ss
    "\xF6": oe
    \?: ''
    '&': und
    \?\?\?: Fragezeichen
    '!!!': Ausrufezeichen
    '[\x00-\x1f]': _
    '[<>:"\*\|]': _
    \.$: _
    \s+$: ''
    ^\s+: ''
    ^-: ''
    \s: _
permissions:
    file: 644
    dir: 755
fetchart:
    cautious: yes
    cover_names: front back
    sources: amazon *
    auto: yes
    minwidth: 0
    maxwidth: 0
    enforce_ratio: no
    google_key: REDACTED
    google_engine: 001442825323518660753:hrh5ch1gjzm
    fanarttv_key: REDACTED
    store_source: no
replaygain:
    backend: gstreamer
    overwrite: no
    auto: yes
    targetlevel: 89
    r128: [Opus]
chroma:
    auto: yes
ftintitle:
    auto: yes
    drop: no
    format: feat. {0}
discogs:
    apikey: REDACTED
    apisecret: REDACTED
    tokenfile: discogs_token.json
    source_weight: 0.5
    user_token: REDACTED
embedart:
    maxwidth: 0
    auto: yes
    compare_threshold: 0
    ifempty: no
    remove_art_file: no
fuzzy:
    prefix: '~'
    threshold: 0.7
missing:
    count: no
    total: no
    album: no
jackwilsdon commented 5 years ago

Weird! The mb_releasegroupid should certainly be a string, so there's definitely some nonsense going on there.

Could you replicate it more than once? If so, was it the same album every time? Have you changed anything that could have inadvertently fixed it?

mgerhardy commented 5 years ago

It was the same album and it happened always. I will try to extract more information. Give me a few minutes please.

mgerhardy commented 5 years ago

This is weird - importing the same album again - and now it works without a problem. I tried it 3 times before and it always failed. So I skipped it from my import and continued with other stuff first. And now the problem has gone away. Sorry.

jackwilsdon commented 5 years ago

I think we can probably close this, as it seems like a potentially one-off event. Please feel free to leave a reply if this happens again and it can be reopened.

nick-robo commented 3 years ago

I had the same issue.

 Correcting tags from:
    Julie Tippetts - Sunset Glow [AIRAC-1115]
To:
    Julie Tippetts - Sunset Glow
URL:
    https://www.discogs.com/Julie-Tippetts-Sunset-Glow/release/2062494
(Similarity: 93.0%) (source, album, tracks) (Discogs, CD, 2005, Japan, Air Mail Archive, AIRAC-1115)
 * Oceans And Sky (And Questions Why?) -> Ocean And Sky (And Questions Why?) (title)
 * Lilies                              -> Lillies (title)
 * Behind The Eyes (For A Friend, R)   -> Behind The Eyes (title)
[A]pply, More candidates, Skip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort, eDit, edit Candidates? a
Traceback (most recent call last):
  File "/home/main/.local/bin/beet", line 10, in <module>
    sys.exit(main())
  File "/home/main/.local/lib/python3.7/site-packages/beets/ui/__init__.py", line 1266, in main
    _raw_main(args)
  File "/home/main/.local/lib/python3.7/site-packages/beets/ui/__init__.py", line 1253, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/home/main/.local/lib/python3.7/site-packages/beets/ui/commands.py", line 955, in import_func
    import_files(lib, paths, query)
  File "/home/main/.local/lib/python3.7/site-packages/beets/ui/commands.py", line 925, in import_files
    session.run()
  File "/home/main/.local/lib/python3.7/site-packages/beets/importer.py", line 329, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/home/main/.local/lib/python3.7/site-packages/beets/util/pipeline.py", line 445, in run_parallel
    six.reraise(exc_info[0], exc_info[1], exc_info[2])
  File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise
    raise value
  File "/home/main/.local/lib/python3.7/site-packages/beets/util/pipeline.py", line 312, in run
    out = self.coro.send(msg)
  File "/home/main/.local/lib/python3.7/site-packages/beets/util/pipeline.py", line 194, in coro
    func(*(args + (task,)))
  File "/home/main/.local/lib/python3.7/site-packages/beets/importer.py", line 1511, in plugin_stage
    func(session, task)
  File "/home/main/.local/lib/python3.7/site-packages/beets/plugins.py", line 143, in wrapper
    return func(*args, **kwargs)
  File "/home/main/.local/lib/python3.7/site-packages/beetsplug/fetchart.py", line 854, in fetch_art
    candidate = self.art_for_album(task.album, task.paths, local)
  File "/home/main/.local/lib/python3.7/site-packages/beetsplug/fetchart.py", line 920, in art_for_album
    for candidate in source.get(album, self, paths):
  File "/home/main/.local/lib/python3.7/site-packages/beetsplug/fetchart.py", line 416, in get
    self.API_ALBUMS + album.mb_releasegroupid,
TypeError: can only concatenate str (not "int") to str
nick-robo commented 3 years ago

And again.

Tagging:
    Cornelius Cardew - Treatise
URL:
    https://www.discogs.com/Cornelius-Cardew-Treatise/release/900238
(Similarity: 92.7%) (source, tracks) (Discogs, 2xCD, 1999, Switzerland, hat[now]ART, hat[now]ART 2-122)
CD 1
 * Treatise part 1      -> Treatise (title)
 * Treatise part 2      -> Treatise (title)
 * Treatise Part 3      -> Treatise (title)
CD 2
 * Treatise part 4 (#1) -> Treatise (#4) (title)
 * Treatise part 5 (#2) -> Treatise (#5) (title)
 * Treatise part 6 (#3) -> Treatise (#6) (title)
[A]pply, More candidates, Skip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort, eDit, edit Candidates? a
Traceback (most recent call last):
  File "/home/main/.local/bin/beet", line 10, in <module>
    sys.exit(main())
  File "/home/main/.local/lib/python3.7/site-packages/beets/ui/__init__.py", line 1266, in main
    _raw_main(args)
  File "/home/main/.local/lib/python3.7/site-packages/beets/ui/__init__.py", line 1253, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/home/main/.local/lib/python3.7/site-packages/beets/ui/commands.py", line 955, in import_func
    import_files(lib, paths, query)
  File "/home/main/.local/lib/python3.7/site-packages/beets/ui/commands.py", line 925, in import_files
    session.run()
  File "/home/main/.local/lib/python3.7/site-packages/beets/importer.py", line 329, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/home/main/.local/lib/python3.7/site-packages/beets/util/pipeline.py", line 445, in run_parallel
    six.reraise(exc_info[0], exc_info[1], exc_info[2])
  File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise
    raise value
  File "/home/main/.local/lib/python3.7/site-packages/beets/util/pipeline.py", line 312, in run
    out = self.coro.send(msg)
  File "/home/main/.local/lib/python3.7/site-packages/beets/util/pipeline.py", line 194, in coro
    func(*(args + (task,)))
  File "/home/main/.local/lib/python3.7/site-packages/beets/importer.py", line 1511, in plugin_stage
    func(session, task)
  File "/home/main/.local/lib/python3.7/site-packages/beets/plugins.py", line 143, in wrapper
    return func(*args, **kwargs)
  File "/home/main/.local/lib/python3.7/site-packages/beetsplug/fetchart.py", line 854, in fetch_art
    candidate = self.art_for_album(task.album, task.paths, local)
  File "/home/main/.local/lib/python3.7/site-packages/beetsplug/fetchart.py", line 920, in art_for_album
    for candidate in source.get(album, self, paths):
  File "/home/main/.local/lib/python3.7/site-packages/beetsplug/fetchart.py", line 416, in get
    self.API_ALBUMS + album.mb_releasegroupid,
TypeError: can only concatenate str (not "int") to str
nick-robo commented 3 years ago

It seems to have something to do with using discogs as the source, because when I manually enter the musicbrainz id it works fine.

sampsyo commented 3 years ago

Hi! If you have a way that we can reproduce this reliably, can you please open a new issue?

nick-robo commented 3 years ago

Well to reproduce it you would have to have my files. All I know is that it occurs with a discogs source sporadically.