Failing while fetching parts.snapcraft.io should be handled better
Metadata
Current evaluation
Remote-parts connection failures now produce a clear error and retry guidance; fixed by merged PR #1906 (commit 4e95b95ab).
Resolution: closed resolved
Reason: PR #1906 was merged and commit 4e95b95ab added handling for connection failures, replacing the raw requests traceback with an actionable message. The issue maintainer linked this PR as the proposed fix.
Evaluated by: mr-cal-bot
No scores available.
Issue body
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
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Remote-parts connection failures now produce a clear error and retry guidance; fixed by merged PR #1906 (commit 4e95b95ab). | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in canonical/snapcraft#1906 (commit 4e95b95ab): remote-parts connection failures now show a clear error and retry guidance instead of a raw traceback. | |
| stealth/space-bunny-alpha | — | closed resolved | Remote-parts connection failures were addressed by merged PR #1906 (commit 4e95b95ab), adding dedicated handling instead of exposing the raw requests exception. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without comments or resolution. No fix or merge details provided; likely abandoned or marked stale. | |
| qwen/qwen3.6-35b-a3b | — | — | Abandoned. The request to improve error handling for parts.snapcraft.io fetch failures was closed without implementation. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without comments or resolution. Likely abandoned or addressed in a subsequent release, as no fix or discussion was recorded. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without resolution. Zero comments indicate the report was abandoned or superseded, leaving the network error handling unaddressed. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
snapcraft#1906
(confidence 100%)
Merged PR #1906 implemented remote-parts connection-error handling and retry guidance.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #590 Integrate with new remote parts | snapcraft | merged | Merged PR #590 as commit 9c9fb6949, integrating Snapcraft with the new remote-parts service and updating part loading, caching, and related tests. | |
| #1816 snapcraft update won't fetch from `SNAPCRAFT_PARTS_URI` | snapcraft | closed | Superseded by Launchpad #1719928 and fixed by merged PR #1856 (commit 5a0a8c075), adding URI-specific remote-parts cache folders to prevent stale metadata collisions. |