Snapcraft lies when submission to sentry fails

Bug #1791968 reported by Evan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Status tracked in Trunk
Legacy
Fix Committed
High
Sergio Schvezov
Trunk
Fix Released
High
Sergio Schvezov

Bug Description

```
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.

Changed in snapcraft:
milestone: none → 2.44
Revision history for this message
Sergio Schvezov (sergiusens) wrote :
Changed in snapcraft:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Sergio Schvezov (sergiusens)
Changed in snapcraft:
status: In Progress → Fix Committed
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.