EIDA/eidaws

Upgrade to `aiohttp>=3.8.0`

damb opened this issue · 0 comments

damb commented

Note that upgrading currently leads to the following error, e.g.:

Mar  8 11:12:44 22ed0a6a9060 nginx: 172.22.0.1 - - 08/Mar/2022:11:12:44 +0000 "GET /eidaws/routing/1/query?sta=BFO&service=station&cha=HHE HTTP/1.1" 404 326 0.000 "-" "curl/7.58.0"
Mar  8 11:13:10 22ed0a6a9060 <EIDA> 2022-03-08T11:13:10+0000 INFO eidaws.federator.middleware 56 misc.py:228 - [aed64c07-6a6e-46dd-a638-95068a52f91f]  2022-03-08T11:13:10.883844 "GET /fedws/station/text/1/query?sta=BFO&cha=HHE&format=text HTTP/1.1' '-' 'curl/7.58.0'
Mar  8 11:13:10 22ed0a6a9060 <EIDA> 2022-03-08T11:13:10+0000 CRITICAL eidaws.federator.middleware 56 middleware.py:66 - [aed64c07-6a6e-46dd-a638-95068a52f91f] Local Exception: <class 'RuntimeError'>
Mar  8 11:13:10 22ed0a6a9060 <EIDA> 2022-03-08T11:13:10+0000 CRITICAL eidaws.federator.middleware 56 middleware.py:67 - [aed64c07-6a6e-46dd-a638-95068a52f91f] Traceback information: ['Traceback (most recent call last):\n', '  File "/usr/local/src/eidaws/eidaws.federator/eidaws/federator/utils/middleware.py", line 46, in exception_handling_middleware\n    return await handler(request)\n', '  File "/usr/local/src/eidaws/eidaws.federator/eidaws/federator/utils/remote.py", line 16, in middleware\n    return await super().middleware(request, handler)\n', '  File "/var/www/eidaws-federator/venv/lib/python3.8/site-packages/aiohttp_remotes/x_forwarded.py", line 103, in middleware\n    return await handler(request)\n', '  File "/var/www/eidaws-federator/venv/lib/python3.8/site-packages/aiohttp/web_urldispatcher.py", line 954, in _iter\n    resp = await method()\n', '  File "/usr/local/src/eidaws/eidaws.federator/eidaws/federator/utils/view.py", line 52, in get\n    return await processor.federate(timeout=self.client_timeout)\n', '  File "/usr/local/src/eidaws/eidaws.federator/eidaws/federator/utils/process.py", line 104, in wrapper\n    return await coro(self, *args, **kwargs)\n', '  File "/usr/local/src/eidaws/eidaws.federator/eidaws/federator/utils/process.py", line 299, in federate\n    self._routed_urls, routes = await self._route()\n', '  File "/usr/local/src/eidaws/eidaws.federator/eidaws/federator/utils/process.py", line 254, in _route\n    async with req() as resp:\n', '  File "/var/www/eidaws-federator/venv/lib/python3.8/site-packages/aiohttp/client.py", line 1138, in __aenter__\n    self._resp = await self._coro\n', '  File "/var/www/eidaws-federator/venv/lib/python3.8/site-packages/aiohttp/client.py", line 466, in _request\n    with timer:\n', '  File "/var/www/eidaws-federator/venv/lib/python3.8/site-packages/aiohttp/helpers.py", line 701, in __enter__\n    raise RuntimeError(\n', 'RuntimeError: Timeout context manager should be used inside a task\n']
Mar  8 11:13:10 22ed0a6a9060 nginx: 172.22.0.1 - - 08/Mar/2022:11:13:10 +0000 "GET /fdsnws/station/1/query?sta=BFO&cha=HHE&format=text HTTP/1.1" 500 475 0.007 "-" "curl/7.58.0"

As a temporary workaround pin aiohttp==3.7.4 (see #26).