Details
Description
When dashboard is communicating with the microservice via the underlying FastAPI server, we should also handle the timeout issues and show that to the user that network timeout happened.
Traceback (most recent call last): File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 366, in run_asgi result = await app(self.scope, self.receive, self.send) File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__ return await self.app(scope, receive, send) File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/fastapi/applications.py", line 269, in __call__ await super().__call__(scope, receive, send) File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/starlette/applications.py", line 124, in __call__ await self.middleware_stack(scope, receive, send) File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/starlette/middleware/errors.py", line 184, in __call__ raise exc File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/starlette/middleware/errors.py", line 162, in __call__ await self.app(scope, receive, _send) File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/starlette/exceptions.py", line 93, in __call__ raise exc File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__ await self.app(scope, receive, sender) File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__ raise e File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__ await self.app(scope, receive, send) File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/starlette/routing.py", line 670, in __call__ await route.handle(scope, receive, send) File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/starlette/routing.py", line 266, in handle await self.app(scope, receive, send) File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/starlette/routing.py", line 65, in app response = await func(request) File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/fastapi/routing.py", line 227, in app raw_response = await run_endpoint_function( File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/fastapi/routing.py", line 160, in run_endpoint_function return await dependant.call(**values) File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/src/qtci_bin/onboarding_web.py", line 82, in check_qt_licence result, status_code = qtci.modules.qt_account.check_licence(username, password) File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/src/qtci/modules/_qt_account.py", line 11, in check_licence response = requests.post(login_microservice_staging_url, data=args) File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/requests/api.py", line 117, in post return request('post', url, data=data, json=json, **kwargs) File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/requests/sessions.py", line 529, in request resp = self.send(prep, **send_kwargs) File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/requests/sessions.py", line 645, in send r = adapter.send(request, **kwargs) File "/home/aseeem/Work/QtCompanyOy/dashboard-plugin/venv-linux/lib/python3.8/site-packages/requests/adapters.py", line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='10.9.24.113', port=8000): Max retries exceeded with url: /api/v1/bundle (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f11a9075d90>: Failed to establish a new connection: [Errno 110] Connection timed out'))