Not getting a result for views on sync gateway

Hi,

I have stopped getting result for views suddenly, these were working fine few days ago. Below is the configuration i have:
couchbase server : 6.5,
sync gateway : 2.1.2,

I have recently just added 2 flags in configuration file : 1 shared_bucket_access 2. import_docs and set it as true, and after doing the configuration restarted the sync gateway as well.
Can anyone please help what can cause the this issue.
response for query :
{

  • “total_rows”: 0,
  • “rows”: ,
  • “Collator”: {}

}
earlier response used to give the related documents with total count, if i check individual document id it is present on sync gateway.

@nehatawar68, Can you please post your sync gateway config?
You mentioned that individual document is checked, it exists in sync gateway. Is it showing Zero rows when you hit the API call ‘_all_docs’ to sync gateway?

Hi,

@sridevi.saragadam No, Earlier i was getting the documents with _all_docs and also while accessing the single docs also i was getting the document. But to resolve these issue i have removed these flags and reinstalled my sync gateway. Now i have started getting 502 bad gateway panic errors time to time. And this ran into trouble its not giving any result after. removing Is there any possible way that can resolve this issue?

Hi,

Just an update, after flushing the bucket and redeploying views I am able to get the environment working.
Noted that if we add the property enable_shared_bucket_access and import docs properties , sync meta data of documents goes in extended attributes, which may cause the views into non working state(xattrs). We can redeploy the views by adding the sync matadata xattrs in view function and it can resolve the issue. But after this setting we cannot revert the sync_gateway configuration. Reverting wont resolve the issue rather increase it and will get http panic errors. So if anything of this sort happens try in pre prod always and check the impact of flags and to resolve the issue try flushing the bucket after removing the flags from sync gateway config file.