👀 Our most exciting product launch yet 🚀 Join us May 8th for Sanity Connect

Issue with stuck files in upload state resolved by deleting them via CLI in Sanity Studio 3.14.3.

8 replies
Last updated: Jul 26, 2023
Hi, a client uploaded some files for a pressroom section, but some files are stuck in upload state. i cant delete them because in “Media” they have references, when i try to access them via schema i get an “Error: undefined is not an object (evaluating ‘uploadState.file.name’)“. the weird thing is: when i download the file from the frontend it works like a charm.
anybody knows how i could access uploadState? or force delete media? appreciate
🙂
Jul 26, 2023, 4:47 PM
You likely will have to delete them using the CLI. What version of the Studio is this happening in?
Jul 26, 2023, 4:48 PM
This is happening in 3.14.3
Jul 26, 2023, 4:53 PM
deleting them via cli worked! thank you 🙂
Jul 26, 2023, 5:04 PM
Glad it worked! Are you using the Media plugin?
Jul 26, 2023, 5:05 PM
Yes i am, it seems like my client published the document before the upload finished. i had to delete only draft versions via CLI and now it works even without re-uploading.
Jul 26, 2023, 5:10 PM
Ah it must have gotten itself into some weird state since the upload didn’t finish. Probably something the Studio should be able to handle, though!
Jul 26, 2023, 5:13 PM
hope i could help to improve the studio performance 🙂 thanks a lot for helping so quickly!
Jul 26, 2023, 5:21 PM
You’re welcome!
Jul 26, 2023, 5:22 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?