Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handling scheduler error #271

Open
hjoliver opened this issue Nov 2, 2021 · 0 comments
Open

handling scheduler error #271

hjoliver opened this issue Nov 2, 2021 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@hjoliver
Copy link
Member

hjoliver commented Nov 2, 2021

On current cylc-flow master (before cylc/cylc-flow#4487 is merged) attempting to trigger (without reflow) a task in the UI causes an error in the scheduler, which results in this UIS traceback:

ERROR:graphql.execution.utils:Traceback (most recent call last):
  File "/home/oliverh/cylc/cylc-uiserver/venv/lib/python3.9/site-packages/promise/promise.py", line 844, in handle_future_result
    resolve(future.result())
  File "/home/oliverh/cylc/cylc-uiserver/venv/lib/python3.9/site-packages/cylc/flow/network/graphql.py", line 441, in async_resolve
    return await next_(root, info, **args)
  File "/home/oliverh/cylc/cylc-uiserver/cylc/uiserver/authorise.py", line 473, in async_resolve
    return await next_(root, info, **args)
  File "/home/oliverh/cylc/cylc-uiserver/venv/lib/python3.9/site-packages/promise/iterate_promise.py", line 10, in iterate_promise
    yield from promise.future  # type: ignore
  File "/home/oliverh/cylc/cylc-uiserver/venv/lib/python3.9/site-packages/promise/promise.py", line 844, in handle_future_result
    resolve(future.result())
  File "/home/oliverh/cylc/cylc-uiserver/venv/lib/python3.9/site-packages/cylc/flow/network/schema.py", line 1276, in mutator
    res = await resolvers.mutator(info, command, w_args, args)
  File "/home/oliverh/cylc/cylc-uiserver/cylc/uiserver/resolvers.py", line 199, in mutator
    return await self.workflows_mgr.multi_request(
  File "/home/oliverh/cylc/cylc-uiserver/cylc/uiserver/workflows_mgr.py", line 307, in multi_request
    for msg_core in list(val.values())[0].get('result')
graphql.error.located_error.GraphQLLocatedError: 'list' object has no attribute 'values'

The UIS code is cylc/uiserver/workflows_mgr.py:multi_request():

results = await asyncio.gather(*gathers, return_exceptions=True)
res = []
for result in results:
if isinstance(result, Exception):
self.log.exception(
'Failed to send requests to multiple workflows',
exc_info=result
)
else:
_, val = result
res.extend([
msg_core
for msg_core in list(val.values())[0].get('result')
if isinstance(val, dict)
and list(val.values())
])
return res

The value of result on line 293 is not of type Exception, it's this:

[
   "oliverh|demo/run4",
   [
      {
         "error": {
            "message": "force_trigger_tasks() missing 2 required positional arguments: 'reflow' and 'flow_descr'",
            "traceback": [
               "graphql.error.located_error.GraphQLLocatedError: force_trigger_tasks() missing 2 required positional arguments: 'reflow' and 'flow_descr'\n"
            ]
         }
      }
   ]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants