← Back to issue list

Snapcraft lies when submission to sentry fails

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1791968
Type
issue
State
closed
Author
~ev
Labels
—
Created
Updated
Closed

Current evaluation

Snapcraft now handles Sentry submission failures gracefully instead of falsely reporting success. Fix merged in canonical/snapcraft#2271 via commit 859c111e5.

Resolution: closed resolved

Reason: The linked fix was merged as canonical/snapcraft#2271 in commit 859c111e5, adding graceful handling for errors encountered while submitting reports.

Evaluated by: mr-cal-bot

No scores available.

Issue body

``` Fetched 48.7 kB in 0s (0 B/s) Pulling snapcraft We would appreciate it if you anonymously reported this issue. No other data than the traceback ('/tmp/tmp2nne0_xo/trace.txt') and the version of snapcraft in use will be sent. Would you like to send this error data? (Yes/No/Always) [no]: Yes Sentry responded with an error: HTTPSConnectionPool(host='sentry.io', port=443): Max retries exceeded with url: /api/277754/store/ (Caused by ConnectTimeoutError(<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f59edf9d208>, 'Connection to sentry.io timed out. (connect timeout=5)')) (url: https://sentry.io/api/277754/store/) Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 137, in _new_conn (self.host, self.port), self.timeout, **extra_kw) File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 91, in create_connection raise err File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 81, in create_connection sock.connect(sa) socket.timeout: timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 560, in urlopen body=body, headers=headers) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 346, in _make_request self._validate_conn(conn) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 787, in _validate_conn conn.connect() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 217, in connect conn = self._new_conn() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 142, in _new_conn (self.host, self.timeout)) requests.packages.urllib3.exceptions.ConnectTimeoutError: (<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f59edf9d208>, 'Connection to sentry.io timed out. (connect timeout=5)') 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='sentry.io', port=443): Max retries exceeded with url: /api/277754/store/ (Caused by ConnectTimeoutError(<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f59edf9d208>, 'Connection to sentry.io timed out. (connect timeout=5)')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/raven/base.py", line 735, in send_remote transport.send(url, data, headers) File "/usr/local/lib/python3.5/dist-packages/raven/transport/requests.py", line 35, in send verify=self.verify_ssl, timeout=self.timeout) File "/usr/lib/python3/dist-packages/requests/api.py", line 107, in post return request('post', url, data=data, json=json, **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/local/lib/python3.5/dist-packages/raven/breadcrumbs.py", line 326, in send resp = real_send(self, request, *args, **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 432, in send raise ConnectTimeout(e, request=request) requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='sentry.io', port=443): Max retries exceeded with url: /api/277754/store/ (Caused by ConnectTimeoutError(<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f59edf9d208>, 'Connection to sentry.io timed out. (connect timeout=5)')) ["FileExistsError: [Errno 17] File exists: 'hidden_snapcraft_yaml' -> '/Users/ev/Branches/snapcraft/parts/snapcraft/src/tests/integration/wiki/origin_options_snapcraft_yaml'", ' File "bin/snapcraft", line 9, in <module>', ' File "click/core.py", line 716, in __call__', ' File "click/core.py", line 696, in main', ' File "click/core.py", line 1037, in invoke', ' File "click/core.py", line 889, in invoke', ' File "click/core.py", line 534, in invoke', ' File "click/decorators.py", line 17, in new_func', ' File "snapcraft/cli/_runner.py", line 93, in run', ' File "click/core.py", line 552, in forward', ' File "click/core.py", line 534, in invoke', ' File "snapcraft/cli/lifecycle.py", line 136, in snap', ' File "snapcraft/cli/lifecycle.py", line 35, in _execute', ' File "snapcraft/internal/lifecycle/_runner.py", line 90, in execute', ' File "snapcraft/internal/lifecycle/_runner.py", line 194, in run', ' File "snapcraft/internal/lifecycle/_runner.py", line 208, in _handle_step', ' File "snapcraft/internal/lifecycle/_runner.py", line 250, in _run_pull', ' File "snapcraft/internal/lifecycle/_runner.py", line 327, in _run_step', ' File "snapcraft/internal/pluginhandler/__init__.py", line 415, in pull', ' File "snapcraft/internal/pluginhandler/_runner.py", line 83, in pull', ' File "snapcraft/internal/pluginhandler/_runner.py", line 162, in _run_scriptlet', ' File "snapcraft/internal/pluginhandler/_runner.py", line 218, in _handle_builtin_function', ' File "snapcraft/internal/pluginhandler/__init__.py", line 434, in _do_pull', ' File "snapcraft/internal/sources/_local.py", line 40, in pull', ' File "snapcraft/file_utils.py", line 250, in link_or_copy_tree', ' File "snapcraft/file_utils.py", line 117, in link_or_copy', ' File "snapcraft/file_utils.py", line 166, in copy', ' File "python3.5/shutil.py", line 251, in copy2', ' File "python3.5/shutil.py", line 112, in copyfile'] Thank you, sent. ``` As shown above, the Sentry report was not sent. _submit_trace() has no error checking that I can see.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Snapcraft now handles Sentry submission failures gracefully instead of falsely reporting success. Fix merged in canonical/snapcraft#2271 via commit 859c111e5.
stealth/space-bunny-alpha — closed resolved Snapcraft no longer falsely confirms delivery when Sentry submission fails. PR #2271 added graceful failure handling and merged as commit 859c111e5.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #2271 (commit 859c111e5), which handles Sentry submission failures gracefully instead of falsely reporting that the traceback was sent.
stealth/space-bunny-alpha — closed resolved Added Sentry failure handling to prevent Snapcraft from falsely printing that an unsent traceback was submitted.
qwen/qwen3.6-35b-a3b — — Closed. Fixed by adding error handling to _submit_trace() to prevent false success messages when Sentry submissions time out.
qwen/qwen3.6-35b-a3b — — Closed without documented fix or follow-up. The report indicated Snapcraft falsely confirms error submission to Sentry during network timeouts, but no resolution or code changes were recorded.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/snapcraft#2271 (confidence 100%)

    Merged pull request titled "reporting: fail gracefully on submit errors"; commit 859c111e5.

Related issues

Issue Project State Summary Similarity
#1807443 sentry permission error snapcraft (launchpad) closed Sentry submission failures were handled gracefully in canonical/snapcraft#2271, merged as commit 859c111e5.
81%
#5582 Remove Sentry reporting snapcraft closed Merged PR #5592 (commit 0a120c694) removed Sentry/Raven reporting, error-data prompts, and the Launchpad fallback; Snapcraft now shows errors without requesting submissions.
73%
#1572963 snapcraft upload can fail while monitoring scan status snapcraft (launchpad) closed Fixed by ubuntu-core/snapcraft PR #480 (commit 2cae24aa5), which made upload polling ignore spurious scan-status errors; verified in Snapcraft 2.8.8b.
72%
#1627865 Snapcraft errors when releasing a snap snapcraft (launchpad) closed Resolved by improving snapcraft's error handling to check HTTP status codes before JSON decoding, alongside a fix for the underlying store race condition (bug #1610948).
71%
#6119 snapcraft exit code 0 on unsuccesful uploads snapcraft closed Fixed by merged canonical/craft-application#1068 (58e0440f), which preserves non-success dispatcher return codes; Snapcraft 9.0 was verified to exit 1 for an HTTP 500 upload.
70%
#5592 Remove Sentry and fallback error reporting (#5582) snapcraft merged Merged PR #5592 as commit 0a120c694, removing Snapcraft Legacy's Sentry/Raven reporting, error-data prompts, and Launchpad fallback; closed #5582.
70%