Sync_gateway issue

I have a couch base server running on amazon EC2. I have 2 buckets …

  1. sync_gateway for syncing data from web app & mobile app.
  2. myDb for having my documents… “It is my application database”

although sync_gateway service work good on the server (linux - ubuntu14.04 ) but mobile doesn’t receive data from database
so anyone can provide me a reason to track that issue ??

can you post your sync_gateway.json ?

{
“interface”: “:4986”,
“adminInterface”: “:4987”,
“log”: [“CRUD”, “CRUD+”, “HTTP”, “HTTP+”, “Access”, “Cache”, “Shadow”, “Shadow+”, “Changes”, “Changes+”],
“databases”: {
“offary-syncgw”: {
“server”: “http://localhost:8091”,
“bucket”: “offarynpsync”,
“sync”: function (doc, oldDoc) { if (doc.type.toLowerCase().trim() == "usernotifications") { if(doc.userID){var oldID = doc.userID.replace('user',''); var newID = oldID.replace(/[^a-z0-9]/g, ''); requireUser(doc.owner); channel("userNotifications" + newID); access(doc.owner,"userNotifications" + newID); requireAccess("userNotifications"+newID);}else{channel("public");} }else if (doc.type.toLowerCase().trim() == "action") { if(doc.owner){ var oldID = doc.userID.replace('user',''); var newID = oldID.replace(/[^a-z0-9]/g, ''); requireUser(doc.owner);channel("userAction" + newID); access(doc.owner,"userAction" + newID); requireAccess("userAction"+newID)}else{ var today = new Date(); today.setHours(0, 0, 0, 0); var todayTimeStamp= parseInt(today.getTime()/1000); if ((doc.created_at/1000) >= todayTimeStamp) { channel("public"); } else { channel("hiddenDocs");}}}else if (doc.type.toLowerCase().trim() == "user") { var oldID = doc._id.replace('user',''); var newID = oldID.replace(/[^a-z0-9]/g, '');requireUser(doc.sync_gateway.name); channel("userprofile" + newID); access(doc.sync_gateway.name, "userprofile" + newID); access(doc.sync_gateway.name, "userNotifications" + newID); access(doc.sync_gateway.name, "userAction" + newID);} else if ((doc.type.toLowerCase().trim() == "brand" && (doc.status == 1 || doc.status == "st1") && doc.suspend == 0 && doc.br > 0 && doc.offers.length > 0 && doc.branches.length > 0 && doc.remainingNumberOfClicks > 0 && (doc.country.toLowerCase().trim() == 'ae' || doc.country.toLowerCase().trim() == "united arab emirates")) || (doc.type.toLowerCase().trim() == "category" && (doc.country.toLowerCase().trim() == 'ae' || doc.country.toLowerCase().trim() == "united arab emirates") && doc.brands && doc.brands.length > 0 && !doc.deleted_at) || (doc.type.toLowerCase().trim() == "mall" && (doc.country.toLowerCase().trim() == 'ae' || doc.country.toLowerCase().trim() == "united arab emirates")&& doc.brands && doc.brands.length > 0 && !doc.deleted_at) ){ channel("AE"); requireAccess("AE"); } else if ((doc.type.toLowerCase().trim() == "country" && !doc.deleted_at)) {channel("public");requireAccess("public");} else {channel("hiddenDocs");requireAccess("hiddenDocs");}},
“users”: {
“GUEST”: {
“disabled”: true
},
“admin”:{
“password”:“123”,
“admin_channels”:[“public”,“AE”,“EG”]
}
},
“shadow”: {
“server”: “http://localhost:8091”,
“bucket”: “offarynp”
}

    }
}

}

do you start pull replication from mobile side?
can you get the data via Sync Gateway REST public API with the same user as mobile?
how you use shadow bucket?

can you get the data via Sync Gateway REST public API with the same user as mobile?
Ans: in normal Scenario yes but in this case No we can’t get data Via Sync Gateway REST API and to solve this issue we just restart sync_gateway service

how you use shadow bucket?
Ans: we just create two buckets, one for sync gateway bucket and another main bucket… we put data in main bucket and by sync-gateway configuration … the data will display in shadow bucket… any change from mobile side or from back-end side effect normally between two buckets