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

JSONDecodeError when getting cluster stats #319

Closed rezib closed 4 months ago

rezib commented 4 months ago

Error reported by @Talavig in #315:

Thread-858 (process_request_thread): [INFO] 127.0.0.1 - -
[14/Jul/2024 13:58:32] "GET /v3.1.0/stats HTTP/1.1" 500 -
Jul 14 13:58:32 standalone slurm-web-agent[7637]: simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Jul 14 13:58:32 standalone slurm-web-agent[7637]:     return self.scan_once(s, idx=_w(s, idx).end())
Jul 14 13:58:32 standalone slurm-web-agent[7637]:   File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 400, in raw_decode
Jul 14 13:58:32 standalone slurm-web-agent[7637]:     obj, end = self.raw_decode(s)
Jul 14 13:58:32 standalone slurm-web-agent[7637]:   File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 370, in decode
Jul 14 13:58:32 standalone slurm-web-agent[7637]:     return _default_decoder.decode(s)
Jul 14 13:58:32 standalone slurm-web-agent[7637]:   File "/usr/lib/python3/dist-packages/simplejson/__init__.py", line 525, in loads
Jul 14 13:58:32 standalone slurm-web-agent[7637]:     return complexjson.loads(self.text, **kwargs)
Jul 14 13:58:32 standalone slurm-web-agent[7637]:   File "/usr/lib/python3/dist-packages/requests/models.py", line 900, in json
Jul 14 13:58:32 standalone slurm-web-agent[7637]:     result = response.json()
Jul 14 13:58:32 standalone slurm-web-agent[7637]:   File "/usr/lib/python3/dist-packages/slurmweb/views/agent.py", line 51, in slurmrest
Jul 14 13:58:32 standalone slurm-web-agent[7637]:     items = func(*args)
Jul 14 13:58:32 standalone slurm-web-agent[7637]:   File "/usr/lib/python3/dist-packages/slurmweb/views/agent.py", line 76, in filter_fields
Jul 14 13:58:32 standalone slurm-web-agent[7637]:     return func(*args)
Jul 14 13:58:32 standalone slurm-web-agent[7637]:   File "/usr/lib/python3/dist-packages/slurmweb/views/agent.py", line 88, in _cached_data
Jul 14 13:58:32 standalone slurm-web-agent[7637]:     return _cached_data(
Jul 14 13:58:32 standalone slurm-web-agent[7637]:   File "/usr/lib/python3/dist-packages/slurmweb/views/agent.py", line 101, in _cached_jobs
Jul 14 13:58:32 standalone slurm-web-agent[7637]:     for job in _cached_jobs():
Jul 14 13:58:32 standalone slurm-web-agent[7637]:   File "/usr/lib/python3/dist-packages/slurmweb/views/agent.py", line 236, in stats
Jul 14 13:58:32 standalone slurm-web-agent[7637]:     return view(*args, **kwargs)
Jul 14 13:58:32 standalone slurm-web-agent[7637]:   File "/usr/lib/python3/dist-packages/rfl/web/tokens.py", line 93, in wrapped
Jul 14 13:58:32 standalone slurm-web-agent[7637]:     return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
Jul 14 13:58:32 standalone slurm-web-agent[7637]:   File "/usr/lib/python3/dist-packages/flask/app.py", line 1499, in dispatch_request
Jul 14 13:58:32 standalone slurm-web-agent[7637]:     rv = self.dispatch_request()
Jul 14 13:58:32 standalone slurm-web-agent[7637]:   File "/usr/lib/python3/dist-packages/flask/app.py", line 1513, in full_dispatch_request
Jul 14 13:58:32 standalone slurm-web-agent[7637]:     rv = self.handle_user_exception(e)
Jul 14 13:58:32 standalone slurm-web-agent[7637]:   File "/usr/lib/python3/dist-packages/flask/app.py", line 1515, in full_dispatch_request
Jul 14 13:58:32 standalone slurm-web-agent[7637]:     response = self.full_dispatch_request()
Jul 14 13:58:32 standalone slurm-web-agent[7637]:   File "/usr/lib/python3/dist-packages/flask/app.py", line 2070, in wsgi_app

Note this error has been raised with unsupported version of Slurm (21.08.5).

rezib commented 4 months ago

Logs from slurmrestd were not provided by user but this error was probably initially caused by a 404 from this service, due to API version 0.0.39 being unsupported by Slurm 21.08.5. Then this is probably a duplicate of #321.