When I connect directly to the server where Sync Gateway is deployed, everything works fine, replication works both ways.
But when I connect to the ELB using a custom URL, push replication works fine, but pull replication fails with the following SyncVerbose log:
2015-01-11 20:13:24.926 MyApp[18492:4459783] Logging Sync, SyncVerbose to NSLog
2015-01-11 20:13:24.926 MyApp[18492:4459783] ### Couchbase Lite 1.0-Debug (unofficial) ###
2015-01-11 20:13:24.994 MyApp[18492:4459783] Sync: CBLReplication[from
http://elb.myserver.com/mydb]: offline, progress = 0 / 0, err: (null)
2015-01-11 20:13:25.001 MyApp[18492:4459867] SyncVerbose: CBL_Pusher[
http://elb.myserver.com/mydb]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
2015-01-11 20:13:25.002 MyApp[18492:4459867] SyncVerbose: CBL_Pusher[
http://elb.myserver.com/mydb]: GET _local/79b9c21cdbfadc67d1b19e68ad364d3485e171d9
2015-01-11 20:13:25.021 MyApp[18492:4459867] SyncVerbose: CBL_Pusher[
http://elb.myserver.com/mydb]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
2015-01-11 20:13:25.069 MyApp[18492:4459867] SyncVerbose: CBL_Puller[
http://elb.myserver.com/mydb]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
2015-01-11 20:13:25.071 MyApp[18492:4459867] SyncVerbose: CBL_Puller[
http://elb.myserver.com/mydb]: GET _local/c8b86535d45db2aa1aa609149a640bacc7e4a407
2015-01-11 20:13:25.072 MyApp[18492:4459867] SyncVerbose: CBL_Puller[
http://elb.myserver.com/mydb]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
2015-01-11 20:13:27.571 MyApp[18492:4459867] SyncVerbose: CBL_Puller[
http://elb.myserver.com/mydb] starting ChangeTracker: mode=3, since=(null)
2015-01-11 20:13:27.581 MyApp[18492:4459867] SyncVerbose: CBL_Pusher[
http://elb.myserver.com/mydb]: postProgressChanged (0/0, active=0 (batch=0, net=0), online=1)
2015-01-11 20:13:28.008 MyApp[18492:4459867] CBLWebSocketChangeTracker[0x17419c220 mydb]: Connection error #1, retrying in 2.0 sec: The operation couldn’t be completed. HTTP/1.1 502 BAD_GATEWAY
2015-01-11 20:13:30.516 MyApp[18492:4459867] CBLWebSocketChangeTracker[0x17419c220 mydb]: Connection error #2, retrying in 4.0 sec: The operation couldn’t be completed. HTTP/1.1 502 BAD_GATEWAY
2015-01-11 20:13:30.916 MyApp[18492:4459867] CBLWebSocketChangeTracker[0x17419c220 mydb]: Connection error #3, retrying in 8.0 sec: nodename nor servname provided, or not known
2015-01-11 20:13:30.917 MyApp[18492:4459867] Sync: Stopping 0 remote requests
2015-01-11 20:13:30.918 MyApp[18492:4459867] SyncVerbose: CBL_Puller[
http://elb.myserver.com/mydb]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=0)
2015-01-11 20:13:30.919 MyApp[18492:4459867] SyncVerbose: CBL_Puller[
http://elb.myserver.com/mydb]: postProgressChanged (0/0, active=0 (batch=0, net=0), online=0)
2015-01-11 20:13:30.919 MyApp[18492:4459783] Sync: CBLReplication[from
http://elb.myserver.com/mydb]: offline, progress = 0 / 0, err: (null)
2015-01-11 20:13:30.919 MyApp[18492:4459867] Sync: Stopping 0 remote requests
2015-01-11 20:13:30.920 MyApp[18492:4459867] SyncVerbose: CBL_Pusher[
http://elb.myserver.com/mydb]: postProgressChanged (0/0, active=0 (batch=0, net=0), online=0)
The lines that end in 502 BAD GATEWAY seem to indicate that there's a problem with the pull websocket. Did you guys had to do anything to make ELB and Sync Gateway work together?
Note that I'm using the master version of both Sync Gateway and Couchbase-Lite iOS.