If we can't query a single document, then why would replications return anything on sync gateway?

When I am trying to access a doc from sync gateway using REST apis endpoints then its not returning anything. I think sync gateway is not able to sync all the docs.

I have also tried to resync Sync Gateway using resync endpoint but still the same issue

From your question, it is not clear what you attempted to do.

Can you please provide specifics

  • The versions of CB software (CB server, Sync Gateway and Couchbase Lite)
  • The exact sequence of steps you followed (e.g. : How did you upload the document, how did query for document)

@priya.rajagopal sorry for in-proper information

Here are the details for CB softwares:

  1. Couchbase server 5.0
  2. Couchbase Sync-gateway 1.5
  3. Couchbase lite1.5

And to upload docs to couchbase db actually I am restoring the production backup db (using cbbackup) and trying to restore the same at my local(using cbrestore).

Also here is the information the way I have tried with:

Endpoint: http://localhost:4984/litehq/f69028390479a98f8e14187477680ebb

Logs I am receiving :

“[sync_1 | 2018-01-13T02:30:23.963Z HTTP: #003: GET /litehq/profile:amoh9516@gmail.com
sync_1 | 2018-01-13T02:30:23.963Z CRUD+: No xattr content found for key=profile:amoh9516@gmail.com, xattrKey=_sync: sub-document path does not exist
sync_1 | 2018-01-13T02:30:23.964Z HTTP: #003: → 400 Invalid JSON: “invalid character ‘\x00’ looking for beginning of value” (1.3 ms)”

Especially this part here No xattr content found for key=profile:amoh9516@gmail.com, xattrKey=_sync: sub-document path does not exist

Not sure but I think its meant like - extended attributes hasn’t been added to the document

Are you using CB Server Enterprise or CE Edition?

OOh…are you sure thats the version of CBL? Because its pretty old …We are at DP 2.0

Anyway, that’s not the cause of your issue , it appears that you would have to update your config file to use XAttrs…

– enable_shared_bucket_access to true: This enables Sync Gateway to use XAttrs
– import_docs to continuous: This causes the Sync Gateway to automatically import documents added via the SDK

This is a sample config file :


{
 "interface":":4984",
 "log": ["*"],
 "databases": {
   "my_db": {
   "import_docs": "continuous",
   "bucket":"my_db",
   "server": "http://localhost:8091",
   "enable_shared_bucket_access":true
  }
 }
}

You can read about it here

thanks @priya.rajagopal let me make a try, hope that will work
Also my CBL version is 1.5 that was a typo actually