Corrupt Media Library assets

System Information
  • Strapi Version:
  • Operating System:
  • Database: PostgreSQL
  • Node Version:
  • NPM Version:
  • Yarn Version:

I identified a couple of media library assets that for some reason strapi doesn’t like. When they would show in the “media library” that pages crashes (10 items per page, pages without them show fine). Playing with the heroku postgresql query generator I was able to narrow down the 2 assets, they appear to be tiny .png images. From the heroku query browser doesn’t look like I can delete the images (and I doubt it would be a great idea anyway. When i tried:
“Delete from upload_file where id =72”
it says that I can’t do that from a read-only session :frowning:
Is there a way to manually delete media library assets by ID?

I have found that the Media Library actually creates a database record for each asset. You can manually go into your database and delete the record, and that should remove it from the library as well (at least that’s what has worked for me so far).

1 Like

yup, you are right. My struggle was to get heroku to let me delete the row (they have a “dataclip” query tool but apparently it has read-only access). I was able to get the pgadmin working on firefox, and use that to delete the 2 rows. Now all works. Thanks!

1 Like