Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Sentry responded with an error: <urlopen error timed out> (url: https://sentry.io/api/xxxx/store/) #1314

Open
jaykam opened this issue Dec 24, 2018 · 4 comments

Comments

@jaykam
Copy link

jaykam commented Dec 24, 2018

Hello @dcramer @sabricot,

I'm facing this issue randomly, Sometimes it breaks and sometimes works

I'm running it on Lambda with python 2.7 and raven 6.3.0 and certifi 2016.2.28

   File "/tmp/dependencies/raven/transport/threaded.py", line 172, in send_sync
           super(ThreadedHTTPTransport, self).send(url, data, headers)
   File "/tmp/dependencies/raven/transport/http.py", line 43, in send
            ca_certs=self.ca_certs,
    File "/tmp/dependencies/raven/utils/http.py", line 66, in urlopen
            return opener.open(url, data, timeout)
    File "/usr/lib64/python2.7/urllib2.py", line 429, in open
            response = self._open(req, data)
    File "/usr/lib64/python2.7/urllib2.py", line 447, in _open
            '_open', req)
    File "/usr/lib64/python2.7/urllib2.py", line 407, in _call_chain
             result = func(*args)
   File "/tmp/dependencies/raven/utils/http.py", line 46, in https_open
            return self.do_open(ValidHTTPSConnection, req)
   File "/usr/lib64/python2.7/urllib2.py", line 1200, in do_open
            raise URLError(err)
            URLError: <urlopen error timed out>
@untitaker
Copy link
Member

Hi, please use the synchronous transport from here: https://docs.sentry.io/clients/python/transports/#sync

AWS Lambda will suspend your entire machine after a request/function call has returned which leads to weird network errors (or just missing events)

@jaykam
Copy link
Author

jaykam commented Dec 26, 2018

Hey @untitaker

Thanks for your quick reply

But I'm also using this synchronous transport As you can see below

from raven import Client
from raven.transport.http import HTTPTransport

class sentryClient:
    class __sentryClient:
        def __init__(self):
            self.client = Client(sentry_dsn, extra=None,
                                     enable_breadcrumbs=False,
                                     transport=HTTPTransport)

So here I've initialized the sentry Client and passing the sync transport.

I'm getting that error 3-4 times out of 10.
According to me, this is something related to raven!

@untitaker
Copy link
Member

I am not sure what's going on in your code but I am pretty sure you are not using the synchronous transport, as the first line of your stacktrace is from code that belongs to the threaded one.

My best guess is that you have two clients instantiated where one of them is broken.

@jaykam
Copy link
Author

jaykam commented Jan 3, 2019

@untitaker

from raven import Client

Here I'm defining the Client and I guess this is the same for all type of transport If I follow this doc
https://docs.sentry.io/clients/python/transports/#sync

Can you point me out where you're saying that I've defined the two Clients

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

No branches or pull requests

2 participants