run_tags table not created during initial schema creation in mysql
See original GitHub issueDagster version
0.15.6
What’s the issue?
I am using the following Dagster config for schedules in a local, empty installation:
schedule_storage:
module: dagster_mysql.schedule_storage
class: MySQLScheduleStorage
# ... etc
On first run, the following tables are created:
'alembic_version'
'asset_keys'
'bulk_actions'
'daemon_heartbeats'
'event_logs'
'instance_info'
'instigators'
'job_ticks'
'jobs'
'kvs'
'runs'
'secondary_indexes'
'snapshots'
However, no runs_tags
table exists. As a result, I see an error in the Dagit UI on the Schedules page:
Operation name: InstanceSchedulesQuery
Message: (mysql.connector.errors.ProgrammingError) 1146 (42S02): Table 'dagster_db.run_tags' doesn't exist
[SQL: SELECT subquery.id, subquery.run_body, subquery.status, subquery.create_timestamp, subquery.update_timestamp, subquery.start_time, subquery.end_time
FROM (SELECT runs.id AS id, runs.run_body AS run_body, runs.status AS status, runs.create_timestamp AS create_timestamp, runs.update_timestamp AS update_timestamp, runs.start_time AS start_time, runs.end_time AS end_time, rank() OVER (PARTITION BY run_tags.value ORDER BY runs.id DESC) AS `rank`
FROM runs INNER JOIN run_tags ON runs.run_id = run_tags.run_id
WHERE run_tags.`key` = %(key_1)s AND run_tags.value IN (%(value_1_1)s)) AS subquery
WHERE subquery.`rank` <= %(rank_1)s ORDER BY subquery.`rank` ASC]
[parameters: {'key_1': 'dagster/schedule_name', 'rank_1': 1, 'value_1_1': 'my_schedule'}]
(Background on this error at: https://sqlalche.me/e/14/f405)
Path: ["repositoriesOrError","nodes",0,"schedules",0,"scheduleState","runs"]
Locations: [{“line”:141,“column”:3}]
What did you expect to happen?
The Schedules feature should work in a fresh installation without any issues.
How to reproduce?
Repro steps are the same as in this bug https://github.com/dagster-io/dagster/issues/4324
Simply start with a fresh, empty mysql database with Dagster 0.15.6, and this will be the result.
I may attach a gist with a docker-compose for fast repro.
Deployment type
Docker Compose
Deployment details
This is being done locally using a custom Docker Compose project
Additional information
I am guessing https://github.com/dagster-io/dagster/pull/7815 this PR introduced the bug. @prha and @gibsondan perhaps could have a second look.
Message from the maintainers
Impacted by this issue? Give it a 👍! We factor engagement into prioritization.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
We think this might be a race-condition bug in initializing the database. If this is a clean setup, you might want to wipe everything and try initializing again?
Hi Mike… the run tags table is associated with run_storage. Is your run storage also configured to use the same MySQL db?
It’d look something like this: