-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding OTEL labels on flow runs breaks ECS push work pool workers #16066
Comments
thanks for the report @krishnan-chandra! we will take a look and update here noting for later: i have reproduced this trivially importing In [1]: import prefect.main; import uuid;
In [2]: from prefect.client.schemas.objects import FlowRun
In [3]: FlowRun(flow_id=uuid.uuid4(), labels=None)
---------------------------------------------------------------------------
ValidationError Traceback (most recent call last)
Cell In[3], line 1
----> 1 FlowRun(flow_id=uuid.uuid4(), labels=None)
File ~/github.com/prefecthq/prefect/.venv/lib/python3.12/site-packages/pydantic/main.py:212, in BaseModel.__init__(self, **data)
210 # `__tracebackhide__` tells pytest and some other tools to omit this function from tracebacks
211 __tracebackhide__ = True
--> 212 validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
213 if self is not validated_self:
214 warnings.warn(
215 'A custom validator is returning a value other than `self`.\n'
216 "Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n"
217 'See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.',
218 category=None,
219 )
ValidationError: 1 validation error for FlowRun
labels
Input should be a valid dictionary [type=dict_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.9/v/dict_type but its not yet clear why edit: this reproduces the problem in cloud run push pools (with no other job variables) from prefect import flow
if __name__ == "__main__":
flow.from_source(
source="https://gist.github.com/3eb9333625d465cb74381c5116be7aee.git",
entrypoint="tour_of_artifacts.py:main",
).deploy(
name="repro-16066",
work_pool_name="sbx-cloud-run-push",
) though serving or using a process worker locally appears to work fine |
this was automatically closed by github upon merging the PR linked above but ill keep this open until we confirm things are working |
Thanks! If a new dev release comes out with the fix I'm happy to use that to test on my end. |
This has been fixed with Prefect 3.1.4, thanks for the quick turnaround! |
We are experiencing a similar issue when we have schedules enabled for a flow. The issue goes away if no flows with schedules are on a worker.
|
Bug summary
We run push work pools in AWS ECS, and orchestrate using Prefect Cloud. We recently upgraded from Prefect 2 -> 3, and our containers in ECS started failing with the below error:
The
labels
field on flow runs was first introduced in this PR and was released in Prefect version 3.1.3. Downgrading to version 3.1.2 fixes this issue.We do not have OpenTelemetry installed/configured, which might be why
labels
is a null value.A solution may be to make the
labels
field optional, or add in a PydanticBeforeValidator
to coerceNone
to an empty dictionary.Version info
Additional context
No response
The text was updated successfully, but these errors were encountered: