Hi all, I tried to upgrade from 1.0.6 to 1.0.17, d...
# ask-community
Hi all, I tried to upgrade from 1.0.6 to 1.0.17, deployed in Docker, with MySQL 8.0 storage backend (also running in Docker). In Dagit, when I go to
Overview -> Schedules
, I got the following exception. I also tried 1.0.16, got the same error. I also tried to have a fresh MySQL - still that same error. Going back to 1.0.6 then there's no issue.
Copy code
Operation name: SingleScheduleQuery

Message: (mysql.connector.errors.ProgrammingError) 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTERSECT SELECT run_tags.run_id 
FROM run_tags 
WHERE run_tags.`key` = '.dagste' at line 5
[SQL: SELECT runs.id, runs.run_body, runs.status, runs.create_timestamp, runs.update_timestamp, runs.start_time, runs.end_time 
FROM runs 
WHERE runs.run_id IN (SELECT run_tags.run_id 
FROM run_tags 
WHERE run_tags.`key` = %(key_1)s AND run_tags.value = %(value_1)s INTERSECT SELECT run_tags.run_id 
FROM run_tags 
WHERE run_tags.`key` = %(key_2)s AND run_tags.value = %(value_2)s) ORDER BY runs.id DESC 
 LIMIT %(param_1)s]
[parameters: {'key_1': 'dagster/schedule_name', 'value_1': 'segment_legacy_schedule', 'key_2': '.dagster/repository', 'value_2': 'analytx_assets_repo@generic2', 'param_1': 1}]
(Background on this error at: <https://sqlalche.me/e/14/f405>)

Path: ["scheduleOrError","scheduleState","runs"]

Locations: [{"line":16,"column":9}]
Here is how I create the repository with schedules:
Copy code
def analytx_assets_repo():
    return [

        build_schedule_from_partitioned_job(hour_of_day=3, minute_of_hour=0, job=define_asset_job(
            name="segment_legacy", partitions_def=daily_partitions, tags= ..., selection=...),
Is this a bug, or something in my code which isn't compatible with 1.0.16? Thanks
Might be worth double checking the exact version of MySQL 8.0 you are running? INTERSECT was only added in 8.0.31, which was released on 2022-10-11.
Yep, updating to 8.0.31 should fix the issue!
Thanks. A dump question, is there an option which doesn't require upgrading MySQL? I'm using AWS RDS MySQL, and until now, only 8.0.23 is available.
I think if you were to rewrite your query to not use INTERSECT, it should work just fine.
That query is not part of our code. I couldn't find it in Dagit's code in Github either. I guess it's in some library that Dagit uses.
This code made it in in version 1.0.14, you could downgrade to 1.0.13 until AWS supports this, or modify your dagster library to avoid using this change. Unfortunately no built-in way to avoid using this query though
Thanks Claire. That helps.