SQLite: Foreign key constraints can be disabled #104305
Labels
No Label
Good First Issue
Priority
High
Priority
Low
Priority
Normal
Status
Archived
Status
Confirmed
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Job Type
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: studio/flamenco#104305
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Flamenco Version
Is Broken: 3.5 and older 3.x releases
Worked OK: never
Short description of error
When the Flamenco process is running for long enough, it seems that GORM can close the sqlite connection and create a new one by itself. Since that then doesn't execute the
PRAGMA
SQL commands to enable foreign key constraints, these constraints are disabled on this new connection. The result is that deleting a job will not delete its tasks, and same for other deletion operations.Exact steps for others to reproduce the error
This is hard to reproduce, as it includes (for me) unknown GORM behaviour.
Solution
Replace GORM with something that either provides an on-connect callback function, or doesn't reconnect by itself. Work is already underway to replace GORM with sqlc in #104304.
Note that there are already some guards in place, that refuse to delete jobs / workers / tags when foreign key constraints are disabled.