Xamarin couchbase server and sync gateway not syncing

In Xamarin, I am trying to sync the local database with sync gateway, but it is not syncing. I am trying it with sample https://github.com/couchbaselabs/mini-hacks/tree/master/kitchen-sync

Local database is getting updated but it is not syncing with sync gateway

I have provided the sync url : http://10.0.0.142:4984/sync_gateway/
Also updated config file

{
“interface”: “:4984”,
“adminInterface”: “:4985”,
“log”:[“CRUD+”, “REST+”, “Changes+”, “Attach+”],
“databases”: {
“sync_gateway”: {
“server”: “walrus:data”,
“bucket”: “sync_gateway”,
“sync”: function(doc) { channel(doc.channels); },
“users”: {
“GUEST”: {
“disabled”: False,
“admin_channels”: [ “*” ]
}
}
}
On checking the data bucket, item count is not getting added up. As I am new to couchbase I dont’t know what I am missing.
Can anyone help me out.

There is no way of knowing without some logs. Xamarin Android logs will be printed to logcat.

Can you access the sync gateway URL from your Android device (http://10.0.0.142:4984/sync_gateway/ in the browser?)

Which data bucket are you checking? The one in Couchbase Server? Your sync gateway is not hooked up to Couchbase Server, but to walrus (a kind of temporary debugging backing store). This is evident by the server: walrus:data line. This needs to be changed to point to Couchbase Server instead. I suggest you look over the configuration options in that case.

No it is not browsable via phone. The ipaddress provided is my system’s ip. Also I have tried the config mentioned in the link https://developer.couchbase.com/documentation/mobile/current/guides/sync-gateway/config-properties/index.html.
But still I am having the issue.

That’s because your first problem is your phone and system cannot communicate with each other. Are they on the same network? Is your system firewall preventing connections? Is Sync Gateway still running? If you can connect via browser to your machine and still have issues then post here.

Firewall was preventing browsing via mobile. I have disabled it. Now I am able to browse http://10.0.0.142:4984/sync_gateway/ and it asked for username and password. but I am not able to sign in. I have tried the username and password I gave for sync gateway. Also tried my system credentials.

Still syncing is not happening. Could you provide any sample with steps to be followed to sync data with couchbase server via sync gateway.

. For xamarin couchbase integration there is no proper document about how to sync data with couchbase server via sync gateway.

If any one could write a detailed blog it would be helpful for beginners who wants to try xamarin couchbase integration.

The config file you showed above enables guest access, so SG should not be requiring any auth. If it is, then either

  • It’s not using the config file you showed above; or
  • there’s some sort of proxy in the way that is asking for auth; or
  • The IP address you’re using is wrong and you’re connecting to some other server that wants auth.

SG should be logging a line for every HTTP request; it will show the URL and the response status. That will let you determine whether you’re actually reaching it from the device’s browser.

Another way to troubleshoot is to use a shell command like curl to hit that URL from the machine running SG, or some other machine on the LAN.

I have added a new user and able to sign in…My issue is local database is not synced with couchbase server…i had changed the above config…changed the server to localhost address…can you post a sample config file and necessary changes to be made…

Xamarin only matters in building the mobile app. Connecting Sync Gateway and Couchbase Server is completely independent of Xamarin. You can look at any writeup about connecting Sync Gateway and Couchbase Server for help.

There is a series of blog posts that all start with “Getting Comfortable with Couchbase Mobile”. Those might help. If not it would be useful to find out more about what information is missing. You can find the first post here: https://blog.couchbase.com/2016/november/getting-comfortable-with-couchbase-mobile-installing-couchbase-server