Don't see data in remove Couchbase server when syncing

25 views
Skip to first unread message

Bradley Berthold

unread,
Aug 14, 2014, 12:44:28 PM8/14/14
to mobile-c...@googlegroups.com
Hi all,

New to the couchbase world. 

I have a Couchbase server on a Windows 7 machine. That server is running fine and I can talk to it with a Windows app / C#.

Now, I am writing an android app with Xamarin, using C# as well. So I am using Couchbase Lite.

The Couchbase Lite also works great locally on the Android machine.

Now, my question is, I am trying to test sync from the android device to my Couchbase server. The server is on the same network as my android device.

The "gateway sync server" is running on the same Windows 7 machine as Couchbase server is. This is how I am starting the sync server: 

C:\Program Files (x86)\Couchbase>sync_gateway -bucket default -url http://localhost:8091 -verbose

So, I am trying to just sync to "default" bucket. Maybe this is a bad idea?

From my android app I just call the following code (I have removed user/pass for privacy) 192.168.1.111 is my Windows 7 machine

    var uri = new Uri("http://<user>:<pass>@192.168.1.111:4984/");

    push = db.CreatePushReplication(uri);
    push.Continuous = false;
    push.Start();

Then I get this from sync server:

11:41:41.706377 ==== Couchbase Sync Gateway/1.00 (1.0.1-18; commit 81a69a16) ===
=
11:41:41.708377 Configured Go to use all 8 CPUs; setenv GOMAXPROCS to override t
his
11:41:41.709377 WARNING: Error setting MaxFileDescriptors to 5000: Unsupported o
n Windows -- rest.setMaxFileDescriptors() at config.go:322
11:41:41.710378 Opening db /default as bucket "default", pool "default", server
11:41:41.711878 Opening Couchbase database default on <http://localhost:8091>
11:41:41.817899 Using default sync function 'channel(doc.channels)' for database
 "default"
11:41:41.817899 Starting profile server on
11:41:41.818399 Starting admin server on 127.0.0.1:4985
11:41:41.821900 Starting server on :4984 ...


So it looks like it seems to be "ok"

When I then run my android code to try and sync my local android database, the console window of sync server shows this:

11:42:33.087151 HTTP:  #001: GET /_local/9a7aca2dd558d94bea06056829c3b444bf7c143
7
11:42:33.091152 HTTP:  #002: POST /_revs_diff


I don't see any error messages here


But then when I go to my full couchbase server, I DO have 1 document that was added to "default" but it is named "_sync:seq", and there is nothing in it. I don't see any of the documents that I tried to push.

What might I be doing wrong? Should I not be using "default" as my bucket?

Thanks!

_Brad


Andrew Reslan

unread,
Aug 15, 2014, 11:10:01 AM8/15/14
to mobile-c...@googlegroups.com
You are showing the remote sync URL on Android as:

 var uri = new Uri("http://<user>:<pass>@192.168.1.111:4984/");

But to sync to db /default on sync gateway it should be:

 var uri = new Uri("http://<user>:<pass>@192.168.1.111:4984/default");


Andy

Jens Alfke

unread,
Aug 15, 2014, 12:01:23 PM8/15/14
to mobile-c...@googlegroups.com

On Aug 14, 2014, at 9:44 AM, Bradley Berthold <nikola...@gmail.com> wrote:

    var uri = new Uri("http://<user>:<pass>@192.168.1.111:4984/");

That's not a database URL — it just points to the server. You have to add a database name component. (Since you didn't specify a database name in your command-line options to the gateway, it defaults to "sync_gateway").

11:42:33.091152 HTTP:  #002: POST /_revs_diff

Hm, that should be logging a 404 error since there's no such URL.

I don't see any error messages here

You should be tracking the 'lastError' property of the Replication object; then you'd see the error.

—Jens
Reply all
Reply to author
Forward
0 new messages