Error when trying to delete scraper

I’m trying to delete https://morph.io/chrismytton/netherlands-tweede-kamer-wikidata, but I’m getting the standard “We’re sorry, but something went wrong.” 500 error. I’ve deleted all webhooks and deleted the sqlite database but still the same error.

Thanks! :heart:

Here’s the exception we’re seeing on the application:

 ActiveRecord::StatementInvalid: Mysql2::Error: Cannot delete or update a parent row: a foreign key constraint fails (`morph`.`metrics`, CONSTRAINT `fk_rails_14230a8cc7` FOREIGN KEY (`run_id`) REFERENCES `runs` (`id`)): DELETE FROM `runs` WHERE `runs`.`id` = 199951 

Here’s the issue that’s tracking this problem: https://github.com/openaustralia/morph/issues/1084

Are you able to provide a fix? :tools:

Thanks @henare! I’ve had a look at the code and left a comment over on the GitHub issue :thumbsup:

1 Like

For completeness: now that https://github.com/openaustralia/morph/pull/1145 has been merged this issue has been fixed and deployed, yay! :tada:

2 Likes