manyfold icon indicating copy to clipboard operation
manyfold copied to clipboard

Unable to delete non-existing model

Open Dragonsys opened this issue 5 months ago • 6 comments

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:

  1. Go to Problems
  2. Select model which no longer exists
  3. Click on Delete Model (or Resolve selected)
  4. 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 Image

Image

Dragonsys avatar Nov 09 '25 22:11 Dragonsys

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?

Floppy avatar Nov 09 '25 23:11 Floppy

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.

Dragonsys avatar Nov 10 '25 00:11 Dragonsys

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.

Image Image

Dragonsys avatar Nov 10 '25 04:11 Dragonsys

I finally got it to delete. I had to edit the model and add a License, and then it allowed me to delete it.

Dragonsys avatar Nov 10 '25 04:11 Dragonsys

Ah, that's an interesting one... OK, I can chase that down.

Floppy avatar Nov 10 '25 10:11 Floppy

Was the model publicly visible at the time of deletion?

Floppy avatar Nov 11 '25 12:11 Floppy