whipper icon indicating copy to clipboard operation
whipper copied to clipboard

Handle FreeDB's connection failures more gracefully

Open lawiedc opened this issue 5 years ago • 4 comments

Running on Ubuntu 18.04, using a docker pull image. When a disc is found in MusicBrainz, whipper works correctly, but when there is no match, it crashes in freedb_command. It looks like gnudb.gnudb.org may be misconfigured at the moment - but my read of the code suggests whipper should "fail gracefully". Not sure how to fix this.

`whipper cd rip -U INFO:whipper.command.cd:using configured read offset 6 INFO:whipper.command.cd:checking device /dev/cdrom WARNING:whipper.program.utils:command 'eject -t /dev/cdrom' returned with exit code '1' (b'eject: CD-ROM tray close command failed: Input/output error') CDDB disc id: 340fe716 MusicBrainz disc id hbVl1HmM9DuFTmU7W7q90qAB_jc- MusicBrainz lookup URL https://musicbrainz.org/cdtoc/attach?toc=1+22+305485+150+11982+25877+35360+49115+60500+70647+83300+95770+107817+119372+135082+147082+163440+180572+195295+214360+228227+246357+258635+278310+291302&tracks=22&id=hbVl1HmM9DuFTmU7W7q90qAB_jc- Disc duration: 01:07:51.133, 22 audio tracks WARNING:whipper.common.program:release not found: (NotFoundException(ResponseError()),) WARNING:whipper.common.program:continuing without metadata Submit this disc to MusicBrainz at the above URL.

Traceback (most recent call last): File "/usr/local/bin/whipper", line 11, in load_entry_point('whipper==0.9.0', 'console_scripts', 'whipper')() File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.0-py3.7-linux-x86_64.egg/whipper/command/main.py", line 43, in main ret = cmd.do() File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.0-py3.7-linux-x86_64.egg/whipper/command/basecommand.py", line 139, in do return self.cmd.do() File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.0-py3.7-linux-x86_64.egg/whipper/command/basecommand.py", line 139, in do return self.cmd.do() File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.0-py3.7-linux-x86_64.egg/whipper/command/cd.py", line 119, in do cddbmd = self.program.getCDDB(cddbid) File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.0-py3.7-linux-x86_64.egg/whipper/common/program.py", line 256, in getCDDB return [item['DTITLE'] for item in md if 'DTITLE' in item] or None File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.0-py3.7-linux-x86_64.egg/whipper/common/program.py", line 256, in return [item['DTITLE'] for item in md if 'DTITLE' in item] or None File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.0-py3.7-linux-x86_64.egg/whipper/extern/freedb.py", line 89, in perform_lookup line = next(query) File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.0-py3.7-linux-x86_64.egg/whipper/extern/freedb.py", line 189, in freedb_command urlencode(POST).encode()) File "/usr/lib/python3.7/urllib/request.py", line 222, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.7/urllib/request.py", line 525, in open response = self._open(req, data) File "/usr/lib/python3.7/urllib/request.py", line 543, in _open '_open', req) File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain result = func(*args) File "/usr/lib/python3.7/urllib/request.py", line 1352, in http_open return self.do_open(http.client.HTTPConnection, req) File "/usr/lib/python3.7/urllib/request.py", line 1327, in do_open r = h.getresponse() File "/usr/lib/python3.7/http/client.py", line 1336, in getresponse response.begin() File "/usr/lib/python3.7/http/client.py", line 306, in begin version, status, reason = self._read_status() File "/usr/lib/python3.7/http/client.py", line 275, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response `

lawiedc avatar Dec 28 '20 16:12 lawiedc

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing instructions.

github-actions[bot] avatar Dec 28 '20 16:12 github-actions[bot]

Hi, I'm not sure but I suppose this could be caused by the following issue:

gnudb.org:

Important info written on December the 20. Sorry for any inconvenience, but I have had a technical problem. A router has failed which have caused some instability over the last week. It has been replaced on December the 19. and I have been working on configuring the new router. I hope that all services are up and running.

It looks like a transitory issue.

JoeLametta avatar Jan 31 '21 17:01 JoeLametta

Hi - I agree the specific issue is likely transitory; was just a suggestion to catch the error gracefully.

lawiedc avatar Feb 01 '21 18:02 lawiedc

I've renamed the issue and labeled it as accepted.

JoeLametta avatar Feb 09 '21 15:02 JoeLametta