Preview functionality in GCP Cloud SQL is unsupported
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.3k
- Forks
- 245
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I have deployed Oncall to GCP and am using Cloud SQL as the MySQL DB. Everything works fine until I attempt to Preview a Schedule, which throws an `Internal Server Error` in the UI and the following error in the Python logs:
`pymysql.err.InternalError: (1787, 'When @@GLOBAL.ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1. These statements are also not allowed in a function or trigger because functions and triggers are also considered to be multi-statement transactions.')`
Looks like Temporary Tables are not allowed in GCP Cloud SQL: https://cloud.google.com/sql/docs/mysql/features#differences
It looks like the preview function relies on the existence of a temp table to be passed to the scheduler job, but would the SELECT query that's currently there be enough to pass over to the scheduler? Any guidance on how to work around this?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce Schedule Preview with MySQL on GCP Cloud SQL and trace the preview path that relies on a temporary table before passing data to the scheduler job. Confirm the database restriction and determine whether the existing SELECT-based path can replace that dependency; done means preview no longer returns an internal server error on Cloud SQL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- gcp, mysql, python
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100