Hi, I am getting this error when running a flow on...
# ask-community
s
Hi, I am getting this error when running a flow on prefect cloud Can't understand what this error means Any help would be appreciated
Copy code
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 "/usr/local/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 "/usr/local/lib/python3.8/site-packages/prefect/client/client.py", line 1798, in get_task_run_info
    result = self.graphql(mutation)  # type: Any
  File "/usr/local/lib/python3.8/site-packages/prefect/client/client.py", line 569, 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}}}]
a
It’s most likely a registration issue. Reregistration usually fixes that
s
@Anna Geller I re-registered all my flows. Still getting the same error.
a
Can you provide more info? 1. How do you register your flows? 2. How did you trigger/schedule the flow that failed? 3. Do you have any environment variables used in your flow, especially used together with Parameters? We had a user who was referencing some env variables in his flow and those environment variables were only available at registration time, but not at runtime 4. Can you share your storage and run configuration?
5. What agent do you use? What would be also useful to check is what Prefect version is used on your agent and in your registration environment - can you share that info?
s
1. I am registering my flows using the python client
Copy code
from flow_file import flow

from prefect.run_configs import VertexRun
from prefect.storage import GitHub

def register(project_name):
    flow.storage = GitHub(
        repo="{{repo name}}",
        path="{{file in repo}}",
        access_token_secret="GITHUB_ACCESS_TOKEN"
    )

    flow.run_config = VertexRun(
        image="{{image path (on dockerhub)}}",
        machine_type="e2-highmem-8",
        labels=["dev"]
    )

    flow.register(project_name)
2. The flows don't have any schedules rn. They just run once
3. No I do not have any environment variables in the flow. I have two parameters that I am passing in the graphql query
a
can you share this query and how you use parameters in your flow?
s
graphql query:
Copy code
response = client.graphql(
  """mutation {
      create_flow_run(input: {
          flow_id: \"""" + flow_id + """\",
          parameters: "{\\\"pipeline_name\\\": \\\"""" + pipeline_name + """\\\", \\\"email\\\": \\\"""" + email + """\\\"}"
      }) {
        id
      }
    }
  """)
In the flow these parameters are querying a mongodb database
Copy code
with Flow("dask_stage_flow") as flow:
    pipeline_name = Parameter('pipeline_name')
    email = Parameter('email')

    pipeline_config, src_config, dest_config = get_config(pipeline_name, email)
a
also: can you try registering with the CLI instead and forcing reregistration?
Copy code
prefect register --project yourprojectname -p your_flow.py --force
I’m asking this because reregistration solves this error in 95% of use cases I’ve seen
s
5. I am using a vertex agent which is running on a gcp vm both the agent and registeration env (my local system) are running prefect 0.15.10
a
also: your get_config function returns 3 things: is this function decorated with
@task(nout=3)
?
s
yes the get_config has nout=3
a
since you didn’t reply: can you try registering with the CLI instead and forcing reregistration?
Copy code
prefect register --project yourprojectname -p your_flow.py --force