Hey everyone, I'm getting the following error Pyda...
# ask-community
b
Hey everyone, I'm getting the following error Pydantic error (in thread) when a scheduled deployment runs. It looks like there's some issue with the way I've defined the schedule in
prefect.yaml
, but no change has been made to this and I have other scheduled deployments that are working fine with similar configuration. Has anyone run into this?
Error:
Copy code
pydantic.v1.error_wrappers.ValidationError: 8 validation errors for DeploymentResponse
schedule -> interval
  field required (type=value_error.missing)
schedule -> timezone
  argument of type 'function' is not iterable (type=type_error)
schedule -> cron
  extra fields not permitted (type=value_error.extra)
schedule -> day_or
  extra fields not permitted (type=value_error.extra)
schedule -> timezone
  argument of type 'function' is not iterable (type=type_error)
schedule -> rrule
  field required (type=value_error.missing)
schedule -> cron
  extra fields not permitted (type=value_error.extra)
schedule -> day_or
  extra fields not permitted (type=value_error.extra)
schedule config:
Copy code
schedule:
    cron: 0 18 * * *
    timezone: UTC
    day_or: true
cc @Kiley Roberson
n
hi @Brian Oldak - are you able to see the pinned messages in this channel? im not sure if its too old, so ill copy it here _ hey all! heads up 🚨 if you encounter an error like this when creating or running a deployment:
Copy code
pydantic.error_wrappers.ValidationError: 8 validation errors for DeploymentResponse
schedule -> interval
  field required (type=value_error.missing)
schedule -> timezone
  argument of type 'function' is not iterable (type=type_error)
schedule -> cron
  extra fields not permitted (type=value_error.extra)
schedule -> day_or
  extra fields not permitted (type=value_error.extra)
schedule -> timezone
  argument of type 'function' is not iterable (type=type_error)
schedule -> rrule
  field required (type=value_error.missing)
schedule -> cron
  extra fields not permitted (type=value_error.extra)
schedule -> day_or
  extra fields not permitted (type=value_error.extra)
An exception occurred.
you're probably on an old version of
prefect
before we pinned
pendulum < 3
(they just released breaking changes that cause the above) - there are two paths to fix: • upgrade to
prefect >= 2.14.11
(when we pinned this dependency) • pin
pendulum >= 2.1.2, < 3.0.0
yourself wherever your error was occurring if you're still encountering this error after doing either of the above, please let us know!
so i'd be curious to see your versions of prefect and pendulum
b
ah sorry i missed that
n
no worries! i know slack deletes old stuff so i wasnt sure if it was still visible for you
b
we're using poetry to manage deps. prefect is at 2.18.3 and pendulum is at 3.0.0 in our lock file
but also in my prefect.yaml
prefect-version
is set 2.11.1. Not sure how those interact
n
that version in the
prefect.yaml
is likely just an artifact of when that file was created are you getting this error on your worker?
b
not sure on that. currently just seeing it in the prefect ui for the deployment run
n
I would guess that the error is happening on your worker (which we surface on the flow run in the UI), which may have a much older prefect version if you havent touched it in a while do you have the ability to update that worker's version of prefect?
b
let me check on that
👍 1
ok yes i see that error there
still odd to me that this is the only deployment for which this is failing though given that other deployments have the same config
does look like our prefect-worker is running prefect 2.11.3 i believe
not sure how to update this though, will have to look into that
n
do you know where / how the worker runs? high level it should just be a
pip install -U prefect
wherever that process is, and restarting it
b
it runs in k8s in GCP. not sure how this was set up exactly
n
okay! ill just throw out that if its the helm chart it should just be something like this
Copy code
» helm upgrade prefect-worker prefect/prefect-worker \
  --namespace=prefect \
  -f values.yaml --version 2024.7.15170357
b
ah got it, okay i'll take a look at that and see if it fixes it
👍 1
thank you!
366 Views