AGProjects / sylk-pushserver

Mobile push notifications for RTC infrastructures
Other
13 stars 8 forks source link

ERROR: Exception in ASGI application #9

Closed hasanr68 closed 1 year ago

hasanr68 commented 2 years ago

Hello.

This error seems to have started showing up in the logs since fcm was added ( #https://github.com/AGProjects/sylk-pushserver/issues/7) or could be un-related. I am using opensips 3.0

Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: ERROR: Exception in ASGI application Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: Traceback (most recent call last): Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/uvicorn/protocols/http/httptools_impl.py", line 390, in run_asgi Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: result = await app(self.scope, self.receive, self.send) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in call Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: return await self.app(scope, receive, send) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/fastapi/applications.py", line 149, in call Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: await super().call(scope, receive, send) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/starlette/applications.py", line 102, in call Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: await self.middleware_stack(scope, receive, send) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/starlette/middleware/errors.py", line 181, in call Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: raise exc from None Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/starlette/middleware/errors.py", line 159, in call Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: await self.app(scope, receive, _send) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/starlette/exceptions.py", line 82, in call Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: raise exc from None Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/starlette/exceptions.py", line 71, in call Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: await self.app(scope, receive, sender) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/starlette/routing.py", line 550, in call Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: await route.handle(scope, receive, send) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/starlette/routing.py", line 227, in handle Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: await self.app(scope, receive, send) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/starlette/routing.py", line 41, in app Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: response = await func(request) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/fastapi/routing.py", line 148, in app Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: dependant=dependant, values=values, is_coroutine=is_coroutine Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/fastapi/routing.py", line 101, in run_endpoint_function Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: return await dependant.call(values) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/pushserver/api/routes/push.py", line 62, in push_requests Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: results = handle_request(wp_request, request_id=request_id) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/pushserver/resources/notification.py", line 19, in handle_request Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: results = push_notification.send_notification() Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/pushserver/resources/notification.py", line 92, in send_notification Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: register=register) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/pushserver/pns/apple.py", line 265, in init Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: self.results = self.send_notification() Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/pushserver/pns/apple.py", line 303, in send_notification Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: self.headers) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/hyper/http20/connection.py", line 281, in request Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: self.endheaders(message_body=body, final=True, stream_id=stream_id) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/hyper/http20/connection.py", line 555, in endheaders Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: stream.send_headers(headers_only) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/hyper/http20/stream.py", line 99, in send_headers Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: self._send_outstanding_data() Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/hyper/http20/connection.py", line 466, in _send_outstanding_data Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: self._send_cb(data, tolerate_peer_gone=tolerate_peer_gone) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/hyper/http20/connection.py", line 622, in _send_cb Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: self._sock.sendall(data) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3.7/ssl.py", line 1015, in sendall Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: v = self.send(byte_view[count:]) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3.7/ssl.py", line 984, in send Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: return self._sslobj.write(data) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:2341) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: ERROR:uvicorn.error:Exception in ASGI application Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: Traceback (most recent call last): Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/uvicorn/protocols/http/httptools_impl.py", line 390, in run_asgi Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: result = await app(self.scope, self.receive, self.send) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in call Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: return await self.app(scope, receive, send) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/fastapi/applications.py", line 149, in call Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: await super().call(scope, receive, send) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/starlette/applications.py", line 102, in call Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: await self.middleware_stack(scope, receive, send) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/starlette/middleware/errors.py", line 181, in call Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: raise exc from None Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/starlette/middleware/errors.py", line 159, in call Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: await self.app(scope, receive, _send) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/starlette/exceptions.py", line 82, in call Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: raise exc from None Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/starlette/exceptions.py", line 71, in call Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: await self.app(scope, receive, sender) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/starlette/routing.py", line 550, in call Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: await route.handle(scope, receive, send) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/starlette/routing.py", line 227, in handle Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: await self.app(scope, receive, send) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/starlette/routing.py", line 41, in app Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: response = await func(request) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/fastapi/routing.py", line 148, in app Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: dependant=dependant, values=values, is_coroutine=is_coroutine Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/fastapi/routing.py", line 101, in run_endpoint_function Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: return await dependant.call(values) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/pushserver/api/routes/push.py", line 62, in push_requests Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: results = handle_request(wp_request, request_id=request_id) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/pushserver/resources/notification.py", line 19, in handle_request Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: results = push_notification.send_notification() Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/pushserver/resources/notification.py", line 92, in send_notification Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: register=register) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/pushserver/pns/apple.py", line 265, in init Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: self.results = self.send_notification() Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/pushserver/pns/apple.py", line 303, in send_notification Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: self.headers) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/hyper/http20/connection.py", line 281, in request Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: self.endheaders(message_body=body, final=True, stream_id=stream_id) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/hyper/http20/connection.py", line 555, in endheaders Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: stream.send_headers(headers_only) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/hyper/http20/stream.py", line 99, in send_headers Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: self._send_outstanding_data() Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/hyper/http20/connection.py", line 466, in _send_outstanding_data Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: self._send_cb(data, tolerate_peer_gone=tolerate_peer_gone) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3/dist-packages/sylk-pushserver/lib/python3.7/site-packages/hyper/http20/connection.py", line 622, in _send_cb Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: self._sock.sendall(data) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3.7/ssl.py", line 1015, in sendall Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: v = self.send(byte_view[count:]) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: File "/usr/lib/python3.7/ssl.py", line 984, in send Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: return self._sslobj.write(data) Mar 31 03:58:32 ip-172-31-27-223 sylk-pushserver[592]: ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:2341)

tijmenNL commented 2 years ago

It is unrelated to #7, but similar/duplicate of #6. Which Debian/Ubuntu version are you using?

hasanr68 commented 2 years ago

Oh ok. Using Debian 10.12. And yes, re-read and it seems to fix itself after a restart.

tijmenNL commented 1 year ago

Fixed in https://github.com/AGProjects/sylk-pushserver/commit/73489194697d5fbc6eed611fea7555ceb6ba6bbf