https://prefect.io logo
j

Joe McDonald

08/04/2021, 6:00 PM
So ran into something new today after updating to 0.15.3 on all server components. For simplicity, here is a flow run creation in interactive UI:
Copy code
mutation {
  create_flow_run(
    input: {
      flow_id: "f667e3f3-b5eb-4c52-8f90-36bc54633ac9", 
      parameters: "{\"file_id\": \"42556bd0-f495-11eb-a7a0-8c8590acd4d8\"}"
    }
  ) {
    id
  }
}
Which gives this output. We are getting the same output from our code that runs against graphql endpoint to trigger a flow run and has been working fine for months on 0.14.15.
Copy code
{
  "errors": [
    {
      "message": "[{'extensions': {'path': '$.variableValues.insert_on_conflict.constraint', 'code': 'validation-failed'}, 'message': 'unexpected value \"ix_flow_run_idempotency_key_unique\" for enum: \\'flow_run_constraint\\''}]",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "create_flow_run"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "exception": {
          "message": "[{'extensions': {'path': '$.variableValues.insert_on_conflict.constraint', 'code': 'validation-failed'}, 'message': 'unexpected value \"ix_flow_run_idempotency_key_unique\" for enum: \\'flow_run_constraint\\''}]"
        }
      }
    }
  ],
  "data": {
    "create_flow_run": null
  }
}
This is with server components running in an ECS cluster with an RDS database, is there a database upgrade that may not have been executed? Is there a way to trigger it from graphql?
Just for anyone else, I used the helm chart as a guide like I did for setting up the ECS cluster and ran graphql without the
PREFECT_SERVER_DB_CMD
env variable and changed command to
/usr/local/bin/prefect-server database upgrade --yes
https://github.com/PrefectHQ/server/blob/master/helm/prefect-server/templates/graphql/deployment.yaml
tags for things I searched so if others search:
Copy code
db-upgrade alembic upgrade postgres ix_flow_run_idempotency_key_unique
k

Kevin Kho

08/04/2021, 8:39 PM
@Marvin archive “Upgrade Database when Using Server on ECS” in server
k

Kevin Kho

08/04/2021, 8:41 PM
Hey @Joe McDonald, thanks for the detailed writeup! Glad you figured it out, will keep this reference if I happen to see it again. Just a note though that unfortunately, it is hard for us to support deployments outside of the standard
prefect server start
with docker-compose or using the helm chart.