ECONNRESET error when downloading assets during dataset export
I feel your pain β ECONNRESET errors during asset downloads are frustrating, especially when the export was working fine before! This is typically a network or connection issue when downloading assets from Sanity's CDN. Here are several solutions to try:
Quick Fix: Reduce Asset Concurrency
The most common solution is to reduce the number of concurrent asset downloads. The CLI has an --asset-concurrency flag for this:
sanity dataset export production --asset-concurrency 5The default is 12 concurrent downloads, which can overwhelm your connection or hit rate limits. Try starting with 5 and adjust up or down based on what works for your network.
Other Solutions to Try
1. Export without assets first, then retry
# Export documents only (fast)
sanity dataset export production production-docs.ndjson --no-assets
# Then export with assets and lower concurrency
sanity dataset export production production-full.tar.gz --asset-concurrency 32. Check your Node.js version
ECONNRESET errors with TLS connections can sometimes be Node.js version-related. Make sure you're running a stable LTS version (Node 20+ is required for newer Sanity tooling). Try updating if you're on an older version:
node --version3. Network/firewall issues
- Try from a different network (mobile hotspot, different WiFi)
- Check if your firewall or VPN is interfering with long-running downloads
- Corporate networks sometimes have aggressive connection timeouts
4. Retry during off-peak hours
If Sanity's CDN is experiencing high load, you might have better luck at different times of day.
5. Check Sanity's status
Visit status.sanity.io to see if there are any ongoing issues with asset delivery or the CDN.
If Nothing Works
For very large datasets, you might need to:
- Contact Sanity support β they can sometimes help with large exports
- Consider using the Export API directly with custom retry logic
- If you're on an Enterprise plan, look into Cloud Clone which handles dataset copying server-side without downloading locally
The --asset-concurrency flag is usually the magic fix though β start there!
Show original thread7 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.