Nicely handle the missing connectivity case

Bug #1201827 reported by Stéphane Graber
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu system image
Invalid
Medium
Unassigned

Bug Description

Currently when running system-image-cli on a system without internet access, I get 2-3 stacktraces with the most relevant one showing a no route to host, I think this may be worth catching and showing a single error message saying that the update server can't be reached.

Tags: client
tags: added: client
Revision history for this message
Barry Warsaw (barry) wrote : Re: [Bug 1201827] [NEW] Nicely handle the missing connectivity case

On Jul 16, 2013, at 02:37 PM, Stéphane Graber wrote:

>Currently when running system-image-cli on a system without internet
>access, I get 2-3 stacktraces with the most relevant one showing a no
>route to host, I think this may be worth catching and showing a single
>error message saying that the update server can't be reached.

Can you paste the traceback? This will almost certainly change anyway when
the dbus d/l service is integrated.

Changed in ubuntu-system-image:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Stéphane Graber (stgraber) wrote :
Download full text (3.2 KiB)

root@ubuntu-phablet:/# system-image-cli
Jul 16 15:12:32 2013 (1618) uncaught exception in state machine
Traceback (most recent call last):
  File "/usr/lib/python3.3/urllib/request.py", line 1248, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
  File "/usr/lib/python3.3/http/client.py", line 1061, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.3/http/client.py", line 1099, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.3/http/client.py", line 1057, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.3/http/client.py", line 902, in _send_output
    self.send(msg)
  File "/usr/lib/python3.3/http/client.py", line 840, in send
    self.connect()
  File "/usr/lib/python3.3/http/client.py", line 1194, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python3.3/socket.py", line 435, in create_connection
    raise err
  File "/usr/lib/python3.3/socket.py", line 426, in create_connection
    sock.connect(sa)
OSError: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/systemimage/download.py", line 172, in get_files
    list(tpe.map(_get_one_file, args))
  File "/usr/lib/python3.3/concurrent/futures/_base.py", line 546, in result_iterator
    yield future.result()
  File "/usr/lib/python3.3/concurrent/futures/_base.py", line 399, in result
    return self.__get_result()
  File "/usr/lib/python3.3/concurrent/futures/_base.py", line 351, in __get_result
    raise self._exception
  File "/usr/lib/python3.3/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3/dist-packages/systemimage/download.py", line 73, in _get_one_file
    response = stack.enter_context(Downloader(url, timeout))
  File "/usr/lib/python3.3/contextlib.py", line 216, in enter_context
    result = _cm_type.__enter__(cm)
  File "/usr/lib/python3/dist-packages/systemimage/download.py", line 58, in __enter__
    urlopen(request, timeout=self.timeout, cadefault=True))
  File "/usr/lib/python3.3/urllib/request.py", line 156, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.3/urllib/request.py", line 469, in open
    response = self._open(req, data)
  File "/usr/lib/python3.3/urllib/request.py", line 487, in _open
    '_open', req)
  File "/usr/lib/python3.3/urllib/request.py", line 447, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.3/urllib/request.py", line 1283, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/usr/lib/python3.3/urllib/request.py", line 1251, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 101] Network is unreachable>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/systemimage/state.py", line 92, in __next__
    step()
  File "/usr/lib/python3/dist-packages/systemimage/state.py", line 223, in _get_channel
    (asc_url, asc_path),
  File "/usr/li...

Read more...

Changed in ubuntu-system-image:
importance: High → Medium
Revision history for this message
Barry Warsaw (barry) wrote :

So, I'm going to mark this bug as Invalid since the integration of u-d-m changes everything, and should greatly improve the situation. If it crops up again, let's open a new bug.

Changed in ubuntu-system-image:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.