scylladb / argus

Apache License 2.0
4 stars 11 forks source link

job which is part of a schedule without assignees, might fail to be submitted #403

Closed fruch closed 4 months ago

fruch commented 4 months ago

job which is part of a schedule without assignees, might fail to be submitted

Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]: [ERROR] <34.245.108.195 - https://argus.scylladb.com/api/v1/client/sct/93133be9-3e54-479b-9514-3a8e8af59c75/packages/submit - api.client_>
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]: Traceback (most recent call last):
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:   File "/home/argus/.cache/pypoetry/virtualenvs/argus-alm-HqUqk8xE-py3.10/lib/python3.10/site-packages/cassandra/cqlengine/query.py", lin>
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:     obj = self[0]
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:   File "/home/argus/.cache/pypoetry/virtualenvs/argus-alm-HqUqk8xE-py3.10/lib/python3.10/site-packages/cassandra/cqlengine/query.py", lin>
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:     return self._result_cache[s]
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]: IndexError: list index out of range
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]: During handling of the above exception, another exception occurred:
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]: Traceback (most recent call last):
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:   File "/home/argus/app/./argus/backend/plugins/sct/service.py", line 64, in submit_packages
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:     run: SCTTestRun = SCTTestRun.get(id=run_id)
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:   File "/home/argus/.cache/pypoetry/virtualenvs/argus-alm-HqUqk8xE-py3.10/lib/python3.10/site-packages/cassandra/cqlengine/models.py", li>
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:     return cls.objects.get(*args, **kwargs)
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:   File "/home/argus/.cache/pypoetry/virtualenvs/argus-alm-HqUqk8xE-py3.10/lib/python3.10/site-packages/cassandra/cqlengine/query.py", lin>
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:     return self.filter(*args, **kwargs).get()
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:   File "/home/argus/.cache/pypoetry/virtualenvs/argus-alm-HqUqk8xE-py3.10/lib/python3.10/site-packages/cassandra/cqlengine/query.py", lin>
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:     raise self.model.DoesNotExist
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]: cassandra.cqlengine.models.DoesNotExist
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:   File "/home/argus/app/./argus/backend/service/client_service.py", line 26, in submit_run
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:     model.submit_run(request_data=request_data)
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:   File "/home/argus/app/./argus/backend/plugins/sct/testrun.py", line 125, in submit_run
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:     return cls.from_sct_config(req=req)
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:   File "/home/argus/app/./argus/backend/plugins/sct/testrun.py", line 180, in from_sct_config
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:     run = cls.init_sct_run(req)
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:   File "/home/argus/app/./argus/backend/plugins/sct/testrun.py", line 161, in init_sct_run
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:     run.assignee = run.get_scheduled_assignee()
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:   File "/home/argus/app/./argus/backend/plugins/core.py", line 108, in get_scheduled_assignee
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]:     assignees_uuids.append(*[assignee.assignee for assignee in assignees])
Jul 21 21:02:29 ip-10-0-2-112 bash[2002151]: TypeError: list.append() takes exactly one argument (0 given)

we shouldn't unpack like that into append, it can be empty list, and it might be more then one item, both of those cases would fail. we can use += in this case

Runs: