When I am following the below instructions to integrate Sentry with my Python 3.7 based Sanic app. I am running into an error. I get a timeout error and my Sanic app stops responding.
Docs: https://docs.sentry.io/platforms/python/sanic/
import sentry_sdk
from sentry_sdk.integrations.sanic import SanicIntegration
sentry_sdk.init(
dsn="https://<key>@sentry.io/<project>",
integrations=[SanicIntegration()]
)
app = Sanic(__name__)
Error:
[2018-11-14 12:47:12 +0600] [1] [ERROR] Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/sanic/server.py", line 178, in response_timeout_callback
raise ServiceUnavailable('Response Timeout')
sanic.exceptions.ServiceUnavailable: Response Timeout
Exception in callback <bound method HttpProtocol.response_timeout_callback of <sanic.server.HttpProtocol object at 0x7fd39a8bdaf0>>
handle: <TimerHandle cancelled HttpProtocol.response_timeout_callback>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/sanic/server.py", line 178, in response_timeout_callback
raise ServiceUnavailable('Response Timeout')
sanic.exceptions.ServiceUnavailable: Response Timeout
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 245, in uvloop.loop.TimerHandle._run
File "/usr/local/lib/python3.7/site-packages/sanic/server.py", line 180, in response_timeout_callback
self.write_error(exception)
File "/usr/local/lib/python3.7/site-packages/sanic/server.py", line 429, in write_error
self.log_response(response)
File "/usr/local/lib/python3.7/site-packages/sanic/server.py", line 321, in log_response
self.request.url)
File "/usr/local/lib/python3.7/site-packages/sanic/request.py", line 253, in url
self.scheme,
File "/usr/local/lib/python3.7/site-packages/sanic/request.py", line 213, in scheme
if self.app.websocket_enabled \
AttributeError: 'NoneType' object has no attribute 'websocket_enabled'