manyfold3d / manyfold

A self-hosted digital asset manager for 3d print files. Previously named "VanDAM"
https://manyfold.app
MIT License
575 stars 41 forks source link

Cannot remove duplicate files #2301

Closed kiguy2052 closed 1 day ago

kiguy2052 commented 1 week ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior: Upload the same model twice Remove one of the models from the folder mounted outside docker back in manyfold, scan and make sure the model is tagged try to purge/delete the empty duplicate tagged model

Expected behavior The model should be deleted

Screenshots image

docker logs: db-1 | 2024-06-23 21:12:53.332 UTC [287] ERROR: update or delete on table "model_files" violates foreign key constraint "fk_rails_b5ac05b6e3" on table "model_files" db-1 | 2024-06-23 21:12:53.332 UTC [287] DETAIL: Key (id)=(1367) is still referenced from table "model_files". db-1 | 2024-06-23 21:12:53.332 UTC [287] STATEMENT: DELETE FROM "model_files" WHERE "model_files"."id" = $1

Desktop (please complete the following information):

Floppy commented 2 days ago

This feels very similar to https://github.com/manyfold3d/manyfold/issues/1929, in that it's a failure in removing relationships that the database is enforcing. Probably has a very similar solution.

Floppy commented 2 days ago

Actually, given that it's complaining about a link from model_files to model_files, it well might be the same error; do you know if the model had linked supported and unsupported files @kiguy2052?

kiguy2052 commented 1 day ago

I didn't notice that at the time, but going back through, the models I had issues with all had linked supported and unsupported models.

On Mon, Jul 1, 2024 at 6:11 AM James Smith @.***> wrote:

Actually, given that it's complaining about a link from model_files to model_files, it well might be the same error; do you know if the model had linked supported and unsupported files @kiguy2052 https://github.com/kiguy2052?

— Reply to this email directly, view it on GitHub https://github.com/manyfold3d/manyfold/issues/2301#issuecomment-2199865258, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACREVJFFA74OZK7AAEL3IBDZKE2NDAVCNFSM6AAAAABJY2TXY6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJZHA3DKMRVHA . You are receiving this because you were mentioned.Message ID: @.***>

Floppy commented 1 day ago

Ok cool, pretty sure this is the same issue then. Thanks :)

Floppy commented 1 day ago

closing as duplicate of #1929