Revtreelist data is invalid, revs/parents/channels counts are inconsistent Error on Gateway

We are getting this error on our gateway:

WARNING: Error unmarshaling doc <DOC_ID>: revtreelist data is invalid, revs/parents/channels counts are inconsistent – db.(*document).UnmarshalJSON() at document.go:600

coming across our gateway on a few different documents.

I’m trying to figure out more about why this would occur and What possible ways I can fix it. It seems to be causing our gateway to use a significant amount of CPU.

From my own research it seems to be an issue with this sync data on the document?

I can view the document in the database portal (8091), but When I try to get the document from the gateway I get the error above.
I also cannot view the document on the gateway admin portal.

Any suggestions or further documentation on this issue? Or perhaps a way to force reset the sync on the document?


What do you see what you query for the doc via the _raw API on the SGW ?

You could also try this unofficial API if you are on 1.5 …

Thanks for the quick reply @priya.rajagopal.

I see:

When trying to access it through the admin port raw doc url:


through API request:

“error”: “Internal Server Error”,
“reason”: “Internal error: revtreelist data is invalid, revs/parents/channels counts are inconsistent”

I was also wondering perhaps there is a way to overwrite the contents of the document/ save a new document over it-- to possibly reset the sync data.

Thanks again

Did you try removing the document from the CB server admin console and re-adding it via the REST API ?


I have not, How would I go about removing it?

Do you mean deleting it from :8091 (with the delete button), and then re-adding it from the Sync REST API?


Yeah- can you try that ?. The error you are seeing does not ring a bell …not sure how doc got into this state