Push replication works, but not pull

109 views
Skip to first unread message

Sebastien ARBOGAST

unread,
Jan 10, 2015, 5:10:28 AM1/10/15
to mobile-c...@googlegroups.com
I'm trying to set up an iOS Swift app to sync with sync gateway on a cluster configured with Traun's tutorial (http://tleyden.github.io/blog/2014/12/15/running-a-sync-gateway-cluster-under-coreos-on-aws)

I enabled guest access. Here is my sync gateway config:

{
"log": ["CRUD", "REST+", "Access"],
"databases": {
"mydb": {
"server":"http://127.0.0.1:8091",
"bucket":"mydb",
"users": {
"GUEST": {"disabled": false, "all_channels": ["*"], "admin_channels": ["*"]}
},
"sync": `
function(doc, oldDoc) {
channel(doc.channels);
}
 
`
}
}
}

And the in my app I configured my replications:

let url = NSURL(string: "http://myserver.com/mydb")
let push = database.createPushReplication(url)
let pull = database.createPullReplication(url)
push.continuous = true
pull.continuous = true
NSNotificationCenter.defaultCenter().addObserver(self, selector: "replicationChanged:", name: kCBLReplicationChangeNotification, object: push)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "replicationChanged:", name: kCBLReplicationChangeNotification, object: pull)
self.push = push
self.pull = pull
self.push!.start()
self.pull!.start()

Push replication works, in the sense that when I create a document in the ios app, it gets pushed to the couchbase server, I can see it both in sync gateway log and in the couchbase console. But it doesn't appear on other devices connected to the same database.

Any idea what might be going wrong?

---
Sébastien Arbogast
http://sebastien-arbogast.com

ajres

unread,
Jan 10, 2015, 5:20:05 AM1/10/15
to mobile-c...@googlegroups.com
Does your test document contain a "channels" property with a single or an array of channel names?

Andy

Sebastien ARBOGAST

unread,
Jan 10, 2015, 6:52:24 AM1/10/15
to mobile-c...@googlegroups.com, mobile-c...@googlegroups.com
No it doesn't. What do you mean by "a single"?


Sébastien Arbogast
@sarbogast


On Sat, Jan 10, 2015 at 11:20 AM, ajres <an...@couchbase.com> wrote:

Does your test document contain a "channels" property with a single or an array of channel names?

Andy

--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/38c9824b-006c-4cf4-9247-1472d447227d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ajres

unread,
Jan 10, 2015, 7:41:39 AM1/10/15
to mobile-c...@googlegroups.com
I just tried this with SG 1.0.2 and the documents appear in the changes feed without a channels property

could you try the following curl command once you have pushed a document into your DB.

curl -X GET http://myserver.com/mydb/_changes

You should see something similar to the following, which includes the doc you pushed:


{"results":[

{"seq":"6:3","id":"doc2","changes":[{"rev":"1-07d2e73d7e2408837dfcb4f7fe0cb94e"}]}

,{"seq":6,"id":"_user/GUEST","changes":[]}

],

"last_seq":"6"}



Sebastien ARBOGAST

unread,
Jan 10, 2015, 10:13:36 AM1/10/15
to mobile-c...@googlegroups.com, mobile-c...@googlegroups.com
I don’t know exactly what I’m looking for, so here is the entire result of this command:

MacBook-Pro-de-Sebastien:~ sarbogast$ curl -X GET http://myserver.com/mydb/_changes
{"results":[
{"seq":"19:4","id":"75CB85C8-0BA5-493A-9523-58C62BBD8CFE","changes":[{"rev":"1-09dd8818304a49a4354be8dba444ed97"}]}
,{"seq":"19:5","id":"32C59C61-A974-4357-8A7F-9657A1583E08","changes":[{"rev":"1-51e4ea4ff6ef848b8b0717c405c8db3a"}]}
,{"seq":"19:6","id":"93B84E35-3E72-4DC8-844A-AF1916CAA211","changes":[{"rev":"3-be39aaea09f940aaece1ca96f8160f20"}]}
,{"seq":"19:7","id":"81E570D9-3C06-4872-AB4F-86A6A302F0E6","changes":[{"rev":"2-1ec30d1af92e0049477a8c0aa7a68a1b"}]}
,{"seq":"19:8","id":"7E2E55AF-7B2B-4E04-9CC2-205CA92CF2F6","changes":[{"rev":"1-0aa934944436315ea4ec1817ece48c0c"}]}
,{"seq":"19:9","id":"C8C516CD-8D4A-40B8-8A7B-6695EFDE96C1","changes":[{"rev":"1-253fa48e6a9f6c4125169e36ecbb1a3b"}]}
,{"seq":"19:10","id":"3F9842DA-33A6-49E2-B0DD-554215DCBA4C","changes":[{"rev":"1-a6166ebd3a8820532bd7a206c7cbd10f"}]}
,{"seq":"19:11","id":"186F8002-5D48-4D5B-B7FB-F75F6525E931","changes":[{"rev":"1-cd3d64d9eb99aebdaa1ce9fe0f5e66e8"}]}
,{"seq":"19:12","id":"C754B6F5-8AE8-4689-863E-58CC5DD954DA","changes":[{"rev":"1-75fd2d31087b8483a22c703e9820df9a"}]}
,{"seq":"19:13","id":"6076E410-9572-4C61-82C4-D3A2648AD39D","changes":[{"rev":"1-61df8dc04db1aed639312ab6aa7ee922"}]}
,{"seq":"19:14","id":"19C60D0E-8F13-4406-ADAD-1FEF06C0F5B9","changes":[{"rev":"1-456e9bb46a0b170c56dc4847c3786c7e"}]}
,{"seq":"19:17","id":"29BC2278-D427-40DA-84A2-FC195E6AB7B2","changes":[{"rev":"3-7001d6df1090f20cd66e094b72da425e"}]}
,{"seq":"19:18","id":"42A7C186-560F-4CB7-B9D6-6C4EB2CB0D6D","changes":[{"rev":"1-ec8fb36d39502b59e0ef56ab19f4d85f"}]}
,{"seq":19,"id":"_user/","changes":[{"rev":""}]}
,{"seq":20,"id":"55A47B54-E668-4557-83D2-97DF8CE5C65C","changes":[{"rev":"1-53ae46543095eae2835e5dde9b62071d"}]}
,{"seq":21,"id":"FEA80297-1765-4571-9178-A82B975944B1","changes":[{"rev":"1-58075c50eb53147a19a5fd86ddc6bddf"}]}
,{"seq":22,"id":"4D156447-5670-4DED-82CA-84344D45EF84","changes":[{"rev":"1-f7e6e2892c01b02a7f06e0047e6db04e"}]}
,{"seq":23,"id":"4D5B9F1E-D971-4351-8682-03D6715DB1AF","changes":[{"rev":"1-84efd5d42e7cfa5e93b89bfa05f4cc7c"}]}
,{"seq":24,"id":"2BCD25F1-A4C3-4FF4-B654-368C84B14D31","changes":[{"rev":"1-727307c2af5657a7a66adec947c40a1c"}]}
,{"seq":25,"id":"9950D2E5-E87B-461C-90A0-899625987845","changes":[{"rev":"1-112183134b94b655dd3e6569a4af2d4d"}]}
,{"seq":26,"id":"5DCE0610-3328-47B8-B0AD-109E8F672424","changes":[{"rev":"1-48fd4701fd8e8ff718a10d9aa041feb3"}]}
],
"last_seq":"26 »}




Sébastien Arbogast
@sarbogast


--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.

ajres

unread,
Jan 10, 2015, 10:33:41 AM1/10/15
to mobile-c...@googlegroups.com
So you are getting docs back in the changes feed, which is what the mobile clients call to see which docs revisions need to be pulled.

This suggests that the SG is setup correctly.

Can you see the document ID of the document you expected to appear on the second mobile client?

It would be useful if you can set the logging in SG as follows:

"log": ["Access","Channels","Cache","CRUD+", "REST+", "Changes+"],


restart SG


Then post a snippet from your SG log showing a doc being pushed from Mobile client 1 and then mobile client 2 starting and (hopefully) connecting to SG with a request for the _changes feed.

This will help a lot to debug the issue.

Andy

Sebastien ARBOGAST

unread,
Jan 10, 2015, 10:51:56 AM1/10/15
to mobile-c...@googlegroups.com
I updated the sync gateway logging configuration, restarted SG, created a document on one device, and launched the app on the other device to trigger a pull. And here is the log I got:

Jan 10 15:47:21 ip-10-37-182-214.ec2.internal bash[25234]: 15:47:21.357266 HTTP:  #031: GET /mydb/_local/6738235ebe0dc3781dbf4c60e1d41300baf00004
Jan 10 15:47:21 ip-10-37-182-214.ec2.internal bash[25234]: 15:47:21.458146 HTTP:  #032: POST /mydb/_revs_diff
Jan 10 15:47:21 ip-10-37-182-214.ec2.internal bash[25234]: 15:47:21.592168 HTTP:  #033: POST /mydb/_bulk_docs
Jan 10 15:47:21 ip-10-37-182-214.ec2.internal bash[25234]: 15:47:21.593726 CRUD+: Invoking sync on doc "4CBDCF46-47B7-4A05-AB79-756E1770D6F2" rev 1-d0dd28be1217281025feebd90280ab4b
Jan 10 15:47:21 ip-10-37-182-214.ec2.internal bash[25234]: 15:47:21.753224 Cache: SAVING #29
Jan 10 15:47:21 ip-10-37-182-214.ec2.internal bash[25234]: 15:47:21.754983 CRUD: Stored doc "4CBDCF46-47B7-4A05-AB79-756E1770D6F2" / "1-d0dd28be1217281025feebd90280ab4b"
Jan 10 15:47:26 ip-10-37-182-214.ec2.internal bash[25234]: 15:47:26.869186 HTTP:  #034: PUT /mydb/_local/6738235ebe0dc3781dbf4c60e1d41300baf00004
Jan 10 15:47:35 ip-10-37-182-214.ec2.internal bash[25234]: 15:47:35.823625 HTTP:  #035: GET /mydb/_local/9278eeb52d066d61a4fdf5390e2a40384443c827
Jan 10 15:47:35 ip-10-37-182-214.ec2.internal bash[25234]: 15:47:35.823755 HTTP:  #036: GET /mydb/_local/03d822f2ced50a9a4a21a1c00115808151ffe4b4
Jan 10 15:47:35 ip-10-37-182-214.ec2.internal bash[25234]: 15:47:35.825118 HTTP: #035:     --> 404 missing  (3.2 ms)
Jan 10 15:47:36 ip-10-37-182-214.ec2.internal bash[25234]: 15:47:36.215847 HTTP:  #037: GET /mydb/_changes?feed=websocket
Jan 10 15:47:38 ip-10-37-182-214.ec2.internal bash[25234]: 15:47:38.705134 HTTP:  #038: GET /mydb/_changes?feed=websocket
Jan 10 15:47:41 ip-10-37-182-214.ec2.internal bash[25234]: 15:47:41.851050 HTTP:  #039: GET /
Jan 10 15:47:43 ip-10-37-182-214.ec2.internal bash[25234]: 15:47:43.371586 HTTP:  #040: GET /mydb/_changes?feed=websocket
Jan 10 15:47:46 ip-10-37-182-214.ec2.internal bash[25234]: 15:47:46.714613 HTTP:  #041: GET /
Jan 10 15:47:51 ip-10-37-182-214.ec2.internal bash[25234]: 15:47:51.908295 HTTP:  #042: GET /mydb/_changes?feed=websocket

---
Sébastien Arbogast
http://sebastien-arbogast.com

--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.

Sebastien ARBOGAST

unread,
Jan 10, 2015, 11:02:53 AM1/10/15
to mobile-c...@googlegroups.com
Actually after waiting for a few seconds, I have a few new interesting lines in the log:

Jan 10 15:59:16 ip-10-37-182-214.ec2.internal bash[25234]: 15:59:16.714687 HTTP:  #112: GET /
Jan 10 15:59:20 ip-10-37-182-214.ec2.internal bash[25234]: 2015/01/10 15:59:20 go-couchbase: call to Do("_sync:local:198164831c8c009a63aa4ad672089e659ae6c4da") in github.com/couchbaselabs/go-couchbase.(*Bucket).GetsRaw took 2m7.26569433s
Jan 10 15:59:20 ip-10-37-182-214.ec2.internal bash[25234]: 15:59:20.838861 WARNING: Couldn't interpret error type *net.OpError, value dial tcp 10.154.17.142:11210: connection timed out -- base.ErrorAsHTTPStatus() at error.go:63
Jan 10 15:59:20 ip-10-37-182-214.ec2.internal bash[25234]: 15:59:20.838905 HTTP: #094:     --> 500 Internal error: dial tcp 10.154.17.142:11210: connection timed out  (127266.8 ms)
Jan 10 15:59:25 ip-10-37-182-214.ec2.internal bash[25234]: 2015/01/10 15:59:25 go-couchbase: Error connecting to tap feed of 10.154.17.142:11210: dial tcp 10.154.17.142:11210: connection timed out
Jan 10 15:59:25 ip-10-37-182-214.ec2.internal bash[25234]: 2015/01/10 15:59:25 go-couchbase: TAP connection lost; reconnecting to bucket "mydb" in 30s
Jan 10 15:59:30 ip-10-37-182-214.ec2.internal bash[25234]: 2015/01/10 15:59:30 go-couchbase: call to Do("F36DD77F-ED7A-4725-B081-4D823B7E2E23") in github.com/couchbaselabs/go-couchbase.(*Bucket).GetsRaw took 2m7.224263906s
Jan 10 15:59:30 ip-10-37-182-214.ec2.internal bash[25234]: 15:59:30.950869 WARNING: RevDiff("F36DD77F-ED7A-4725-B081-4D823B7E2E23") --> *net.OpError dial tcp 10.154.17.142:11210: connection timed out -- db.(*Database).RevDiff() at crud.go:837
Jan 10 15:59:41 ip-10-37-182-214.ec2.internal bash[25234]: 15:59:41.851243 HTTP:  #115: GET /
Jan 10 15:59:46 ip-10-37-182-214.ec2.internal bash[25234]: 15:59:46.714265 HTTP:  #116: GET /
Jan 10 16:00:11 ip-10-37-182-214.ec2.internal bash[25234]: 16:00:11.851351 HTTP:  #117: GET /
Jan 10 16:00:16 ip-10-37-182-214.ec2.internal bash[25234]: 16:00:16.714894 HTTP:  #118: GET /
Jan 10 16:00:25 ip-10-37-182-214.ec2.internal bash[25234]: 2015/01/10 16:00:25 go-couchbase: call to Do("_sync:user:") in github.com/couchbaselabs/go-couchbase.(*Bucket).casNext took 2m7.241817405s
Jan 10 16:00:25 ip-10-37-182-214.ec2.internal bash[25234]: 16:00:25.350854 HTTP:  #105: GET /mydb/_local/198164831c8c009a63aa4ad672089e659ae6c4da
Jan 10 16:00:25 ip-10-37-182-214.ec2.internal bash[25234]: 16:00:25.350877 WARNING: Couldn't interpret error type *net.OpError, value dial tcp 10.69.87.151:11210: connection timed out -- base.ErrorAsHTTPStatus() at error.go:63
Jan 10 16:00:25 ip-10-37-182-214.ec2.internal bash[25234]: 16:00:25.350917 HTTP: #105:     --> 500 Internal error: dial tcp 10.69.87.151:11210: connection timed out  (127241.9 ms)
Jan 10 16:00:35 ip-10-37-182-214.ec2.internal bash[25234]: 2015/01/10 16:00:35 go-couchbase: call to Do("_sync:user:") in github.com/couchbaselabs/go-couchbase.(*Bucket).casNext took 2m7.188404953s
Jan 10 16:00:35 ip-10-37-182-214.ec2.internal bash[25234]: 16:00:35.334857 HTTP:  #106: POST /mydb/_revs_diff
Jan 10 16:00:35 ip-10-37-182-214.ec2.internal bash[25234]: 16:00:35.334880 WARNING: Couldn't interpret error type *net.OpError, value dial tcp 10.69.87.151:11210: connection timed out -- base.ErrorAsHTTPStatus() at error.go:63
Jan 10 16:00:35 ip-10-37-182-214.ec2.internal bash[25234]: 16:00:35.334941 HTTP: #106:     --> 500 Internal error: dial tcp 10.69.87.151:11210: connection timed out  (127188.5 ms)
Jan 10 16:00:41 ip-10-37-182-214.ec2.internal bash[25234]: 16:00:41.851589 HTTP:  #121: GET /

---
Sébastien Arbogast
http://sebastien-arbogast.com

Sebastien ARBOGAST

unread,
Jan 10, 2015, 11:08:09 AM1/10/15
to mobile-c...@googlegroups.com
Actually, it seems that several nodes have collapsed in my cluster again. This setup is just so instable.

---
Sébastien Arbogast
http://sebastien-arbogast.com

Sebastien ARBOGAST

unread,
Jan 10, 2015, 11:50:12 AM1/10/15
to mobile-c...@googlegroups.com
After restarting my cluster, here is the log I got when creating a doc on one side and waiting for pull on the other:

Jan 10 16:47:07 ip-10-186-156-134.ec2.internal bash[1559]: 16:47:07.979995 HTTP:  #111: GET /mydb/_changes?feed=websocket
Jan 10 16:47:16 ip-10-186-156-134.ec2.internal bash[1559]: 16:47:16.025112 HTTP:  #112: POST /mydb/_revs_diff
Jan 10 16:47:16 ip-10-186-156-134.ec2.internal bash[1559]: 16:47:16.133289 HTTP:  #113: POST /mydb/_bulk_docs
Jan 10 16:47:16 ip-10-186-156-134.ec2.internal bash[1559]: 16:47:16.134682 CRUD+: Invoking sync on doc "F71992E3-EDDF-44F0-AB00-923B593AC38A" rev 1-d7efc353b464bcbb02891c3a8ff5494a
Jan 10 16:47:16 ip-10-186-156-134.ec2.internal bash[1559]: 16:47:16.134908 Cache: SAVING #4
Jan 10 16:47:16 ip-10-186-156-134.ec2.internal bash[1559]: 16:47:16.135106 CRUD: Stored doc "F71992E3-EDDF-44F0-AB00-923B593AC38A" / "1-d7efc353b464bcbb02891c3a8ff5494a"
Jan 10 16:47:17 ip-10-186-156-134.ec2.internal bash[1559]: 16:47:17.746066 Cache: Received #4 after 1611ms ("F71992E3-EDDF-44F0-AB00-923B593AC38A" / "1-d7efc353b464bcbb02891c3a8ff5494a")
Jan 10 16:47:17 ip-10-186-156-134.ec2.internal bash[1559]: 16:47:17.746081 Cache:     #4 ==> channel "*"
Jan 10 16:47:17 ip-10-186-156-134.ec2.internal bash[1559]: 16:47:17.746117 Changes+: Notifying that "mydb" changed (keys="{*}") count=8
Jan 10 16:47:18 ip-10-186-156-134.ec2.internal bash[1559]: 16:47:18.038116 Cache: Received #4 after 1903ms ("F71992E3-EDDF-44F0-AB00-923B593AC38A" / "1-d7efc353b464bcbb02891c3a8ff5494a")
Jan 10 16:47:21 ip-10-186-156-134.ec2.internal bash[1559]: 16:47:21.305844 HTTP:  #114: PUT /mydb/_local/03d822f2ced50a9a4a21a1c00115808151ffe4b4
Jan 10 16:47:30 ip-10-186-156-134.ec2.internal bash[1559]: 16:47:30.704301 HTTP:  #115: GET /
Jan 10 16:47:30 ip-10-186-156-134.ec2.internal bash[1559]: 16:47:30.841721 HTTP:  #116: GET /
Jan 10 16:47:52 ip-10-186-156-134.ec2.internal bash[1559]: 16:47:52.975226 HTTP:  #117: GET /mydb/_local/198164831c8c009a63aa4ad672089e659ae6c4da
Jan 10 16:47:52 ip-10-186-156-134.ec2.internal bash[1559]: 16:47:52.976380 HTTP: #117:     --> 404 missing  (3.0 ms)
Jan 10 16:47:53 ip-10-186-156-134.ec2.internal bash[1559]: 16:47:53.180476 HTTP:  #118: GET /mydb/_changes?feed=websocket
Jan 10 16:47:55 ip-10-186-156-134.ec2.internal bash[1559]: 16:47:55.398018 HTTP:  #119: GET /mydb/_changes?feed=websocket
Jan 10 16:47:55 ip-10-186-156-134.ec2.internal bash[1559]: 16:47:55.585899 HTTP:  #120: GET /mydb/_local/6738235ebe0dc3781dbf4c60e1d41300baf00004
Jan 10 16:48:00 ip-10-186-156-134.ec2.internal bash[1559]: 16:48:00.700801 HTTP:  #121: GET /
Jan 10 16:48:00 ip-10-186-156-134.ec2.internal bash[1559]: 16:48:00.838059 HTTP:  #122: GET /
Jan 10 16:48:02 ip-10-186-156-134.ec2.internal bash[1559]: 16:48:02.827451 HTTP:  #123: GET /mydb/_changes?feed=websocket
Jan 10 16:48:11 ip-10-186-156-134.ec2.internal bash[1559]: 16:48:11.512909 HTTP:  #124: GET /mydb/_changes?feed=websocket

---
Sébastien Arbogast
http://sebastien-arbogast.com

Jens Alfke

unread,
Jan 10, 2015, 2:08:48 PM1/10/15
to mobile-c...@googlegroups.com
The logs show the second client asking for changes from the server, but then not downloading any documents. Which is strange, since the earlier output of /mydb/_changes that you posted includes a valid list of revisions.

Let's look at the client-side replication logs. Turn on the "SyncVerbose" logging mode on the client that's doing the pull.

—Jens

Sebastien ARBOGAST

unread,
Jan 10, 2015, 3:51:04 PM1/10/15
to mobile-c...@googlegroups.com
Ah I didn't know about this logging configuration. Indeed there seems to be an issue with the pull replication:

2015-01-10 21:46:50.886 Pixync[17016:4109092] Logging Sync, SyncVerbose to NSLog
2015-01-10 21:46:50.886 Pixync[17016:4109092] ### Couchbase Lite 1.0-Debug (unofficial) ###
2015-01-10 21:46:50.907 Pixync[17016:4109092] Sync: CBLReplication[to http://backend.server.com/mydb]: offline, progress = 0 / 0, err: (null)
2015-01-10 21:46:50.909 Pixync[17016:4109158] Sync: CBL_Pusher[http://backend.server.com/mydb] STARTING ...
2015-01-10 21:46:50.948 Pixync[17016:4109158] Sync: CBL_Pusher[http://backend.server.com/mydb]: Reachability state = <backend.server.com>:unreachable (00), suspended=0
2015-01-10 21:46:50.951 Pixync[17016:4109158] Sync: CBL_Pusher[http://backend.server.com/mydb]: Reachability state = <backend.server.com>:reachable (02), suspended=0
2015-01-10 21:46:50.951 Pixync[17016:4109158] Sync: CBL_Pusher[http://backend.server.com/mydb]: Going online
2015-01-10 21:46:50.954 Pixync[17016:4109158] Sync: CBL_Pusher[http://backend.server.com/mydb] Progress: set active = 1
2015-01-10 21:46:50.954 Pixync[17016:4109158] SyncVerbose: CBL_Pusher[http://backend.server.com/mydb]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
2015-01-10 21:46:50.955 Pixync[17016:4109158] SyncVerbose: CBL_Pusher[http://backend.server.com/mydb]: GET _local/79b9c21cdbfadc67d1b19e68ad364d3485e171d9
2015-01-10 21:46:50.957 Pixync[17016:4109092] Sync: CBLReplication[from http://backend.server.com/mydb]: offline, progress = 0 / 0, err: (null)
2015-01-10 21:46:50.971 Pixync[17016:4109158] SyncVerbose: CBL_Pusher[http://backend.server.com/mydb]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
2015-01-10 21:46:50.975 Pixync[17016:4109158] Sync: CBL_Puller[http://backend.server.com/mydb] STARTING ...
2015-01-10 21:46:51.015 Pixync[17016:4109158] Sync: CBL_Puller[http://backend.server.com/mydb]: Reachability state = <backend.server.com>:reachable (02), suspended=0
2015-01-10 21:46:51.017 Pixync[17016:4109158] Sync: CBL_Puller[http://backend.server.com/mydb]: Going online
2015-01-10 21:46:51.018 Pixync[17016:4109158] Sync: CBL_Puller[http://backend.server.com/mydb] Progress: set active = 1
2015-01-10 21:46:51.018 Pixync[17016:4109158] SyncVerbose: CBL_Puller[http://backend.server.com/mydb]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
2015-01-10 21:46:51.019 Pixync[17016:4109158] SyncVerbose: CBL_Puller[http://backend.server.com/mydb]: GET _local/c8b86535d45db2aa1aa609149a640bacc7e4a407
2015-01-10 21:46:51.020 Pixync[17016:4109158] SyncVerbose: CBL_Puller[http://backend.server.com/mydb]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
2015-01-10 21:46:51.055 Pixync[17016:4109092] Sync: CBLReplication[to http://backend.server.com/mydb]: active, progress = 0 / 0, err: (null)
2015-01-10 21:46:51.057 Pixync[17016:4109092] Sync: CBLReplication[from http://backend.server.com/mydb]: active, progress = 0 / 0, err: (null)
2015-01-10 21:46:51.506 Pixync[17016:4109158] Sync: CBL_Pusher[http://backend.server.com/mydb]: Replicating from lastSequence=(null)
2015-01-10 21:46:51.508 Pixync[17016:4109158] SyncVerbose: CBL_Pusher[http://backend.server.com/mydb]: Received 0 revs
2015-01-10 21:46:51.509 Pixync[17016:4109158] Sync: CBL_Pusher[http://backend.server.com/mydb] Progress: set active = 0
2015-01-10 21:46:51.509 Pixync[17016:4109158] SyncVerbose: CBL_Pusher[http://backend.server.com/mydb]: postProgressChanged (0/0, active=0 (batch=0, net=0), online=1)
2015-01-10 21:46:51.510 Pixync[17016:4109092] Sync: CBLReplication[to http://backend.server.com/mydb]: idle, progress = 0 / 0, err: (null)
2015-01-10 21:46:51.513 Pixync[17016:4109158] Sync: CBL_Puller[http://backend.server.com/mydb]: Replicating from lastSequence=(null)
2015-01-10 21:46:51.518 Pixync[17016:4109158] SyncVerbose: CBL_Puller[http://backend.server.com/mydb] starting ChangeTracker: mode=3, since=(null)
2015-01-10 21:46:51.520 Pixync[17016:4109158] SyncVerbose: CBLWebSocketChangeTracker[0x17018b870 mydb]: GET //backend.server.com/mydb/_changes?feed=websocket
2015-01-10 21:46:51.729 Pixync[17016:4109158] CBLWebSocketChangeTracker[0x17018b870 mydb]: Connection error #1, retrying in 2.0 sec: The operation couldn’t be completed. HTTP/1.1 502 BAD_GATEWAY
2015-01-10 21:46:53.730 Pixync[17016:4109158] SyncVerbose: CBLWebSocketChangeTracker[0x17018b870 mydb]: GET //backend.server.com/mydb/_changes?feed=websocket
2015-01-10 21:46:53.930 Pixync[17016:4109158] CBLWebSocketChangeTracker[0x17018b870 mydb]: Connection error #2, retrying in 4.0 sec: The operation couldn’t be completed. HTTP/1.1 502 BAD_GATEWAY
2015-01-10 21:46:57.936 Pixync[17016:4109158] SyncVerbose: CBLWebSocketChangeTracker[0x17018b870 mydb]: GET //backend.server.com/mydb/_changes?feed=websocket
2015-01-10 21:46:58.159 Pixync[17016:4109158] CBLWebSocketChangeTracker[0x17018b870 mydb]: Connection error #3, retrying in 8.0 sec: The operation couldn’t be completed. HTTP/1.1 502 BAD_GATEWAY

---
Sébastien Arbogast
http://sebastien-arbogast.com

--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.

Sebastien ARBOGAST

unread,
Jan 10, 2015, 3:55:33 PM1/10/15
to mobile-c...@googlegroups.com
FYI, I'm using Couchbase Lite master from source.

---
Sébastien Arbogast
http://sebastien-arbogast.com

Jens Alfke

unread,
Jan 10, 2015, 5:52:48 PM1/10/15
to mobile-c...@googlegroups.com

On Jan 10, 2015, at 12:50 PM, Sebastien ARBOGAST <sebastien...@gmail.com> wrote:

2015-01-10 21:46:51.729 Pixync[17016:4109158] CBLWebSocketChangeTracker[0x17018b870 mydb]: Connection error #1, retrying in 2.0 sec: The operation couldn’t be completed. HTTP/1.1 502 BAD_GATEWAY

IIRC, you said you're running the server on AWS? Something about that might be blocking the WebSocket.

Try this in setting up your CBLReplication:
repl.customProperties = @{@"websocket": @NO};
This will disable the WebSocket optimization and use a regular HTTP request instead.

—Jens

ajres

unread,
Jan 10, 2015, 5:58:12 PM1/10/15
to mobile-c...@googlegroups.com
Are you running SG behind a load balancer, we have had issues with nginx not passing web socket connections onto SG without custom config, we have a page describing the setup here.

Andy

Sebastien ARBOGAST

unread,
Jan 10, 2015, 11:32:47 PM1/10/15
to mobile-c...@googlegroups.com, mobile-c...@googlegroups.com
Indeed I'm running SG behind ELB as per Traun Leyden's tutorial.


Sébastien Arbogast
@sarbogast


--

You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.

Sebastien ARBOGAST

unread,
Jan 11, 2015, 3:49:45 AM1/11/15
to mobile-c...@googlegroups.com, mobile-c...@googlegroups.com
I think this is the problem: http://blog.flux7.com/web-apps-websockets-with-aws-elastic-load-balancing

I will try to bypass the load balancer to see if it works, and if it does I will try the trick in the above article using TCP


Sébastien Arbogast
@sarbogast


On Sat, Jan 10, 2015 at 11:58 PM, ajres <an...@couchbase.com> wrote:

Are you running SG behind a load balancer, we have had issues with nginx not passing web socket connections onto SG without custom config, we have a page describing the setup here.

Andy

--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.

Sebastien ARBOGAST

unread,
Jan 11, 2015, 11:31:08 AM1/11/15
to mobile-c...@googlegroups.com, mobile-c...@googlegroups.com
OK so I’ve checked and indeed, when I bypass ELB to connect straight to the server where SG is deployed and everything works fine there. I’ve tried to use TCP as an alternative but it doesn’t work. I’ll let Traun know that his setup won’t work with ELB and I’ll forget about ELB for now. Thanks a lot for your help.


Sébastien Arbogast
@sarbogast
Reply all
Reply to author
Forward
0 new messages