Hey guys,i keep getting this error when i try to pull data from my sever. Could you all please englishten me about it. I can push data but i can’t pull.
“com.couchbase.lite.replicator.ReplicationInternal$4@cc83bac checkSessionAtPath() response: {authentication_handlers=[default, cookie], ok=true, userCtx={channels={!=1}, name=Harris}}”
“07-14 02:33:36.434 14210-14343/com.android.gifts.slidingmenuexample W/Sync: PullerInternal{unknown, pull, 8baa5}: Received invalid doc ID from _changes: {seq=29, id=_user/Harris, changes=[]}”
config.json
{
“log”: [“CRUD+”, “REST+”, “Changes+”, “Attach+”],
“adminInterface”: “127.0.0.1:4985”,
“interface”: “:4984”,
“databases”: {
“foodmenu”: {
“server”: “http://localhost:8091”,
“bucket”:“foodmenu”,
“users”:{
“GUEST”: {“disabled”:false},
“Harris”:
{“password”:“pass”,
“admin_roles”:[“Waiter”]
},
“Joyce”:{
“password”:“pass”,
“admin_roles”: [“Admin”]
},
“Don”:{
“password”:“pass”,
“admin_roles”:[“Chef”]
}
},
“roles” : {
“Waiter”: {“admin_channels”: [“TM”,“AMK”,“CCK”,“EU”]},
“Admin”: {“admin_channels”: [“TM”,“AMK”,“CCK”,“EU”]},
“Chef”: {“admin_channels”: [“TM”,“AMK”,“CCK”,“EU”]}
},
"sync":` function(doc, oldDoc) {
switch(doc.security)
{
case"General":
requireRole(["Waiter","Chef","Admin"]);
channel(["TM","AMK","CCK","EU"]);
break;
case"private":
requireRole("Admin");
channel("TM");
break;
default:
throw({forbidden: "read only!"});
}
}`
}
}
}
Replication method
public void startReplications1(Database database) throws CouchbaseLiteException {
List<String> channels = new ArrayList<String>();
channels.add("TM");
channels.add("AMK");
channels.add("CCK");
channels.add("EU");
Replication pull = database.createPullReplication(this.createSyncURL(false));
Authenticator authenticator = AuthenticatorFactory.createBasicAuthenticator("Harris", "pass");
pull.setAuthenticator(authenticator);
pull.setContinuous(true);
pull.setChannels(channels);
pull.start();
}