As mentioned previously I have another app which I created for development purposes to source
the data for my database and populate my remote Couchbase Server. Experiencing with this app has uncovered a couple of things.
This app happily performs a push sync with the remote Couchbase Server on AWS. However, if I perform a flush of the relevant bucket and then run the app, the push sync fails with the following:
2014-12-06 01:15:28.606 GoGasSync[33802:1682508] Sync is idle.
2014-12-06 01:15:28.606 GoGasSync[33802:1682508] Error syncing: Error Domain=CBLHTTP Code=401 "401 unauthorized" UserInfo=0x7fc9ea48c770 {NSURL=http://ec2-blahblah.us-west-2.compute.amazonaws.com:4984/gogas/_local/1ab6816c4ecbf74479205114371b77f5da567bfa, NSLocalizedFailureReason=unauthorized, NSLocalizedDescription=401 unauthorized}
The reason it fails is because the flush deletes
ALL documents from the bucket, including the three Sync Gateway-related documents which are added to the bucket when Sync Gateway is started (please see screenshot attached). This is also why the app runs fine upon stopping and restarting the Sync Gateway.
However, my original app is still unable to sync with the remote Couchbase Server on AWS:
2014-12-06 01:29:04.650 GoGas[33874:1688042] Inside pushReplicationProgress:]
2014-12-06 01:29:04.650 GoGas[33874:1688042] self.push is NOT nil
2014-12-06 01:29:04.651 GoGas[33874:1688042] Push sync progress: 0 / 0
2014-12-06 01:29:04.651 GoGas[33874:1688042] Push sync is idle.
01:29:05.999‖ WARNING*** : JSON error parsing _changes feed: parse error: client cancelled parse via callback return value
01:29:06.001‖ WARNING*** : CBLSocketChangeTracker[0x7fea7c8c0000 gogas]: Can't connect, giving up: Error Domain=CBLChangeTracker Code=587 "The operation couldn’t be completed. (CBLChangeTracker error 587.)"
2014-12-06 01:29:06.115 GoGas[33874:1688042] Inside replicationProgress:]
2014-12-06 01:29:06.115 GoGas[33874:1688042] Inside pullReplicationProgress:]
2014-12-06 01:29:06.116 GoGas[33874:1688042] self.pull is NOT nil
2014-12-06 01:29:06.116 GoGas[33874:1688042] Pull sync progress: 0 / 0
2014-12-06 01:29:06.116 GoGas[33874:1688042] Pull sync is idle.
2014-12-06 01:29:06.116 GoGas[33874:1688042] Pull sync error: Error Domain=CBLChangeTracker Code=587 "The operation couldn’t be completed. (CBLChangeTracker error 587.)"
2014-12-06 01:29:06.116 GoGas[33874:1688042] Inside pushReplicationProgress:]
2014-12-06 01:29:06.116 GoGas[33874:1688042] self.push is NOT nil
2014-12-06 01:29:06.122 GoGas[33874:1688042] Push sync progress: 0 / 0
2014-12-06 01:29:06.122 GoGas[33874:1688042] Push sync is idle.