https://prefect.io logo
a

An Hoang

07/27/2021, 10:03 PM
Hi there I would love to have a debugging tutorial for prefect flows, or if it already exists, please point me to it 🙂 . I struggled through debugging a fairly simple flow and could see beginners being confused by the cryptic errors thus giving up trying out the awesome Prefect tool. Some of the things that could be added to https://docs.prefect.io/core/advanced_tutorials/local-debugging.html 1. If error contains something about `Not found UUID`: your local flow signature is different from back-end registered flow signature
Copy code
21:15:07 | ERROR   | Failed to retrieve task state with error: ClientError([{'path': ['get_or_create_task_run_info'], 'message': 'Expected type UUID!, found ""; Could not parse UUID: ', 'extensions': {'code': 'INTERNAL_SERVER_ERROR', 'exception': {'message': 'Expected type UUID!, found ""; Could not parse UUID: ', 'locations': [{'line': 2, 'column': 101}], 'path': None}}}])
Traceback (most recent call last):
  File "/lab/corradin_biobank/FOR_AN/OVP/corradin_ovp_utils/.venv/lib/python3.8/site-packages/prefect/engine/cloud/task_runner.py", line 154, in initialize_run
    task_run_info = self.client.get_task_run_info(
  File "/lab/corradin_biobank/FOR_AN/OVP/corradin_ovp_utils/.venv/lib/python3.8/site-packages/prefect/client/client.py", line 1721, in get_task_run_info
    result = self.graphql(mutation)  # type: Any
  File "/lab/corradin_biobank/FOR_AN/OVP/corradin_ovp_utils/.venv/lib/python3.8/site-packages/prefect/client/client.py", line 564, in graphql
    raise ClientError(result["errors"])
prefect.exceptions.ClientError: [{'path': ['get_or_create_task_run_info'], 'message': 'Expected type UUID!, found ""; Could not parse UUID: ', 'extensions': {'code': 'INTERNAL_SERVER_ERROR', 'exception': {'message': 'Expected type UUID!, found ""; Could not parse UUID: ', 'locations': [{'line': 2, 'column': 101}], 'path': None}}}]
1. `Error: Task function was not provided required {parameter}`: Some upstream task was skipped and thus result were not passed down. 2. Setting up non-data dependency: the difference between a.
task_A.map(param1=param1); task_A.set_upstream(task_B)
b.
task_A.map(param1=param1, upstream_task = [task_B])
c.
task_A_result =task_A.map(param1=param1); task_A_result.set_upstream(task_B)
(First one is wrong, it will create another different instance of
task_B
and
task_A
unmapped, second one expects
task_B
to return iterable and will error if it doesn't, third one is correct if
task_B
doesn't return iterable. 4. In general, one of the best ways in debugging tasks' dependencies (when you have unit-tested each task independently) in a flow is to run it locally using
flow_result = flow.run()
and then visualize with
flow.visualize(flow_state= flow_result)
k

Kevin Kho

07/27/2021, 10:27 PM
Thank you for the write up @An Hoang! Would you be interested in adding these to the documentartion?
a

An Hoang

07/27/2021, 10:42 PM
ofcourse, let me know what format you want it in and any requirements you have 🙂
k

Kevin Kho

07/28/2021, 2:13 PM
I think you can add those to the section that you linked. And then this downwards will help with style and development and then you can edit this file.
Feel free to ping me if you need help getting started with that.