Sanity production dataset returning "Internal Error", staging works fine

8 replies
Last updated: Sep 15, 2020
Hey I’m getting some problems on my production dataset, no requests to the API are working and I’m just getting a general “Internal Error”.
If I switch to the staging dataset then sanity studio loads just fine.


[Error] Error: Internal error
cooerceError — listen.js:168
onChannelError — listen.js:95

	(anonymous function) (app.bundle.js:287426)
	(anonymous function)
[Error] Error: Internal error
	(anonymous function) (app.bundle.js:77294)

AI Update

This "Internal error" showing up specifically on your production dataset while staging works fine is typically caused by a backend issue with your production dataset. The listen.js errors with onChannelError and coerceError indicate that Sanity Studio is having trouble establishing or maintaining a connection to your production dataset's API, likely related to the real-time listener functionality that keeps Studio in sync with content changes.

Here are the most common causes and how to troubleshoot:

1. Dataset Corruption or Index Issues (Most Likely)

Since staging works perfectly but production doesn't, this strongly suggests your production dataset has encountered an indexing issue or data corruption on Sanity's backend. This isn't something you can fix yourself.

Action: Contact Sanity support immediately. They can check the backend health of your production dataset, review server logs, and reindex if needed. Since this is affecting production, mention the urgency and they'll prioritize it.

2. API Token or Permission Problems

If you recently changed API tokens or roles/permissions, production might have different access requirements than staging.

Check:

  • Verify your environment variables aren't accidentally using different API tokens between datasets
  • Go to sanity.io/manage → Your Project → API settings to ensure production dataset permissions are correct
  • If using custom roles, verify they're configured properly for production

3. Configuration Mismatch

Double-check your Studio configuration:

// In your sanity.config.ts
export default defineConfig({
  projectId: 'your-project-id',
  dataset: 'production', // Verify this matches exactly
  // ...
})

4. CORS Settings

Production datasets might have different CORS configurations.

Check: Go to sanity.io/manage → Your Project → API → CORS Origins and verify your Studio URL is allowed for the production dataset.

Immediate Steps

  1. Check platform status: Visit status.sanity.io to rule out any ongoing incidents
  2. Clear cache and rebuild: Run sanity deploy again or clear your browser cache completely
  3. Check browser console: Look for any additional error messages that appear before the "Internal error"
  4. Try the API directly: Test if you can query your production dataset using the Vision plugin or a simple GROQ query to see if it's just a Studio issue or a broader API problem

Since this is blocking your production environment and staging works fine, this is almost certainly a backend issue that requires Sanity support to investigate. They have access to server-side logs and dataset health metrics that you don't. Reach out through the help widget in your Studio or at sanity.io/contact/support - they're usually very responsive for production issues.

Show original thread
8 replies
Hi
user H
- do you have anything else reading from these APIs? Or just a studio?
Just a studio and a gatsby-source-sanity.
It seems like some requests are going through intermitently
Does the gatsby site work?
Moving to DM :)
user A
having the same issue here, production only
Hi Brendon - moving to DM

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?