hi! I’m using dagster with docker-compose and from...
# ask-community
t
hi! I’m using dagster with docker-compose and from yesterday I receive en error that I can’t handle ((( Could you help, please? It worked before, I don’t know what really was changes so that the error happens
Copy code
Traceback (most recent call last):

  File "/usr/local/bin/dagit", line 8, in <module>

    sys.exit(main())

  File "/usr/local/lib/python3.9/site-packages/dagit/cli.py", line 225, in main

    cli(auto_envvar_prefix="DAGIT")  # pylint:disable=E1120

  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1130, in __call__

    return self.main(*args, **kwargs)

  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1055, in main

    rv = self.invoke(ctx)

  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke

    return ctx.invoke(self.callback, **ctx.params)

  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 760, in invoke

    return __callback(*args, **kwargs)

  File "/usr/local/lib/python3.9/site-packages/dagit/cli.py", line 160, in dagit

    with get_instance_for_service(

  File "/usr/local/lib/python3.9/contextlib.py", line 119, in __enter__

    return next(self.gen)

  File "/usr/local/lib/python3.9/site-packages/dagster/_cli/utils.py", line 20, in get_instance_for_service

    with DagsterInstance.get() as instance:

  File "/usr/local/lib/python3.9/site-packages/dagster/_core/instance/__init__.py", line 463, in get

    return DagsterInstance.from_config(dagster_home_path)

  File "/usr/local/lib/python3.9/site-packages/dagster/_core/instance/__init__.py", line 479, in from_config

    return DagsterInstance.from_ref(instance_ref)

  File "/usr/local/lib/python3.9/site-packages/dagster/_core/instance/__init__.py", line 491, in from_ref

    unified_storage = instance_ref.storage

  File "/usr/local/lib/python3.9/site-packages/dagster/_core/instance/ref.py", line 463, in storage

    return self.storage_data.rehydrate() if self.storage_data else None

  File "/usr/local/lib/python3.9/site-packages/dagster/_serdes/config_class.py", line 101, in rehydrate

    return klass.from_config_value(self, check.not_none(result.value))

  File "/usr/local/lib/python3.9/site-packages/dagster/_core/storage/legacy_storage.py", line 101, in from_config_value

    event_log_storage = ConfigurableClassData(

  File "/usr/local/lib/python3.9/site-packages/dagster/_serdes/config_class.py", line 101, in rehydrate

    return klass.from_config_value(self, check.not_none(result.value))

  File "/usr/local/lib/python3.9/site-packages/dagster_postgres/event_log/event_log.py", line 134, in from_config_value

    return PostgresEventLogStorage(

  File "/usr/local/lib/python3.9/site-packages/dagster_postgres/event_log/event_log.py", line 91, in __init__

    retry_pg_creation_fn(self._init_db)

  File "/usr/local/lib/python3.9/site-packages/dagster_postgres/utils.py", line 66, in retry_pg_creation_fn

    return fn()

  File "/usr/local/lib/python3.9/site-packages/dagster_postgres/event_log/event_log.py", line 101, in _init_db

    stamp_alembic_rev(pg_alembic_config(__file__), conn)

  File "/usr/local/lib/python3.9/site-packages/dagster/_core/storage/sql.py", line 50, in stamp_alembic_rev

    stamp(alembic_config, rev)

  File "/usr/local/lib/python3.9/site-packages/alembic/command.py", line 671, in stamp

    script.run_env()

  File "/usr/local/lib/python3.9/site-packages/alembic/script/base.py", line 569, in run_env

    util.load_python_file(self.dir, "env.py")

  File "/usr/local/lib/python3.9/site-packages/alembic/util/pyfiles.py", line 94, in load_python_file

    module = load_module_py(module_id, path)

  File "/usr/local/lib/python3.9/site-packages/alembic/util/pyfiles.py", line 110, in load_module_py

    spec.loader.exec_module(module)  # type: ignore

  File "<frozen importlib._bootstrap_external>", line 850, in exec_module

  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed

  File "/usr/local/lib/python3.9/site-packages/dagster/_core/storage/alembic/env.py", line 17, in <module>

    run_migrations_online(context, config, target_metadata)

  File "/usr/local/lib/python3.9/site-packages/dagster/_core/storage/sql.py", line 119, in run_migrations_online

    with connectable.connect() as connection:

AttributeError: 'Connection' object has no attribute 'connect'
dagster bot responded by community 1
🤖 1
a
Might be related to SQLAlchemy 2.0 release. Pin SQLAlchemy in your dependencies to
SQLAlchemy~=1.4
or something like that. See the response here: https://dagster.slack.com/archives/C01U954MEER/p1674792151613009
t
Thank you very much! It helped me !!!
👍 1
l
had the same issue, it helped, thank you !!!