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

Vineet Balachandran

05/05/2023, 6:44 PM
Hello, I am facing an error like "ImportError: cannot import name 'deserialize_as' from 'dagster._serdes'" while trying to run a job in dagster. Could anyone please let me know if you have faced this issue?
z

Zach

05/05/2023, 6:55 PM
one thing I can think of that might be an issue that could cause this is if your dagit/dagster/dagster-graphql library versions are out of sync. have you checked to make sure all your dagster versions are the same?
v

Vineet Balachandran

05/05/2023, 7:33 PM
Thanks Zach. We have not changed any versions. Is there a way to troubleshoot it.
z

Zach

05/05/2023, 7:34 PM
could you post the whole stack trace?
v

Vineet Balachandran

05/05/2023, 8:13 PM
Traceback (most recent call last): File "/usr/local/bin/dagster", line 8, in <module> sys.exit(main()) File "/usr/local/lib/python3.8/site-packages/dagster/_cli/__init__.py", line 46, in main cli(auto_envvar_prefix=ENV_PREFIX) # pylint:disable=E1123 File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1130, in call return self.main(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python3.8/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/dagster/_cli/api.py", line 63, in execute_run_command DagsterInstance.from_ref(args.instance_ref) File "/usr/local/lib/python3.8/site-packages/dagster/_core/instance/__init__.py", line 536, in from_ref unified_storage = instance_ref.storage File "/usr/local/lib/python3.8/site-packages/dagster/_core/instance/ref.py", line 496, in storage return self.storage_data.rehydrate(as_type=DagsterStorage) if self.storage_data else None File "/usr/local/lib/python3.8/site-packages/dagster/_serdes/config_class.py", line 109, in rehydrate return klass.from_config_value(self, check.not_none(result.value)) File "/usr/local/lib/python3.8/site-packages/dagster/_core/storage/legacy_storage.py", line 113, in from_config_value run_storage = ConfigurableClassData( File "/usr/local/lib/python3.8/site-packages/dagster/_serdes/config_class.py", line 80, in rehydrate module = importlib.import_module(self.module_name) File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 783, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/usr/local/lib/python3.8/site-packages/dagster_postgres/__init__.py", line 3, in <module> from .event_log import PostgresEventLogStorage File "/usr/local/lib/python3.8/site-packages/dagster_postgres/event_log/__init__.py", line 1, in <module> from .event_log import PostgresEventLogStorage File "/usr/local/lib/python3.8/site-packages/dagster_postgres/event_log/event_log.py", line 24, in <module> from dagster._serdes import ConfigurableClass, ConfigurableClassData, deserialize_as ImportError: cannot import name 'deserialize_as' from 'dagster._serdes' (/usr/local/lib/python3.8/site-packages/dagster/_serdes/__init__.py)
z

Zach

05/05/2023, 9:05 PM
can you the version of dagster-postgres, dagster, and dagit that you're using?
v

Vineet Balachandran

05/08/2023, 10:27 PM
Thanks Zach, it was indeed an issue with the version I was using. After updating the version it worked.
🎉 1
7 Views