rackslab / Slurm-web

Open source web dashboard for Slurm HPC clusters
https://slurm-web.com
GNU General Public License v3.0
340 stars 97 forks source link

`AttributeError: module 'asyncio.tasks' has no attribute '_gather'` on Python 3.6 #386

Closed rezib closed 1 week ago

rezib commented 1 week ago

The gateway has failed with the stack trace on Python 3.6:

[2024-11-12 08:53:44,890] ERROR in app: Exception on /api/agents/smcpoc/stats [GET]
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python3.6/site-packages/rfl/web/tokens.py", line 56, in wrapped
    return view(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/slurmweb/views/gateway.py", line 37, in wrapped
    return view(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/slurmweb/views/gateway.py", line 236, in stats
    return proxy_agent(cluster, "stats", request.token)
  File "/usr/lib/python3.6/site-packages/slurmweb/views/gateway.py", line 230, in proxy_agent
    return asyncio_run(async_proxy_agent(*args, **kwargs))
  File "/usr/lib/python3.6/site-packages/slurmweb/asyncrun.py", line 68, in asyncio_run
    return asyncio_run_backport(main)
  File "/usr/lib/python3.6/site-packages/slurmweb/asyncrun.py", line 56, in asyncio_run_backport
    _cancel_all_tasks(loop)
  File "/usr/lib/python3.6/site-packages/slurmweb/asyncrun.py", line 26, in _cancel_all_tasks
    asyncio.tasks._gather(*to_cancel, loop=loop, return_exceptions=True)
AttributeError: module 'asyncio.tasks' has no attribute '_gather'

Originally posted by @bl7711 in https://github.com/rackslab/Slurm-web/discussions/385

rezib commented 1 week ago

For the record, I successfully reproduced the issue here: https://github.com/rackslab/RFL/actions/runs/11795303337/job/32854742504?pr=22#step:8:123

rezib commented 1 week ago

This will be fixed in upcoming release of RFL v1.1.2. It will be used by Slurm-web v4.0.0, there is nothing more to do here.

bl7711 commented 1 week ago

Thank you.