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

Retry email sends on a delay if mailgun is having uptime issues #3044

Open
sentry-io bot opened this issue Jul 9, 2020 · 0 comments
Open

Retry email sends on a delay if mailgun is having uptime issues #3044

sentry-io bot opened this issue Jul 9, 2020 · 0 comments
Assignees

Comments

@sentry-io
Copy link

sentry-io bot commented Jul 9, 2020

Sentry Issue: DISCUSSIONS-2N5

WantReadError: 
  File "urllib3/contrib/pyopenssl.py", line 456, in wrap_socket
    cnx.do_handshake()
  File "OpenSSL/SSL.py", line 1806, in do_handshake
    self._raise_ssl_error(self._ssl, result)
  File "OpenSSL/SSL.py", line 1521, in _raise_ssl_error
    raise WantReadError()

timeout: select timed out
(1 additional frame(s) were not displayed)
...
  File "urllib3/connectionpool.py", line 839, in _validate_conn
    conn.connect()
  File "newrelic/hooks/external_httplib.py", line 33, in httplib_connect_wrapper
    return wrapped(*args, **kwargs)
  File "urllib3/connection.py", line 344, in connect
    ssl_context=context)
  File "urllib3/util/ssl_.py", line 347, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "urllib3/contrib/pyopenssl.py", line 459, in wrap_socket
    raise timeout('select timed out')

ReadTimeoutError: HTTPSConnectionPool(host='api.mailgun.net', port=443): Read timed out. (read timeout=30)
(4 additional frame(s) were not displayed)
...
  File "urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "newrelic/hooks/external_urllib3.py", line 21, in _nr_wrapper_make_request_
    return wrapped(*args, **kwargs)
  File "newrelic/hooks/external_urllib3.py", line 21, in _nr_wrapper_make_request_
    return wrapped(*args, **kwargs)
  File "urllib3/connectionpool.py", line 346, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
  File "urllib3/connectionpool.py", line 306, in _raise_timeout
    raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)

ReadTimeout: HTTPSConnectionPool(host='api.mailgun.net', port=443): Read timed out. (read timeout=30)
(2 additional frame(s) were not displayed)
...
  File "newrelic/api/external_trace.py", line 62, in dynamic_wrapper
    return return_value(trace, lambda: wrapped(*args, **kwargs))
  File "newrelic/api/coroutine_trace.py", line 171, in return_value
    return fn()
  File "newrelic/api/external_trace.py", line 62, in <lambda>
    return return_value(trace, lambda: wrapped(*args, **kwargs))
  File "requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)

AnymailRequestsAPIError: Error posting to https://api.mailgun.net/v3/mail.open.mit.edu/messages:
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.mailgun.net', port=443): Read timed out. (read timeout=30)
Sending a message to User <[email protected]> from MIT Open <[email protected]
(4 additional frame(s) were not displayed)
...
  File "django/core/mail/message.py", line 291, in send
    return self.get_connection(fail_silently).send_messages([self])
  File "anymail/backends/base.py", line 93, in send_messages
    sent = self._send(message)
  File "anymail/backends/base_requests.py", line 55, in _send
    return super(AnymailRequestsBackend, self)._send(message)
  File "anymail/backends/base.py", line 123, in _send
    response = self.post_to_esp(payload, message)
  File "anymail/backends/base_requests.py", line 76, in post_to_esp
    raised_from=err, email_message=message, payload=payload)

Error sending email '[MIT Open] Top Stories for You' to ["User <[email protected]>"]
@rhysyngsun rhysyngsun self-assigned this Jul 9, 2020
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

1 participant