How to fix the error: prefect.exceptions.ClientError: [{'message': 'Expected type UUID!, found ""; Could not parse UUID:

Hello! Please help me understand why this error occurs when working with flow. It may appear and make flow failed, or it may not appear, then flow will be success.
Moreover, when this error appears, the tasks are executed successfully, but the flow itself is unsuccessful.
Full text of the error:

Failed to retrieve task state with error: ClientError([{'message': 'Expected type UUID!, found ""; Could not parse UUID: ', 'locations': [{'line': 2, 'column': 5}], 'path': ['get_or_create_task_run_info'], 'extensions': {'code': 'INTERNAL_SERVER_ERROR', 'exception': {'message': 'Expected type UUID!, found ""; Could not parse UUID: '}}}])
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/prefect/engine/cloud/task_runner.py", line 154, in initialize_run
    task_run_info = self.client.get_task_run_info(
  File "/usr/local/lib/python3.9/site-packages/prefect/client/client.py", line 1479, in get_task_run_info
    result = self.graphql(mutation)  # type: Any
  File "/usr/local/lib/python3.9/site-packages/prefect/client/client.py", line 473, in graphql
    raise ClientError(result["errors"])
prefect.exceptions.ClientError: [{'message': 'Expected type UUID!, found ""; Could not parse UUID: ', 'locations': [{'line': 2, 'column': 5}], 'path': ['get_or_create_task_run_info'], 'extensions': {'code': 'INTERNAL_SERVER_ERROR', 'exception': {'message': 'Expected type UUID!, found ""; Could not parse UUID: '}}}]
2 Likes

Usually, this means some transient error occurred during flow registration. For most users, reregistering a flow fixes the issue - can you try that?

We’ve also seen similar errors when a user had some environment variables set on build time (in the registration environment) to set parameters, but those env variables were not set in the execution layer and were therefore not available at runtime, causing that the Parameter tasks was registered but no longer found in the flow computational graph at runtime.

1 Like