-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Labels
Description
Description
Singularity will note remove a preparation using the `prep remove` command. Error indicates a sql issue
Steps to Reproduce
- run singularity with mysql as backend
- start a prep
- Run below commands
singularity prep remove --cars 1
Version
singularity v0.5.14-f54c4c1
Operating System
Linux
Database Backend
MySQL
Additional context
$ singularity prep remove --cars 5
2025-03-11T11:23:58.251-0400 INFO database database/connstring.go:45 Opening mysql database
2025-03-11T11:23:58.260-0400 ERROR database database/util.go:80 DELETE FROM `preparations` WHERE `preparations`.`id` = '8' {"rowsAffected": 0, "elapsed": 0.002745421, "err": "Error 1296 (HY000): Got error 193 '`singularity`.`file_ranges`, CONSTRAINT `fk_files_file_ranges` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`) ON DELETE CASCADE' from InnoDB"}
Error 1296 (HY000): Got error 193 '`singularity`.`file_ranges`, CONSTRAINT `fk_files_file_ranges` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`) ON DELETE CASCADE' from InnoDB
This issue exists also when trying to run the delete command manually in mysql. This indicates some sort of mysql issues.
I managed to work around by first manually deleting file_ranges.
DELETE FROM file_ranges WHERE file_id IN (SELECT id FROM files WHERE attachment_id= 5);
Then performing the remove again.
singularity prep remove --cars 5