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

fetchart: Handle exceptions in Google backend #1579

Closed
randybias opened this issue Aug 25, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@randybias
Copy link

commented Aug 25, 2015

With a big library if you force a fetchart there is a good chance that a connection is reset and unfortunately, this case isn't handled with some basic retrying:

fetchart: The Chemical Brothers - The Private Psychedelic Reel: found album art
fetchart: The Chemical Brothers - We Are the Night: found album art
Traceback (most recent call last):
  File "/usr/local/bin/beet", line 9, in <module>
    load_entry_point('beets==1.3.15', 'console_scripts', 'beet')()
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets-1.3.15-py2.7.egg/beets/ui/__init__.py", line 1161, in main
    _raw_main(args)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets-1.3.15-py2.7.egg/beets/ui/__init__.py", line 1151, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets-1.3.15-py2.7.egg/beetsplug/fetchart.py", line 412, in func
    self.batch_fetch_art(lib, lib.albums(ui.decargs(args)), opts.force)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets-1.3.15-py2.7.egg/beetsplug/fetchart.py", line 513, in batch_fetch_art
    path = self.art_for_album(album, local_paths)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets-1.3.15-py2.7.egg/beetsplug/fetchart.py", line 487, in art_for_album
    for url in self._source_urls(album):
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets-1.3.15-py2.7.egg/beetsplug/fetchart.py", line 532, in _source_urls
    for url in urls:
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/beets-1.3.15-py2.7.egg/beetsplug/fetchart.py", line 125, in get
    'start': '0',
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 473, in get
    return self.request('GET', url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 461, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 573, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/adapters.py", line 415, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(54, 'Connection reset by peer'))

@randybias randybias changed the title fetcher doesn't retry fetchart doesn't retry Aug 25, 2015

@sampsyo sampsyo changed the title fetchart doesn't retry fetchart: Handle exceptions in Google backend Aug 25, 2015

@sampsyo sampsyo added the bug label Aug 25, 2015

@sampsyo

This comment has been minimized.

Copy link
Member

commented Aug 25, 2015

Thanks. Looks like a bug specifically in the Google backend, which doesn't catch any exceptions for its search request:
https://github.com/sampsyo/beets/blob/master/beetsplug/fetchart.py#L122

We do have error handling for most cases:
https://github.com/sampsyo/beets/blob/master/beetsplug/fetchart.py#L439

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.