beetbox / beets

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

httplib.BadStatusLine: '' when using beet import #1305

Closed willgrnr closed 9 years ago

willgrnr commented 9 years ago

I'm using only the discogs plugin and this import was using an ID from discogs.

Enter release ID: 5794582
Traceback (most recent call last):
  File "C:\Python27\Scripts\beet-script.py", line 9, in <module>
    load_entry_point('beets==1.3.11', 'console_scripts', 'beet')()
  File "c:\users\100557855\src\beets\beets\ui\__init__.py", line 953, in main
    _raw_main(args)
  File "c:\users\100557855\src\beets\beets\ui\__init__.py", line 943, in _raw_ma
in
    subcommand.func(lib, suboptions, subargs)
  File "c:\users\100557855\src\beets\beets\ui\commands.py", line 874, in import_
func
    import_files(lib, paths, query)
  File "c:\users\100557855\src\beets\beets\ui\commands.py", line 851, in import_
files
    session.run()
  File "c:\users\100557855\src\beets\beets\importer.py", line 316, in run
    pl.run_parallel(QUEUE_SIZE)
  File "c:\users\100557855\src\beets\beets\util\pipeline.py", line 301, in run
    out = self.coro.send(msg)
  File "c:\users\100557855\src\beets\beets\util\pipeline.py", line 183, in coro
    func(*(args + (task,)))
  File "c:\users\100557855\src\beets\beets\importer.py", line 1236, in lookup_ca
ndidates
    task.lookup_candidates()
  File "c:\users\100557855\src\beets\beets\importer.py", line 567, in lookup_can
didates
    autotag.tag_album(self.items)
  File "c:\users\100557855\src\beets\beets\autotag\match.py", line 433, in tag_a
lbum
    search_album, va_likely)
  File "c:\users\100557855\src\beets\beets\autotag\hooks.py", line 563, in album
_candidates
    out.extend(plugins.candidates(items, artist, album, va_likely))
  File "c:\users\100557855\src\beets\beets\plugins.py", line 360, in candidates
    out.extend(plugin.candidates(items, artist, album, va_likely))
  File "c:\users\100557855\src\beets\beetsplug\discogs.py", line 125, in candida
tes
    return self.get_albums(query)
  File "c:\users\100557855\src\beets\beetsplug\discogs.py", line 177, in get_alb
ums
    return [self.get_album_info(release) for release in releases[:5]]
  File "c:\users\100557855\src\beets\beetsplug\discogs.py", line 182, in get_alb
um_info
    artist, artist_id = self.get_artist([a.data for a in result.artists])
  File "C:\Python27\lib\site-packages\discogs_client\models.py", line 96, in __g
et__
    return [wrapper_class(instance.client, d) for d in instance.fetch(self.name,
 [])]
  File "C:\Python27\lib\site-packages\discogs_client\models.py", line 237, in fe
tch
    self.refresh()
  File "C:\Python27\lib\site-packages\discogs_client\models.py", line 203, in re
fresh
    data = self.client._get(self.data['resource_url'])
  File "C:\Python27\lib\site-packages\discogs_client\client.py", line 110, in _g
et
    return self._request('GET', url)
  File "C:\Python27\lib\site-packages\discogs_client\client.py", line 97, in _re
quest
    content, status_code = self._fetcher.fetch(self, method, url, data=data, hea
ders=headers)
  File "C:\Python27\lib\site-packages\discogs_client\fetchers.py", line 73, in f
etch
    resp, content = self.oauth_client.request(url, method, headers=headers)
  File "C:\Python27\lib\site-packages\oauth2\__init__.py", line 682, in request
    connection_type=connection_type)
  File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 1593, in reque
st
    (response, content) = self._request(conn, authority, uri, request_uri, metho
d, body, headers, redirections, cachekey)
  File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 1335, in _requ
est
    (response, content) = self._conn_request(conn, request_uri, method, body, he
aders)
  File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 1291, in _conn
_request
    response = conn.getresponse()
  File "C:\Python27\lib\httplib.py", line 1074, in getresponse
    response.begin()
  File "C:\Python27\lib\httplib.py", line 415, in begin
    version, status, reason = self._read_status()
  File "C:\Python27\lib\httplib.py", line 379, in _read_status
    raise BadStatusLine(line)
httplib.BadStatusLine: ''
sampsyo commented 9 years ago

Ugh, more exposed bugs from the discogs library, like #1299. I'll handle this one too.

sampsyo commented 9 years ago

Can you please confirm that this (and #1299) is fixed?

willgrnr commented 9 years ago

I haven't been able to replicate the original issue, however I've found a new one. If you'd like me to open a new issue I can.

Enter release ID: 707709
Traceback (most recent call last):
  File "C:\Python27\Scripts\beet-script.py", line 9, in <module>
    load_entry_point('beets==1.3.11', 'console_scripts', 'beet')()
  File "c:\users\100557855\src\beets\beets\ui\__init__.py", line 953, in main
    _raw_main(args)
  File "c:\users\100557855\src\beets\beets\ui\__init__.py", line 943, in _raw_ma
in
    subcommand.func(lib, suboptions, subargs)
  File "c:\users\100557855\src\beets\beets\ui\commands.py", line 874, in import_
func
    import_files(lib, paths, query)
  File "c:\users\100557855\src\beets\beets\ui\commands.py", line 851, in import_
files
    session.run()
  File "c:\users\100557855\src\beets\beets\importer.py", line 316, in run
    pl.run_parallel(QUEUE_SIZE)
  File "c:\users\100557855\src\beets\beets\util\pipeline.py", line 301, in run
    out = self.coro.send(msg)
  File "c:\users\100557855\src\beets\beets\util\pipeline.py", line 183, in coro
    func(*(args + (task,)))
  File "c:\users\100557855\src\beets\beets\importer.py", line 1236, in lookup_ca
ndidates
    task.lookup_candidates()
  File "c:\users\100557855\src\beets\beets\importer.py", line 567, in lookup_can
didates
    autotag.tag_album(self.items)
  File "c:\users\100557855\src\beets\beets\autotag\match.py", line 433, in tag_a
lbum
    search_album, va_likely)
  File "c:\users\100557855\src\beets\beets\autotag\hooks.py", line 563, in album
_candidates
    out.extend(plugins.candidates(items, artist, album, va_likely))
  File "c:\users\100557855\src\beets\beets\plugins.py", line 360, in candidates
    out.extend(plugin.candidates(items, artist, album, va_likely))
  File "c:\users\100557855\src\beets\beetsplug\discogs.py", line 129, in candida
tes
    return self.get_albums(query)
  File "c:\users\100557855\src\beets\beetsplug\discogs.py", line 180, in get_alb
ums
    releases = self.discogs_client.search(query, type='release').page(1)
  File "C:\Python27\lib\site-packages\discogs_client\models.py", line 336, in pa
ge
    data = self.client._get(self._url_for_page(index))
  File "C:\Python27\lib\site-packages\discogs_client\client.py", line 110, in _g
et
    return self._request('GET', url)
  File "C:\Python27\lib\site-packages\discogs_client\client.py", line 102, in _r
equest
    body = json.loads(content)
  File "C:\Python27\lib\json\__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "C:\Python27\lib\json\decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Python27\lib\json\decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
sampsyo commented 9 years ago

Wow! You are finding so many bugs in the official Discogs library! They should give you some sort of medal. I'll keep filing bugs over there, I guess…

willgrnr commented 9 years ago

Lucky me..?