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

Ruslan Babadzhanov

06/14/2023, 11:53 AM
Hi team, I am trying to use Auto Materilialization Asset with DBT. I added
Copy code
+dagster_auto_materialize_policy: 
            type: lazy
to my models. But then I've got an GraphQL error :
Copy code
Operation name: GetAutoMaterializePausedQuery

Message: (psycopg2.errors.UndefinedTable) relation "kvs" does not exist
LINE 2: FROM kvs 
             ^

[SQL: SELECT kvs.key, kvs.value 
FROM kvs 
WHERE kvs.key IN (%(key_1_1)s)]
[parameters: {'key_1_1': 'ASSET_DAEMON_PAUSED'}]
(Background on this error at: <https://sqlalche.me/e/20/f405>)

Path: ["instance","autoMaterializePaused"]

Locations: [{"line":4,"column":5}]

Stack Trace:
  File "/usr/local/lib/python3.7/site-packages/graphql/execution/execute.py", line 521, in execute_field
    result = resolve_fn(source, info, **args)
  File "/usr/local/lib/python3.7/site-packages/dagster_graphql/schema/instance.py", line 168, in resolve_autoMaterializePaused
    return get_auto_materialize_paused(self._instance)
  File "/usr/local/lib/python3.7/site-packages/dagster/_daemon/asset_daemon.py", line 22, in get_auto_materialize_paused
    instance.daemon_cursor_storage.get_cursor_values({ASSET_DAEMON_PAUSED_KEY}).get(
  File "/usr/local/lib/python3.7/site-packages/dagster/_core/storage/runs/sql_run_storage.py", line 1138, in get_cursor_values
    KeyValueStoreTable.c.key.in_(keys)
  File "/usr/local/lib/python3.7/site-packages/dagster/_core/storage/runs/sql_run_storage.py", line 116, in fetchall
    return db_fetch_mappings(conn, query)
  File "/usr/local/lib/python3.7/site-packages/dagster/_core/storage/sqlalchemy_compat.py", line 35, in db_fetch_mappings
    return conn.execute(query).mappings().all()
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1416, in execute
    execution_options or NO_OPTIONS,
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 484, in _execute_on_connection
    self, distilled_params, execution_options
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1647, in _execute_clauseelement
    cache_hit=cache_hit,
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1847, in _execute_context
    dialect, context, statement, parameters
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1988, in _exec_single_context
    e, str_statement, effective_parameters, cursor, context
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2344, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1969, in _exec_single_context
    cursor, str_statement, effective_parameters, context
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 920, in do_execute
    cursor.execute(statement, parameters)

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

Message: psycopg2.errors.UndefinedTable: relation "kvs" does not exist
LINE 2: FROM kvs 
             ^



Stack Trace:
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1969, in _exec_single_context
    cursor, str_statement, effective_parameters, context
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 920, in do_execute
    cursor.execute(statement, parameters)
Dagster version 1.3.9 , dbt-core 1.4.0. Could smb suggest smth?
o

owen

06/14/2023, 6:32 PM
hi @Ruslan Babadzhanov! this is a bit surprising, but you may need to run
dagster instance migrate
if it's been quite awhile since you set up dagster initially. cc @johann any other thoughts on what might be causing this?
🙏 1
j

johann

06/14/2023, 6:43 PM
Yes,
dagster instance migrate
will solve that
🙏 1
23 Views