https://prefect.io logo
Title
r

Romain

01/25/2022, 8:46 AM
Hello folks, I recently upgraded our prefect server to 2022.01.12. I also upgrade our prefect version to 0.15.12. While trying to register our flow, I get this error:
The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "flow_registration.py", line 136, in <module>
    register_flows(args.local)
  File "flow_registration.py", line 128, in register_flows
    idempotency_key=flow.serialized_hash())
  File "/usr/local/lib/python3.7/site-packages/prefect/core/flow.py", line 1734, in register
    idempotency_key=idempotency_key,
  File "/usr/local/lib/python3.7/site-packages/prefect/client/client.py", line 1213, in register
    variables=dict(input=inputs),
  File "/usr/local/lib/python3.7/site-packages/prefect/client/client.py", line 555, in graphql
    retry_on_api_error=retry_on_api_error,
  File "/usr/local/lib/python3.7/site-packages/prefect/client/client.py", line 459, in post
    retry_on_api_error=retry_on_api_error,
  File "/usr/local/lib/python3.7/site-packages/prefect/client/client.py", line 740, 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 661, in _send_request
    raise ClientError(f"{exc}\n{graphql_msg}") from exc
prefect.exceptions.ClientError: 400 Client Error: Bad Request for url: <http://prefect-server-apollo.emtrails:4200/graphql>

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"?

The GraphQL query was:

    mutation($input: register_tasks_input!) {
            register_tasks(input: $input) {
                success
        }
    }
Would anyone have encountered a similar issue?
a

Anna Geller

01/25/2022, 9:44 AM
Two questions for troubleshooting: 1. Did your agent and flow registration environment get upgraded too? 2. Did you perform DB migration?
prefect-server upgrade database
:upvote: 1
r

Romain

01/25/2022, 10:02 AM
@Anna Geller indeed it was the db migration missing. Thanks for your help
👍 1
j

Jay Vercellone

03/17/2022, 4:47 PM
To add some info for posterity, make sure your Apollo service is restarted after the migration is completed, so that the changes are picked up at the "controller" level
🙌 1