Sanity image upload failing with "Upload could not be completed" error
I understand how frustrating this is! The generic "Upload failed - The upload could not be completed at this time" error can have several different causes. Since you've checked the Sanity Status page and everything looks operational, let me walk you through the most common causes and solutions:
1. Check Your Image Schema Configuration
Based on similar error patterns, the most common cause is having invalid options in your image field's metadata array. According to the image metadata documentation, there are three metadata fields that are always included automatically and will cause upload errors if you try to specify them:
dimensions(width and height)hasAlpha(whether the image has an alpha channel)isOpaque(whether the image is fully opaque)
Check your schema - if you have an image field with a metadata configuration like this:
options: {
metadata: ['dimensions', 'location', 'exif'], // ❌ 'dimensions' will cause errors
}You need to remove dimensions, hasAlpha, or isOpaque from the array. The valid values are only:
'exif'- Camera and photo information'location'- GPS coordinates'palette'- Color information (included by default)'lqip'- Low Quality Image Placeholder (included by default)'blurhash'- Compact image representation (included by default)
The fix:
options: {
metadata: ['location', 'exif'], // ✅ Only valid optional fields
}2. CORS Configuration
If the schema isn't the issue, check your CORS origins settings. This is especially important for hosted Studios or custom domains:
- Go to manage.sanity.io
- Select your project
- Navigate to Settings > API > CORS Origins
- Add your Studio's URL (e.g.,
https://your-studio.sanity.studio) - Check the "Allow credentials" checkbox
- For local development, also add
http://localhost:3333(or your local port)
3. Check Browser Console for Specific Errors
Open your browser's developer tools (F12) and check the Console and Network tabs. Look for specific error messages that will tell you exactly what's failing. If you see an error mentioning meta validation or something like "must be one of [location, exif, image, palette, lqip, blurhash, none]", that confirms it's a schema metadata configuration issue.
4. Other Potential Causes
- File size/type: Try uploading a small, simple JPEG to rule out file-specific issues
- Browser issues: Test in an incognito window or different browser
- Authentication: Verify your token has correct permissions if using custom auth
- Network restrictions: Check if your network or firewall is blocking the upload requests
Quick Diagnostic Steps
- Check browser console first - This will give you the most specific error message
- Review your schema - Look for any image fields with
metadataarrays - Test with a fresh project - Try uploading to a new empty project to rule out project-specific issues
Since this is happening both locally and on your hosted Studio, a schema configuration issue (particularly with the metadata array) is the most likely culprit, but the browser console will tell you for certain. Let me know what you see in the console and I can help narrow it down further!
Show original thread10 replies
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.