Skip to content
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

Flow runs failing due to pydantic duplicate validator function error #9700

Closed
4 tasks done
johnkangw opened this issue May 23, 2023 · 3 comments
Closed
4 tasks done
Labels
bug Something isn't working status:upstream An upstream issue caused by a bug in one of our dependencies

Comments

@johnkangw
Copy link

First check

  • I added a descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the Prefect documentation for this issue.
  • I checked that this issue is related to Prefect and not one of its dependencies.

Bug summary

Starting with Prefect 2.10.10 we receive an error and cannot start flow runs due to a pedantic error. Downgrading to 2.10.9 solves the issue

Reproduction

Flow run agate-guan entered state Failed. 

    Timestamp: 2023-05-23T17:40:01.037317+00:00
    Flow ID: 7ebd328d-8a2b-400c-a4c1-6b508b34927d
    Flow Run ID: e0590a8c-c77e-4762-81f2-13cb53090499
    State message: Flow could not be retrieved from deployment. Traceback (most recent call last):
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "tasks.py", line 68, in <module>
    from utils.snowflake_fetch_data import auction_code_details_pull, userid_email_list_pull
  File "/tmp/tmprthaaccmprefect/utils/snowflake_fetch_data.py", line 9, in <module>
    from prefect_snowflake.database import SnowflakeConnector
  File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.9/site-packages/prefect_snowflake/__init__.py", line 2, in <module>
    from prefect_snowflake.credentials import SnowflakeCredentials  # noqa
  File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.9/site-packages/prefect_snowflake/credentials.py", line 42, in <module>
    class SnowflakeCredentials(CredentialsBlock):
  File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.9/site-packages/prefect_snowflake/credentials.py", line 123, in SnowflakeCredentials
    def _validate_auth_kwargs(cls, values):
  File "pydantic/class_validators.py", line 134, in pydantic.class_validators.root_validator.dec
  File "pydantic/class_validators.py", line 156, in pydantic.class_validators._prepare_validator
pydantic.errors.ConfigError: duplicate validator function "prefect_snowflake.credentials.SnowflakeCredentials._validate_auth_kwargs"; if this is intended, set `allow_reuse=True`

The above exception was the direct cause of the following exception:

ScriptError: Script at 'tasks.py' encountered an exception: ConfigError('duplicate validator function "prefect_snowflake.credentials.SnowflakeCredentials._validate_auth_kwargs"; if this is intended, set `allow_reuse=True`')


Deployment name: Capacity Data update - staging Deployment version: 5336b4eb31ad02f7aed40e46961bdb95 Deployment parameters: {}

Error

No response

Versions

The below version is taken from my local machine. We are running the prefect agent on ubuntu-22.04

Version:             2.10.10
API version:         0.8.4
Python version:      3.11.3
Git commit:          8159450b
Built:               Thu, May 18, 2023 3:43 PM
OS/Arch:             win32/AMD64
Profile:             new_dell
Server type:         cloud

Additional context

No response

@johnkangw johnkangw added bug Something isn't working status:triage labels May 23, 2023
@desertaxle
Copy link
Member

desertaxle commented May 23, 2023

Hey @johnkangw, I think this is related to this pyadntic issue: pydantic/pydantic#5821. What version of typing-extensions do you have installed? It seems the workaround for this issue is to downgrade to typing-extensions==4.5.0.

@desertaxle
Copy link
Member

It looks like a fix was released in Pydantic version 1.10.8. Upgrading to Pydantic 1.10.8 should resolve the issue.

@desertaxle desertaxle added status:upstream An upstream issue caused by a bug in one of our dependencies and removed status:triage labels May 23, 2023
@johnkangw
Copy link
Author

@desertaxle Thanks so much! The pydantic update fixed it!

@zanieb zanieb closed this as completed May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status:upstream An upstream issue caused by a bug in one of our dependencies
Projects
None yet
Development

No branches or pull requests

3 participants