Trouble with asset uploads and reaching quota, but issue resolved by re-downloading images.

18 replies
Last updated: Dec 22, 2022
I'm having trouble with asset uploads on a project. I see a warning in my account about nearing the asset quota, but I have added a credit card to pay for overage. My imports (using the CLI) are getting stuck at 99%.
AI Update

When your CLI asset imports are stuck at 99% and you're seeing warnings about nearing the asset quota, even after adding a credit card, here's what's likely happening:

According to the Sanity Plans and Payments documentation, adding a credit card should enable overage billing automatically for most projects. The documentation states: "Any resource usage beyond the quotas will be billed at overage rates, except for Free projects (no overages allowed) or on a Legacy Free plan without a credit card, which may be temporarily deactivated instead."

The key distinction is your plan type:

  • Free plan projects: These do NOT allow overages at all, regardless of whether you have a credit card on file. You'll need to upgrade to a paid plan (like Growth) to enable overages.
  • Legacy Free plan WITH a credit card: Should automatically allow overages and bill you for them.
  • Paid plans (Growth, Enterprise): Overages are automatically enabled and billed when you have payment information.

Why your imports are stuck at 99%:

The CLI import process is likely hanging because it can upload document metadata successfully, but when it tries to upload the actual asset binaries, it hits the quota limit. The import doesn't fail outright—it just stalls waiting for capacity that won't become available.

Here's how to resolve this:

  1. Check your current plan in Manage. If you're on a Free plan (not Legacy Free), you must upgrade to Growth or higher to allow asset overages.

  2. Verify your payment information is properly attached to the organization that owns the project, not just added to your account.

  3. Contact Sanity support at https://www.sanity.io/contact/sales or through the billing contact option. They can quickly verify if overages are properly configured and may be able to manually lift any restrictions that were applied before you added payment information.

  4. Temporary workaround: If you need to proceed immediately, consider importing documents without assets first, then uploading assets separately once billing is confirmed to be working.

The CLI getting stuck at 99% specifically during asset imports when you're nearing the quota is a clear sign that the project is being throttled at the asset storage limit. Once you've confirmed overages are enabled (or upgraded from a Free plan), the imports should complete normally and you'll be billed for the additional usage.

Bumping this, since I'm really stuck on uploading images.
Hey
user E
! What's your project Id?
y7df71pe
I just deleted my dataset and started re-importing to see if it would help.
Since I still wasn't able to add more assets this morning.
It looks like your organization does have billing details set up on our end. Where are you getting the asset warning? Is it in the CLI or in sanity.io/manage ?
The CLI doesn't give a warning, but hangs at 98% for as many hours as I will let it run.
Ok, then where are you getting the warning?
Until today, the manage page said I was nearing my limit. That message doesn't appear now.
And I see it went over 5GB finally.
I'm still having the same problem:
sanity dataset import ~/Downloads/foxy/works.ndjson production --replace
✔ [100%] Fetching available datasets
✔ [100%] Reading/validating data file (234ms)
✔ [100%] Importing documents (32.56s)
⠋ [ 99%] Importing assets (files/images) (56m 10.95s)
This is really preventing me from launching a new art gallery website.
I still have no ability to complete my uploads. I get stuck on 98% during the import of assets. We're going to have to switch to another CMS to make our deadline if we can't upload our images.
It sounds like something is wrong with those final assets you're trying to upload and it's causing the import script to freeze. What do they look like? How many assets are not being uploaded?
OK, I ran with
DEBUG="<http://sanity.io|sanity.io>"
and I see this when it gets stuck at 98% while uploading images. Does this mean I need to figure out asset 158?

⠴ [ 95%] Importing assets (files/images) (9.82s)  sanity:import [Asset #156] Found image for hash ad58c9c28e6376fa7a4616ebaf4bf97e142449f3 +81ms
⠦ [ 96%] Importing assets (files/images) (9.88s)  sanity:import [Asset #158] Found image for hash 43622d32cde2bfd0de9f780f730b647b10159b0f +80ms
⠧ [ 96%] Importing assets (files/images) (9.95s)  sanity:import [Asset #157] Found image for hash feac054cfd909550bae3d873eb8f870aa6e3db04 +8ms
⠦ [ 98%] Importing assets (files/images) (1m 17.90s)  sanity:import Error encountered, waiting 150 ms before retrying (attempt #1) +0ms
  sanity:import Error details: ECANCELED: operation canceled, read +1ms
⠦ [ 98%] Importing assets (files/images) (1m 19.49s)  sanity:import Error encountered, waiting 150 ms before retrying (attempt #1) +2s
  sanity:import Error details: ECANCELED: operation canceled, read +0ms
  sanity:import Error encountered, waiting 150 ms before retrying (attempt #1) +4ms
  sanity:import Error details: ECANCELED: operation canceled, read +0ms
Wow, that's super frustrating that is doesn't give you more information in that error. And that it doesn't even give you the error if you run the import without the debug flag! What's the size/format of the images you're importing? We could figure out a way for you to share it and I can troubleshoot it on my end.
OK, I figured it out. Some of the images hadn't downloaded completely, and some images were stored in Google Drive (so they download after being accessed). I re-downloaded my images from Cloudinary to my Documents directory (not a cloud drive) and uploads worked.
That's great! Thanks for sharing your solution. It'll be helpful for us to diagnose if a similar situation comes up in the future!

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?