prefect icon indicating copy to clipboard operation
prefect copied to clipboard

Integer too large `ValidationError` in `FlowRun.parameters` leads to 500 response when polling for runs

Open zangell44 opened this issue 6 months ago • 0 comments

Bug summary

If a flow run contains an integer that exceeds the 64-bit range, a ValidationError will be raised when trying to read the flow run from the API, including polling for scheduled work. This exception leads to a 500 response, potentially blocking other work from executing.

ValidationError(model='FlowRun', errors=[{'loc': ('parameters',), 'msg': 'Integer exceeds 64-bit range', 'type': 'type_error'}])

We should do two things to mitigate

  1. Wherever possible, validate flow run parameters when they are created. Ideally these runs would never make it into the database.
  2. In the event we still encounter it, catch ValidationError and return a 422 response with an explanation.

Version info (prefect version output)

`main`

Additional context

No response

zangell44 avatar Aug 21 '24 13:08 zangell44