Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't dump the stack when Rollbar cannot be reached #87

Open
micahbf opened this issue Oct 28, 2021 · 2 comments
Open

Don't dump the stack when Rollbar cannot be reached #87

micahbf opened this issue Oct 28, 2021 · 2 comments

Comments

@micahbf
Copy link

micahbf commented Oct 28, 2021

I use a DNS-level blocker for ads and trackers. Because of this, api.rollbar.com does not resolve on my computer.

The issue is, whenever I trigger an error with the CLI, it dumps a huge, ugly Python stack trace. (See below).

It would be nice if the CLI would swallow errors raised from the error reporting service.

Additionally, it could be nice to make the error reporting opt-in, or at least opt-out-able.

$ gigalixir ps:remote_console -a foo
You don't have any ssh keys yet. See `gigalixir account:ssh_keys:add --help`
Exception while posting item ConnectionError(MaxRetryError("HTTPSConnectionPool(host='api.rollbar.com', port=443): Max retries exceeded with url: /api/1/item/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x102c75490>: Failed to establish a new connection: [Errno 61] Connection refused'))"))
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
  File "/opt/homebrew/lib/python3.9/site-packages/urllib3/util/connection.py", line 96, in create_connection
    raise err
  File "/opt/homebrew/lib/python3.9/site-packages/urllib3/util/connection.py", line 86, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/opt/homebrew/lib/python3.9/site-packages/urllib3/connectionpool.py", line 382, in _make_request
    self._validate_conn(conn)
  File "/opt/homebrew/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
    conn.connect()
  File "/opt/homebrew/lib/python3.9/site-packages/urllib3/connection.py", line 358, in connect
    conn = self._new_conn()
  File "/opt/homebrew/lib/python3.9/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x102c75490>: Failed to establish a new connection: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/opt/homebrew/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/opt/homebrew/lib/python3.9/site-packages/urllib3/util/retry.py", line 574, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.rollbar.com', port=443): Max retries exceeded with url: /api/1/item/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x102c75490>: Failed to establish a new connection: [Errno 61] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/rollbar/__init__.py", line 1497, in _send_payload
    _post_api('item/', payload_str, access_token=access_token)
  File "/opt/homebrew/lib/python3.9/site-packages/rollbar/__init__.py", line 1545, in _post_api
    resp = transport.post(url,
  File "/opt/homebrew/lib/python3.9/site-packages/rollbar/lib/transport.py", line 44, in post
    return _session().post(*args, proxies=proxies, **kw)
  File "/opt/homebrew/lib/python3.9/site-packages/requests/sessions.py", line 590, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.rollbar.com', port=443): Max retries exceeded with url: /api/1/item/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x102c75490>: Failed to establish a new connection: [Errno 61] Connection refused'))
@jesseshieh
Copy link
Contributor

Thanks for the feedback! I think these are both great ideas. I can't promise when we will have time to implement them, but I'd be happy to approve a pull request if you have time to put it together.

@micahbf
Copy link
Author

micahbf commented Nov 3, 2021

Thanks, but I'm not much of a python guy. Just swallowing the exceptions would be a big improvement though, right now it is fairly unpleasant to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants