Hi, all! I'm trying to deploy, and my Block is thr...
# ask-community
j
Hi, all! I'm trying to deploy, and my Block is throwing the following error: RuntimeError: no validator found for <class 'pydantic.types.SecretStr'>, see
arbitrary_types_allowed
in Config
a
Try importing secret str from pydantic.v1 if you’re on v2
j
Hey, man - it's looking in the pydantic/v1 folder, so I'm assuming it's using v1 - I am not explicitly installing v2
a
What version of pydantic is in your env?
j
I am not 100% sure, because Prefect is installing it
a
It’s this weird situation I think where Prefect says “install whatever version of pydantic you want” which today defaults to 2+.
So there’s this footgun we put in your hand and fire at your feet
j
File "/home/runner/.local/lib/python3.10/site-packages/pydantic/v1/validators.py", line 765, in find_validators 24 raise RuntimeError(f'no validator found for {type_}, see
arbitrary_types_allowed
in Config') 25 RuntimeError: no validator found for <class 'pydantic.types.SecretStr'>, see
arbitrary_types_allowed
in Config 26 Error: Process completed with exit code 1.
a
yep yep. so wherever you have blocks defined - instead of
from pydantic import SecretStr
you replace with
from pydantic.v1 import SecretStr
what happens
j
Here goes...
It worked!
a
woo
🦜 1
j
Thank you so much!
j
Thank you Adam/Jason, this dialogue helped me just now 🙏
❤️ 1
a
csi yeah
🫡 1