cylc-flow
cylc-flow copied to clipboard
Move error information out of printing/logging and into exception messages
Describe exactly what you would like to see in an upcoming release
Example:
$ cylc clean running_workflow
WARNING - Cannot clean running workflow Mist.
workflow contact file exists: ...
blah blah...
CylcError: Clean failed: Mist
The problem with this is it's very CLI-centric and so if you try to clean a running workflow from the GUI you only get an alert saying "Clean failed: Mist" with no further context
Optimistically tagged against 8.1.1 but can be bumped
Partially addressed by #5359
Here is an example UIS log snippet - need to figure out how to condense the relevant error messages down and include the final exception:
[I 2025-04-28 11:13:59.024 CylcUIServer] Cleaning ~ronnie.dutta/Simple
[I 2025-04-28 11:13:59.056 cylc] Cleaning Simple on install target: borked
[E 2025-04-28 11:13:59.334 cylc] Could not clean Simple on install target: borked
platform: borked - clean up did not complete
COMMAND:
ssh -oBatchMode=yes -oConnectTimeout=10 bogus env \
CYLC_VERSION=8.4.2 CYLC_ENV_NAME=cylc-8.4.2-1 bash --login \
-c 'exec "$0" "$@"' timeout 600 cylc clean --local-only \
--no-scan Simple --rm .service:log
RETURN CODE:
255
STDOUT:
STDERR:
ssh: Could not resolve hostname bogus: Name or service not known
[E 2025-04-28 11:13:59.335 cylc] Failed to clean Simple
Error: Remote clean failed for Simple
[E 2025-04-28 11:13:59.342 CylcUIServer] CylcError: Clean failed
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File ".../python3.9/concurrent/futures/process.py", line 246, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File ".../python3.9/site-packages/cylc/uiserver/resolvers.py", line 202, in _clean
return loop.run_until_complete(
File ".../python3.9/asyncio/base_events.py", line 647, in run_until_complete
return future.result()
File ".../python3.9/site-packages/cylc/flow/scripts/clean.py", line 240, in run
raise CylcError("Clean failed")
cylc.flow.exceptions.CylcError: Clean failed
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File ".../python3.9/site-packages/cylc/uiserver/resolvers.py", line 250, in clean
await asyncio.get_event_loop().run_in_executor(
cylc.flow.exceptions.CylcError: Clean failed