Error uploading from Couchbase Lite iOS


#1

I have never had trouble before, but now when I create a new document on iOS and save it, it does not propagate to the server, and I am assuming it relates to the error below: (replaced app name and database name with “app”, server ip with xxx.xxx.xxx.xxx. I am running the most recent version of CB server and sync gateway)

2015-08-20 17:20:56.354 app[1073:390618] CBLRemoteJSONRequest[GET 

http://xxx.xxx.xxx.xxx:4984/app/_local/be0b46b71c97b03593af7d4ee4aee83d55cd5d72]: Got error Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={NSUnderlyingError=0x15f682cc0 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "The request timed out." UserInfo={NSErrorFailingURLStringKey=http://xxx.xxx.xxx.xxx:4984/app/_local/be0b46b71c97b03593af7d4ee4aee83d55cd5d72, NSErrorFailingURLKey=http://xxx.xxx.xxx.xxx:4984/app/_local/be0b46b71c97b03593af7d4ee4aee83d55cd5d72, _kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4, NSLocalizedDescription=The request timed out.}}, NSErrorFailingURLStringKey=http://xxx.xxx.xxx.xxx:4984/app/_local/be0b46b71c97b03593af7d4ee4aee83d55cd5d72, NSErrorFailingURLKey=http://xxx.xxx.xxx.xxx:4984/app/_local/be0b46b71c97b03593af7d4ee4aee83d55cd5d72, _kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-2102, NSLocalizedDescription=The request timed out.}
2015-08-20 17:20:56.355 app[1073:390618] Sync: CBL_Pusher[http://xxx.xxx.xxx.xxx:4984/app/]: Error fetching last sequence: The request timed out.
2015-08-20 17:20:56.357 app[1073:390618] Sync: CBL_Pusher[http://xxx.xxx.xxx.xxx:4984/app/] Progress: set error = The request timed out.
2015-08-20 17:20:56.357 app[1073:390618] Sync: CBL_Pusher[http://xxx.xxx.xxx.xxx:4984/app/] Progress: set active = 0
2015-08-20 17:20:56.358 app[1073:390618] Sync: CBL_Pusher[http://xxx.xxx.xxx.xxx:4984/app/]: Failed to xfer 0 revisions; will retry in 60 sec
2015-08-20 17:20:56.358 app[1073:390593] Sync: CBLReplication[to http://xxx.xxx.xxx.xxx:4984/app/]: idle, progress = 0 / 0, err: The request timed out.

I am not sure it it is related, but I am also getting

2015/08/20 17:20:27 go-couchbase: call to ViewCustom("sync_housekeeping", "sessions") in github.com/couchbase/sync_gateway/base.CouchbaseBucket.View took 278.219235ms

on my server.

I have no idea what to do with either of these errors, and any assistance would be appreciated. For reference, I have tried running from simulator and physical device, but get the same error. It has also been taking an unusually long amount of time to authenticate users. There is a very rare chance that it is an iOS 9 beta 5 issue, but considering it worked for betas 1-4 this would be very odd.


#2

Well, the first thing would be to take the error message “The request timed out” literally and check the connectivity to the server. Try using curl or some other HTTP client tool to GET http://xxx.xxx.xxx.xxx:4984/app/, from the same network that your iOS devices are on. Does it work?


#3

A basic curl command gets an instantaneous and accurate response, and I can log into port 8091 from my computer to see all of the documents, which is why I can tell the iOS client isn’t creating documents. I have even tried turning the firewall off on my server.


#4

Just to be clear, port 8091 is for Couchbase Server. You issued the CURL commands to port 4984 right? If so, is the iOS device connected to the same network as the machine you used to issue the curl commands? Does Sync Gateway log anything when the iOS device is running?


#5

That’s weird! Please file an issue on Github and we can troubleshoot it there.


#6

I issued the curl on 8091, as I couldn’t find the documentation for curling the sync gateway. @borrrden do you know a good command to test this?


#7

The REST API for Sync Gateway is documented here


#8

I gave you a url a few messages ago!