Can't destroy record, would leave records behind

I'm trying to destroy a record from my database but I'm getting the following error:
** (Ash.Error.Invalid) Input Invalid

* Invalid value provided for id: would leave records behind.

nil
** (Ash.Error.Invalid) Input Invalid

* Invalid value provided for id: would leave records behind.

nil
I'm not sure what could be causing this. I have cascading deletes/nilifies set up and it doesn't seem like the database is throwing the error.
4 Replies
Nefcairon
Nefcairon2y ago
you will have to add some information to get any help. How are your ressources defined? Relationships?
rohan
rohanOP2y ago
Oops sorry I forgot to update this - The issue was that there was a delete that needed to cascade that wasn't marked as :delete_all The error message is just a little opaque, it'd be useful to know why it failed but maybe postgres doesn't pass that information up
jart
jart2y ago
Could you open an issue on Ash and we’ll look into making the error message better. Thanks!
rohan
rohanOP2y ago
will do

Did you find this page helpful?