In my app I use HTTP Basic Auth. I recreated this behaviour in 'Grocery 
Sync iOS Demo'. For simplicity I left only one pull replication. I 
specified syncpoint as CouchDB database in my local network and I inserted 
credentials in URL string representation. In my case it looked like this:
syncpoint = @"http://admin:[email protected]:5984/startup_layer7";; 
Password "admin1" isn't correct. I used Sync, SyncVerbose, ChangeTracker, 
RemoteRequest log channels.  Below You can find attached log file.

>From logs I understood following: 

The pull replication tried fetch last sequence and got unauthorized error.
01:16:28.959‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: 
Error fetching last sequence: 401 unauthorized

It decided retry  in 60 sec
01:16:28.961‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: 
Failed to xfer 0 revisions; will retry in 60 sec

Change tracker is started:
01:17:28.969‖ SyncVerbose: CBLSocketChangeTracker[0x14e8fda0 startup_layer7
]: GET 
//admin:[email protected]:5984/startup_layer7/_changes?feed=normal&heartbeat=300000&style=all_docs

It got error and this error the replication didn't consider as permanent. 
So it tried to establish connection after 2, 4, 8 ... seconds.
01:17:35.190‖ CBLSocketChangeTracker[0x14e8fda0 startup_layer7]: Connection 
error #1, retrying in 2.0 sec: The operation couldn’t be completed. 
(NSURLErrorDomain error -1013.)
01:17:37.233‖ CBLSocketChangeTracker[0x14e8fda0 startup_layer7]: Connection 
error #2, retrying in 4.0 sec: The operation couldn’t be completed. 
(NSURLErrorDomain error -1013.)
01:17:41.287‖ CBLSocketChangeTracker[0x14e8fda0 startup_layer7]: Connection 
error #3, retrying in 8.0 sec: The operation couldn’t be completed. 
(NSURLErrorDomain error -1013.)


среда, 30 июля 2014 г., 23:17:51 UTC+6 пользователь Jens Alfke написал:
>
> It’s just because I’ve never seen the second error occur before — I 
> thought all HTTP auth failures would result in a 401.
> I can definitely add that error to CBLIsPermanentError, but I’m curious 
> where it’s coming from. What sort of auth are you performing?
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/6ea99e00-73b6-41d5-9623-cb125a05970f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
2014-07-31 01:16:28.118 Grocery Sync[5168:60b] Opening database...
01:16:28.122| Logging mode 2 enabled in domains: {ChangeTracker, RemoteRequest, 
Sync, SyncVerbose}
01:16:28.125| ### Couchbase Lite 1.0-Debug (unofficial) ###
2014-07-31 01:16:28.140 Grocery Sync[5168:60b] Application windows are expected 
to have a root view controller at the end of application launch
01:16:28.673| Sync: CBLReplication[from 
http://admin:*****@192.168.20.103:5984/startup_layer7]: offline, progress = 0 / 
0, err: (null)
01:16:28.675| Sync: CBLReplication[from 
http://admin:*****@192.168.20.103:5984/startup_layer7]: offline, progress = 0 / 
0, err: (null)
01:16:28.684‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7] STARTING ...
01:16:28.685‖ SyncVerbose: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: Found 
credential, using CBLBasicAuthorizer[admin/****]
01:16:28.742‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: Reachability 
state = <192.168.20.103>:reachable (20002), suspended=0
01:16:28.743‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: Going online
01:16:28.745‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7] Progress: set 
active = 1
01:16:28.746‖ SyncVerbose: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: 
postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
01:16:28.746‖ SyncVerbose: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: GET 
_local/163059425cbd9b350013ac9611b1b2bb07d23fcd
01:16:28.749‖ RemoteRequest: CBLRemoteJSONRequest[GET 
http://admin:*****@192.168.20.103:5984/startup_layer7/_local/163059425cbd9b350013ac9611b1b2bb07d23fcd]:
 Starting...
01:16:28.759‖ SyncVerbose: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: 
postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
01:16:28.759‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7] STOPPING...
01:16:28.760‖ Sync: Stopping 1 remote requests
01:16:28.760‖ RemoteRequest: CBLRemoteJSONRequest[GET 
http://admin:*****@192.168.20.103:5984/startup_layer7/_local/163059425cbd9b350013ac9611b1b2bb07d23fcd]:
 Stopped
01:16:28.816‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: Error 
fetching last sequence: The operation couldn’t be completed. (NSURLErrorDomain 
error -999.)
01:16:28.816‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7] Progress: set 
active = 0
01:16:28.817‖ SyncVerbose: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: 
postProgressChanged (0/0, active=0 (batch=0, net=0), online=1)
01:16:28.818‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7] STOPPED
01:16:28.818‖ Replication: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7] took 0.132 
sec; error=(null)
01:16:28.833‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7] STARTING ...
01:16:28.834‖ SyncVerbose: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: Found 
credential, using CBLBasicAuthorizer[admin/****]
01:16:28.876‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: Reachability 
state = <192.168.20.103>:reachable (20002), suspended=0
01:16:28.877‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: Going online
01:16:28.879‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7] Progress: set 
active = 1
01:16:28.879‖ SyncVerbose: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: 
postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
01:16:28.880‖ SyncVerbose: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: GET 
_local/163059425cbd9b350013ac9611b1b2bb07d23fcd
01:16:28.880‖ RemoteRequest: CBLRemoteJSONRequest[GET 
http://admin:*****@192.168.20.103:5984/startup_layer7/_local/163059425cbd9b350013ac9611b1b2bb07d23fcd]:
 Starting...
01:16:28.881‖ SyncVerbose: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: 
postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
01:16:28.882| Sync: CBLReplication[from 
http://admin:*****@192.168.20.103:5984/startup_layer7]: active, progress = 0 / 
0, err: (null)
2014-07-31 01:16:28.883 Grocery Sync[5168:60b] SYNC progress: 0 / 0
01:16:28.959‖ RemoteRequest: CBLRemoteJSONRequest[GET 
http://admin:*****@192.168.20.103:5984/startup_layer7/_local/163059425cbd9b350013ac9611b1b2bb07d23fcd]:
 Got response, status 401
01:16:28.959‖ CBLRemoteJSONRequest[GET 
http://admin:*****@192.168.20.103:5984/startup_layer7/_local/163059425cbd9b350013ac9611b1b2bb07d23fcd]:
 Got error Error Domain=CBLHTTP Code=401 "401 unauthorized" UserInfo=0x14d96260 
{NSURL=http://admin:[email protected]:5984/startup_layer7/_local/163059425cbd9b350013ac9611b1b2bb07d23fcd,
 NSLocalizedFailureReason=unauthorized, NSLocalizedDescription=401 unauthorized}
01:16:28.959‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: Error 
fetching last sequence: 401 unauthorized
01:16:28.960‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7] Progress: set 
error = 401 unauthorized
01:16:28.960‖ SyncVerbose: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: 
postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
01:16:28.961‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7] Progress: set 
active = 0
01:16:28.961‖ SyncVerbose: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: 
postProgressChanged (0/0, active=0 (batch=0, net=0), online=1)
01:16:28.961‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: Failed to 
xfer 0 revisions; will retry in 60 sec
01:16:28.962| Sync: CBLReplication[from 
http://admin:*****@192.168.20.103:5984/startup_layer7]: idle, progress = 0 / 0, 
err: 401 unauthorized


01:17:28.963‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7] RETRYING, to 
transfer missed revisions...
01:17:28.963‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7] Progress: set 
error = (null)
01:17:28.964‖ SyncVerbose: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: 
postProgressChanged (0/0, active=0 (batch=0, net=0), online=1)
01:17:28.965‖ Sync: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7] Progress: set 
active = 1
01:17:28.965‖ SyncVerbose: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7]: 
postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
01:17:28.966‖ SyncVerbose: 
CBL_Puller[http://admin:*****@192.168.20.103:5984/startup_layer7] starting 
ChangeTracker: mode=0, since=(null)
01:17:28.967‖ ChangeTracker: CBLSocketChangeTracker[0x14e8fda0 startup_layer7]: 
Starting...
01:17:28.969‖ SyncVerbose: CBLSocketChangeTracker[0x14e8fda0 startup_layer7]: 
GET 
//admin:[email protected]:5984/startup_layer7/_changes?feed=normal&heartbeat=300000&style=all_docs
01:17:28.970‖ ChangeTracker: CBLSocketChangeTracker[0x14e8fda0 startup_layer7]: 
Started... 
<http://admin:*****@192.168.20.103:5984/startup_layer7/_changes?feed=normal&heartbeat=300000&style=all_docs>
01:17:28.971‖ ChangeTracker: CBLSocketChangeTracker[0x14e8fda0 startup_layer7]: 
Event 1 on <__NSCFInputStream: 0x14e9daa0>
01:17:28.971| Sync: CBLReplication[from 
http://admin:*****@192.168.20.103:5984/startup_layer7]: active, progress = 0 / 
0, err: (null)
2014-07-31 01:17:28.971 Grocery Sync[5168:60b] SYNC progress: 0 / 0
01:17:29.031‖ ChangeTracker: <WebSocketHTTPLogic: 0x14e68d60>: Auth challenge; 
credential = (null)
01:17:29.032‖ <WebSocketHTTPLogic: 0x14e68d60>: HTTP auth failed; sent 
Authorization: (null)  ;  got WWW-Authenticate: (null)
01:17:35.190‖ CBLSocketChangeTracker[0x14e8fda0 startup_layer7]: Connection 
error #1, retrying in 2.0 sec: The operation couldn’t be completed. 
(NSURLErrorDomain error -1013.)
01:17:37.192‖ ChangeTracker: CBLSocketChangeTracker[0x14e8fda0 startup_layer7]: 
Starting...
01:17:37.194‖ SyncVerbose: CBLSocketChangeTracker[0x14e8fda0 startup_layer7]: 
GET 
//admin:[email protected]:5984/startup_layer7/_changes?feed=normal&heartbeat=300000&style=all_docs
01:17:37.196‖ ChangeTracker: CBLSocketChangeTracker[0x14e8fda0 startup_layer7]: 
Started... 
<http://admin:*****@192.168.20.103:5984/startup_layer7/_changes?feed=normal&heartbeat=300000&style=all_docs>
01:17:37.196‖ ChangeTracker: CBLSocketChangeTracker[0x14e8fda0 startup_layer7]: 
Event 1 on <__NSCFInputStream: 0x14e9dbb0>
01:17:37.229‖ ChangeTracker: <WebSocketHTTPLogic: 0x14e68d60>: Auth challenge; 
credential = (null)
01:17:37.230‖ <WebSocketHTTPLogic: 0x14e68d60>: HTTP auth failed; sent 
Authorization: (null)  ;  got WWW-Authenticate: (null)
01:17:37.233‖ CBLSocketChangeTracker[0x14e8fda0 startup_layer7]: Connection 
error #2, retrying in 4.0 sec: The operation couldn’t be completed. 
(NSURLErrorDomain error -1013.)
01:17:41.234‖ ChangeTracker: CBLSocketChangeTracker[0x14e8fda0 startup_layer7]: 
Starting...
01:17:41.236‖ SyncVerbose: CBLSocketChangeTracker[0x14e8fda0 startup_layer7]: 
GET 
//admin:[email protected]:5984/startup_layer7/_changes?feed=normal&heartbeat=300000&style=all_docs
01:17:41.238‖ ChangeTracker: CBLSocketChangeTracker[0x14e8fda0 startup_layer7]: 
Started... 
<http://admin:*****@192.168.20.103:5984/startup_layer7/_changes?feed=normal&heartbeat=300000&style=all_docs>
01:17:41.239‖ ChangeTracker: CBLSocketChangeTracker[0x14e8fda0 startup_layer7]: 
Event 1 on <__NSCFInputStream: 0x14e9d250>
01:17:41.284‖ ChangeTracker: <WebSocketHTTPLogic: 0x14e68d60>: Auth challenge; 
credential = (null)
01:17:41.284‖ <WebSocketHTTPLogic: 0x14e68d60>: HTTP auth failed; sent 
Authorization: (null)  ;  got WWW-Authenticate: (null)
01:17:41.287‖ CBLSocketChangeTracker[0x14e8fda0 startup_layer7]: Connection 
error #3, retrying in 8.0 sec: The operation couldn’t be completed. 
(NSURLErrorDomain error -1013.)

Reply via email to