{"action":"created","issue":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/898","labels_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/898/labels{/name}","comments_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/898/comments","events_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/898/events","html_url":"https://github.com/couchbase/couchbase-lite-ios/issues/898","id":104074619,"number":898,"title":"ver 1.1.1 Replicating Just Fine But Push.Status Always kCBLReplicationOffline","user":{"login":"ColossalChris","id":11928111,"avatar_url":"https://avatars.githubusercontent.com/u/11928111?v=3","gravatar_id":"","url":"https://api.github.com/users/ColossalChris","html_url":"https://github.com/ColossalChris","followers_url":"https://api.github.com/users/ColossalChris/followers","following_url":"https://api.github.com/users/ColossalChris/following{/other_user}","gists_url":"https://api.github.com/users/ColossalChris/gists{/gist_id}","starred_url":"https://api.github.com/users/ColossalChris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ColossalChris/subscriptions","organizations_url":"https://api.github.com/users/ColossalChris/orgs","repos_url":"https://api.github.com/users/ColossalChris/repos","events_url":"https://api.github.com/users/ColossalChris/events{/privacy}","received_events_url":"https://api.github.com/users/ColossalChris/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-08-31T15:21:00Z","updated_at":"2015-09-04T18:00:26Z","closed_at":null,"body":"I have a Manager and Database created on a background thread using the following:\r\n\r\n     - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\r\n         ...\r\n         [NSThread detachNewThreadSelector: @selector(startManagerAndDatabaseInBackground) toTarget: self withObject: nil];\r\n     }\r\n\r\n\r\n     - (void) startManagerAndDatabaseInBackground {\r\n         // Create a CBLManager instance to use on this background thread:\r\n         _manager = [[CBLManager alloc] init];\r\n         NSError *error;\r\n         databaseName = @\"mydb\";\r\n         \r\n         if (![CBLManager isValidDatabaseName: databaseName]) {\r\n             NSLog (@\"Bad database name\");\r\n             return;\r\n         }\r\n    \r\n         _database = [_manager databaseNamed:databaseName error:&error];\r\n\r\n        [self startReplication];\r\n     }\r\n\r\n\r\n     - (void) startReplication {\r\n\r\n         NSURL* url = [NSURL URLWithString: databaseURL];\r\n         push = [_database createPushReplication: url];\r\n         pull = [_database createPullReplication: url];\r\n         push.continuous = pull.continuous = YES;\r\n         id<CBLAuthenticator> auth;\r\n         auth = [CBLAuthenticator basicAuthenticatorWithName: @\"askldjaslk\" password: @\"asdklasjdklasjdl\"];\r\n         push.authenticator = pull.authenticator = auth;\r\n         [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(replicationChanged:) name: kCBLReplicationChangeNotification object: push];\r\n         [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(replicationChanged:) name: kCBLReplicationChangeNotification object: pull];\r\n         [push start];\r\n         [pull start];\r\n     }\r\n\r\n     - (void) replicationChanged: (NSNotification*)n {\r\n         if((pull.status == kCBLReplicationActive) || (push.status == kCBLReplicationActive)){\r\n             NSLog(@\"db replication actively pulling with %@\", pull.documentIDs.description);\r\n        \r\n         }else if(push.status == kCBLReplicationIdle){\r\n             NSLog(@\"db replication push idle\");\r\n        \r\n         }else if(push.status == kCBLReplicationOffline){\r\n             NSLog(@\"db replication push offline\");\r\n        \r\n         }else if(push.status == kCBLReplicationStopped){\r\n             NSLog(@\"db replication push stopped with error: %@\", push.lastError);\r\n         }\r\n     }\r\n\r\nAll documents are replicating just fine to my online db but while observing the replication push status is always kCBLReplicationOffline rather than Idle, stopped or active. Any ideas on why this could be?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/comments/137806842","html_url":"https://github.com/couchbase/couchbase-lite-ios/issues/898#issuecomment-137806842","issue_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/898","id":137806842,"user":{"login":"snej","id":43241,"avatar_url":"https://avatars.githubusercontent.com/u/43241?v=3","gravatar_id":"","url":"https://api.github.com/users/snej","html_url":"https://github.com/snej","followers_url":"https://api.github.com/users/snej/followers","following_url":"https://api.github.com/users/snej/following{/other_user}","gists_url":"https://api.github.com/users/snej/gists{/gist_id}","starred_url":"https://api.github.com/users/snej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snej/subscriptions","organizations_url":"https://api.github.com/users/snej/orgs","repos_url":"https://api.github.com/users/snej/repos","events_url":"https://api.github.com/users/snej/events{/privacy}","received_events_url":"https://api.github.com/users/snej/received_events","type":"User","site_admin":false},"created_at":"2015-09-04T18:00:26Z","updated_at":"2015-09-04T18:00:26Z","body":"The session you attached the log for definitely did not push any documents.\r\n\r\nCould you run the app again and capture a session where you know a document got pushed to the server, then attach the log? Also, please enable `SyncVerbose` logging. (Since the log can get long, it's best to put it in a gist or something similar, then link to it here.)"}}