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

Catch DNS error #206

Closed
NicoHood opened this issue Nov 30, 2017 · 2 comments
Closed

Catch DNS error #206

NicoHood opened this issue Nov 30, 2017 · 2 comments
Labels
Bug Generic bug: can be used together with more specific labels

Comments

@NicoHood
Copy link

I temporary had no DNS server (or internet) connection. whipper crashed. This exception could be caught.

$ whipper offset find
Checking device /dev/sr0
eject: CD-ROM tray close command failed: Input/output error
Traceback (most recent call last):
  File "/usr/bin/whipper", line 11, in <module>
    load_entry_point('whipper==0.5.1', 'console_scripts', 'whipper')()
  File "/usr/lib/python2.7/site-packages/morituri/command/main.py", line 31, in main
    ret = cmd.do()
  File "/usr/lib/python2.7/site-packages/morituri/command/basecommand.py", line 123, in do
    return self.cmd.do()
  File "/usr/lib/python2.7/site-packages/morituri/command/basecommand.py", line 123, in do
    return self.cmd.do()
  File "/usr/lib/python2.7/site-packages/morituri/command/offset.py", line 106, in do
    handle = urllib2.urlopen(url)
  File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1228, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1198, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno -2] Name or service not known>
@JoeLametta JoeLametta added the Bug Generic bug: can be used together with more specific labels label Jan 26, 2018
@JoeLametta
Copy link
Collaborator

I think whipper changed in the meantime: this error may be not relevant anymore.
I'm closing this issue: if you still experience it in current whipper versions, please reopen it.

@anarcat
Copy link
Contributor

anarcat commented Oct 5, 2018

i've experienced this here just today:

curie:unknown130$ whipper cd rip --cdr --unknown
[sudo] Mot de passe de anarcat : 
Using configured read offset 6
Checking device /dev/cdrom
eject: CD-ROM tray close command failed: Input/output error
Reading TOC...
CDDB disc id: 540a361b
MusicBrainz disc id 4J3MwXKuivOKttzdzt8Zg9dpYVg-
MusicBrainz lookup URL https://musicbrainz.org/cdtoc/attach?toc=1+27+196207+150+12896+32439+39362+43428+68467+96072+105003+128041+151682+169720+171173+171625+172077+172529+172981+173433+177460+180318+183809+184261+184713+185165+185617+186069+189430+192331&tracks=27&id=4J3MwXKuivOKttzdzt8Zg9dpYVg-
Disc duration: 00:43:34.093, 27 audio tracks
WARNING:whipper.common.program:release not found: NotFoundException(ResponseError(),)
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 <module>
    load_entry_point('whipper==0.7.0', 'console_scripts', 'whipper')()
  File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/command/main.py", line 36, in main
    ret = cmd.do()
  File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/command/basecommand.py", line 139, in do
    return self.cmd.do()
  File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/command/basecommand.py", line 139, in do
    return self.cmd.do()
  File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/command/cd.py", line 120, in do
    cddbmd = self.program.getCDDB(cddbid)
  File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/common/program.py", line 252, in getCDDB
    return [item['DTITLE'] for item in md if 'DTITLE' in item] or None
  File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/extern/freedb.py", line 99, in perform_lookup
    line = next(query)
  File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/extern/freedb.py", line 210, in freedb_command
    urlencode(POST))
  File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1228, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1198, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 111] Connection refused>

I think the freedb client should catch urllib2.URLError exceptions more gracefully...

anarcat added a commit to anarcat/whipper that referenced this issue Oct 5, 2018
In my repeated tests, I ended up upsetting freedb.org, which started
issuing 502 errors. Those errors are not correctly caught by the
program which just crashes with a backtrace. Instead, we handle those
like any other API error, which can already be generated by
perform_lookup (but not handled).

The visible result for the user is that the CD is simply not found on
FreeDB, an acceptable compromise, in my opinion.

Closes: whipper-team#206
@JoeLametta JoeLametta reopened this Oct 6, 2018
JoeLametta pushed a commit that referenced this issue Oct 6, 2018
* handle FreeDB server errors gracefully

In my repeated tests, I ended up upsetting freedb.org, which started
issuing 502 errors. Those errors are not correctly caught by the
program which just crashes with a backtrace. Instead, we handle those
like any other API error, which can already be generated by
perform_lookup (but not handled).

The visible result for the user is that the CD is simply not found on
FreeDB, an acceptable compromise, in my opinion.

Closes: #206

* harmonize an error message with other warnings

... which are all capitalized.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Generic bug: can be used together with more specific labels
Projects
None yet
Development

No branches or pull requests

3 participants