Unable to delete non-existing model
Describe the bug Trying to clean up a model which failed to merge properly, after upgrading to v0.129.0, and it just returns an error about an processable entity.
To Reproduce Steps to reproduce the behavior:
- Go to Problems
- Select model which no longer exists
- Click on Delete Model (or Resolve selected)
- See error
Log File
22:25:32 rails.1 | [d2cb4948-2c91-4d28-92ba-dce042855162] {"method":"POST","path":"/problems/resolve","format":"turbo_stream","controller":"ProblemsController","action":"resolve","status":422,"allocations":6424,"duration":42.09,"view":0.0,"db":2.6,"@timestamp":"2025-11-09T22:25:32.259Z","@version":"1","message":"[422] POST /problems/resolve (ProblemsController#resolve)"}
22:25:32 rails.1 | [d2cb4948-2c91-4d28-92ba-dce042855162]
22:25:32 rails.1 | [d2cb4948-2c91-4d28-92ba-dce042855162] ActiveRecord::RecordInvalid (Validation failed: License can't be blank, Creator can't be blank):
22:25:32 rails.1 | [d2cb4948-2c91-4d28-92ba-dce042855162]
22:25:32 rails.1 | [d2cb4948-2c91-4d28-92ba-dce042855162] app/models/model.rb:171:in 'Model#delete_from_disk_and_destroy'
22:25:32 rails.1 | [d2cb4948-2c91-4d28-92ba-dce042855162] app/controllers/problems_controller.rb:110:in 'ProblemsController#resolve_by_destroying'
22:25:32 rails.1 | [d2cb4948-2c91-4d28-92ba-dce042855162] app/controllers/problems_controller.rb:60:in 'block in ProblemsController#resolve'
22:25:32 rails.1 | [d2cb4948-2c91-4d28-92ba-dce042855162] app/controllers/problems_controller.rb:53:in 'ProblemsController#resolve'
22:25:32 rails.1 | [d2cb4948-2c91-4d28-92ba-dce042855162] app/controllers/application_controller.rb:118:in 'ApplicationController#switch_locale'
22:25:32 rails.1 | /usr/src/app/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.2.1/lib/action_dispatch/middleware/exception_wrapper.rb:176: warning: Status code :unprocessable_entity is deprecated and will be removed in a future version of Rack. Please use :unprocessable_content instead.
Screenshots
When you say "no longer exists", do you mean the files are gone on disk, or the model is gone in Manyfold? Or both? Is this an orphaned Problem record, perhaps?
The files are gone, so I just need to remove the model from the DB. I know I can use the Ruby Console, but I have not tried it yet. I am getting this error with multiple models.
I originally tried to merge them, but that failed, it also failed to import the image for the model. So I moved the model out of the library folder and need to remove them form the DB and try again.
I ran the command to remove all models missing files, from the Ruby console, and it doesn't appear to have worked, as they still show up in my Problems list.
I finally got it to delete. I had to edit the model and add a License, and then it allowed me to delete it.
Ah, that's an interesting one... OK, I can chase that down.
Was the model publicly visible at the time of deletion?