I've trying to register flows locally programmatic...
# prefect-server
I've trying to register flows locally programmatically and getting an error on one flow:
Copy code
Traceback (most recent call last):
  File "/helix_orchestration/flows/reporting/fhir_rpt_reporting_pipeline.py", line 191, in <module>
    flow.register(project_name="helix", idempotency_key=flow.serialized_hash())
  File "/usr/local/lib/python3.7/site-packages/prefect/core/flow.py", line 1734, in register
  File "/usr/local/lib/python3.7/site-packages/prefect/client/client.py", line 1211, in register
  File "/usr/local/lib/python3.7/site-packages/prefect/client/client.py", line 554, in graphql
  File "/usr/local/lib/python3.7/site-packages/prefect/client/client.py", line 458, in post
  File "/usr/local/lib/python3.7/site-packages/prefect/client/client.py", line 738, in _request
    session=session, method=method, url=url, params=params, headers=headers
  File "/usr/local/lib/python3.7/site-packages/prefect/client/client.py", line 660, in _send_request
    raise ClientError(f"{exc}\n{graphql_msg}") from exc
prefect.exceptions.ClientError: 400 Client Error: Bad Request for url: <http://apollo:4200/>

The following error messages were provided by the GraphQL server:    GRAPHQL_VALIDATION_FAILED: Unknown type "register_tasks_input". Did you mean
        "register_agent_input", "delete_agent_input", "delete_flow_input",
        "delete_tenant_input", or "log_insert_input"?
    GRAPHQL_VALIDATION_FAILED: Cannot query field "register_tasks" on type
        "Mutation". Did you mean "register_agent", "delete_task", "insert_task", or "update_task"?
I'm not sure what this error is indicating as i have other flows that register fine using this same register call and similar setup. I'm running this locally using docker image on version 0.15.10
Only on one flow? There seems to be a version mismatch somewhere. What is the version of the Server?
I have close to 100 - some produce this errors others dont but all have very similar lines
Copy code
those are the versions we have in our docker compose file
This all look good. How about the place you are registering from?
runnin from the agent server - prefecthq/prefect:0.15.10
i.e. i do a docker cp && docker exec on the file im trying to register
This looks like it should work. Are you using
yep my full command is:
Copy code
flow.register(project_name="helix", idempotency_key=flow.serialized_hash())
where helix is a registered project name
Can you try to manually trigger DB migration? something is wrong with your backend:
Copy code
docker exec graphqlContainerName prefect-server database upgrade -y
Note that after running DB migrations manually, you need to restart your Apollo container so that it can refetch the updated database schemas:
Copy code
docker restart apolloContainerName
before doing that, maybe create a backup of your Postgres instance just in case 🙂
and btw, perhaps migrating to the latest version would help? this way you could sort of start from scratch and ensure all your components use the latest and the same version I would also be curious to see the flow definition that led to that error - what storage and agent do you use? can you send the output of "prefect diagnostics"?
im trying to create a localized docker setup for testing purposes - normally we use Prefect cloud hosted and that worked fine when i register_flow gets called from an agent
so it registers the flow but still throws that error - im not sure where prefect diagnotics is run at or where i can get that output?
You can run it in the CLI wherever you register from
prefect diagnostics
Copy code
  "config_overrides": {
    "backend": true,
    "server": {
      "host": true
  "env_vars": [],
  "system_information": {
    "platform": "Linux-5.10.76-linuxkit-x86_64-with-debian-11.1",
    "prefect_backend": "server",
    "prefect_version": "0.15.10",
    "python_version": "3.7.12"