Failing while fetching parts.snapcraft.io should be handled better

Bug #1746784 reported by Lucy Llewellyn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Won't Fix
Medium
Kyle Fazzari

Bug Description

When snapcraft fails to fetch parts.snapcraft.io there should be better handling or error messaging to allow the packager to continue working or to understand what the next steps are, which might just be to re-run the build.

---

The relevant messages from below are:

OSError: Tunnel connection failed: 503 Service Unavailable

and

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='parts.snapcraft.io', port=443): Max retries exceeded with url: /v1/parts.yaml (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 503 Service Unavailable',)))

---

Full error I received from build.snapcraft.io:

Running repo phase...
Cloning into '6ee01d1e891da75e9c9762fcafcb3c01-xenial'...
Running pull phase...
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 555, in urlopen
    self._prepare_proxy(conn)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 753, in _prepare_proxy
    conn.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 230, in connect
    self._tunnel()
  File "/usr/lib/python3.5/http/client.py", line 832, in _tunnel
    message.strip()))
OSError: Tunnel connection failed: 503 Service Unavailable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 376, in send
    timeout=timeout
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 610, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 273, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='parts.snapcraft.io', port=443): Max retries exceeded with url: /v1/parts.yaml (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 503 Service Unavailable',)))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/snapcraft", line 9, in <module>
    load_entry_point('snapcraft==2.35', 'console_scripts', 'snapcraft')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 542, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2569, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2229, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2235, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/__main__.py", line 19, in <module>
    run(prog_name='snapcraft')
  File "/usr/lib/python3/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 67, in pull
    _execute('pull', parts, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 34, in _execute
    lifecycle.execute(command, project_options, parts)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 61, in execute
    config = snapcraft.internal.load_config(project_options)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/project_loader/__init__.py", line 24, in load_config
    return Config(project_options)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/project_loader/_config.py", line 103, in __init__
    snapcraft_yaml = self._process_remote_parts(snapcraft_yaml)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/project_loader/_config.py", line 252, in _process_remote_parts
    properties = self._remote_parts.get_part(after_part)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/project_loader/_config.py", line 86, in _remote_parts
    self._remote_parts_attr = remote_parts.get_remote_parts()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/remote_parts.py", line 82, in get_remote_parts
    return _RemoteParts()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/remote_parts.py", line 135, in __init__
    update()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/remote_parts.py", line 41, in update
    _Update().execute()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/remote_parts.py", line 103, in execute
    headers=headers)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 67, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 53, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 468, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 576, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 437, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='parts.snapcraft.io', port=443): Max retries exceeded with url: /v1/parts.yaml (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 503 Service Unavailable',)))
Build failed

Revision history for this message
Kyle Fazzari (kyrofa) wrote :
Changed in snapcraft:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Kyle Fazzari (kyrofa)
Changed in snapcraft:
status: In Progress → Won't Fix
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.