https://dagster.io/ logo
#ask-community
Title
# ask-community
j

Jean Gonzalez

07/13/2023, 5:41 PM
In a recent redeploy of dagit and dagster daemon (1.1.20/0.17.20), services suddenly started failing. Any ideas why is complaing about
AttributeError: module 'pydantic._migration' has no attribute 'ModelMetaclass'
(see error below).
Copy code
2023-07-13T10:56:52.946-06:00	Traceback (most recent call last):

2023-07-13T10:56:52.946-06:00	File "/usr/local/bin/dagit", line 5, in <module>

2023-07-13T10:56:52.946-06:00	from dagit.cli import main

2023-07-13T10:56:52.946-06:00	File "/usr/local/lib/python3.9/site-packages/dagit/__init__.py", line 1, in <module>

2023-07-13T10:56:52.946-06:00	from dagster._core.libraries import DagsterLibraryRegistry

2023-07-13T10:56:52.946-06:00	File "/usr/local/lib/python3.9/site-packages/dagster/__init__.py", line 100, in <module>

2023-07-13T10:56:52.946-06:00	from dagster._core.definitions.asset_in import AssetIn as AssetIn

2023-07-13T10:56:52.946-06:00	File "/usr/local/lib/python3.9/site-packages/dagster/_core/definitions/__init__.py", line 86, in <module>

2023-07-13T10:56:52.946-06:00	from .repository_definition import (

2023-07-13T10:56:52.946-06:00	File "/usr/local/lib/python3.9/site-packages/dagster/_core/definitions/repository_definition/__init__.py", line 1, in <module>

2023-07-13T10:56:52.946-06:00	from .repository_definition import (

2023-07-13T10:56:52.946-06:00	File "/usr/local/lib/python3.9/site-packages/dagster/_core/definitions/repository_definition/repository_definition.py", line 17, in <module>

2023-07-13T10:56:52.946-06:00	from dagster._core.definitions.asset_graph import AssetGraph, InternalAssetGraph

2023-07-13T10:56:52.946-06:00	File "/usr/local/lib/python3.9/site-packages/dagster/_core/definitions/asset_graph.py", line 29, in <module>

2023-07-13T10:56:52.946-06:00	from .assets import AssetsDefinition

2023-07-13T10:56:52.946-06:00	File "/usr/local/lib/python3.9/site-packages/dagster/_core/definitions/assets.py", line 25, in <module>

2023-07-13T10:56:52.946-06:00	from dagster._core.definitions.time_window_partition_mapping import TimeWindowPartitionMapping

2023-07-13T10:56:52.946-06:00	File "/usr/local/lib/python3.9/site-packages/dagster/_core/definitions/time_window_partition_mapping.py", line 6, in <module>

2023-07-13T10:56:52.946-06:00	from dagster._core.definitions.partition import PartitionsDefinition, PartitionsSubset

2023-07-13T10:56:52.946-06:00	File "/usr/local/lib/python3.9/site-packages/dagster/_core/definitions/partition.py", line 36, in <module>

2023-07-13T10:56:52.946-06:00	from dagster._core.definitions.target import ExecutableDefinition

2023-07-13T10:56:52.946-06:00	File "/usr/local/lib/python3.9/site-packages/dagster/_core/definitions/target.py", line 9, in <module>

2023-07-13T10:56:52.946-06:00	from .unresolved_asset_job_definition import UnresolvedAssetJobDefinition

2023-07-13T10:56:52.946-06:00	File "/usr/local/lib/python3.9/site-packages/dagster/_core/definitions/unresolved_asset_job_definition.py", line 7, in <module>

2023-07-13T10:56:52.947-06:00	from dagster._core.definitions.run_config import convert_config_input

2023-07-13T10:56:52.947-06:00	File "/usr/local/lib/python3.9/site-packages/dagster/_core/definitions/run_config.py", line 28, in <module>

2023-07-13T10:56:52.947-06:00	from dagster._config.structured_config import Config

2023-07-13T10:56:52.947-06:00	File "/usr/local/lib/python3.9/site-packages/dagster/_config/structured_config/__init__.py", line 23, in <module>

2023-07-13T10:56:52.947-06:00	from dagster._config.structured_config.typing_utils import TypecheckAllowPartialResourceInitParams

2023-07-13T10:56:52.947-06:00	File "/usr/local/lib/python3.9/site-packages/dagster/_config/structured_config/typing_utils.py", line 51, in <module>

2023-07-13T10:56:52.947-06:00	class BaseResourceMeta(pydantic.main.ModelMetaclass):

2023-07-13T10:56:52.947-06:00	File "/usr/local/lib/python3.9/site-packages/pydantic/_migration.py", line 289, in wrapper

2023-07-13T10:56:52.947-06:00	raise AttributeError(f'module {__name__!r} has no attribute {name!r}')

2023-07-13T10:56:52.947-06:00

Copy
AttributeError: module 'pydantic._migration' has no attribute 'ModelMetaclass'
AttributeError: module 'pydantic._migration' has no attribute 'ModelMetaclass'
I wonder if it is a library that got updated to the latest version and is messing with it
b

Bethany Yollin

07/13/2023, 6:14 PM
I saw this on a recent deployment as well. I had to pin
typing_extensions==4.5.0
. I'm on 1.2 btw
👍 1
j

Jean Gonzalez

07/13/2023, 7:01 PM
nice I had to use pydantic version
pydantic==1.10.5