{"action":"created","issue":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-net/issues/356","labels_url":"https://api.github.com/repos/couchbase/couchbase-lite-net/issues/356/labels{/name}","comments_url":"https://api.github.com/repos/couchbase/couchbase-lite-net/issues/356/comments","events_url":"https://api.github.com/repos/couchbase/couchbase-lite-net/issues/356/events","html_url":"https://github.com/couchbase/couchbase-lite-net/issues/356","id":49736227,"number":356,"title":"BulkDownloader HTTP request timeouts not properly handled","user":{"login":"zgramana","id":759830,"avatar_url":"https://avatars.githubusercontent.com/u/759830?v=3","gravatar_id":"","url":"https://api.github.com/users/zgramana","html_url":"https://github.com/zgramana","followers_url":"https://api.github.com/users/zgramana/followers","following_url":"https://api.github.com/users/zgramana/following{/other_user}","gists_url":"https://api.github.com/users/zgramana/gists{/gist_id}","starred_url":"https://api.github.com/users/zgramana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zgramana/subscriptions","organizations_url":"https://api.github.com/users/zgramana/orgs","repos_url":"https://api.github.com/users/zgramana/repos","events_url":"https://api.github.com/users/zgramana/events{/privacy}","received_events_url":"https://api.github.com/users/zgramana/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/couchbase/couchbase-lite-net/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/couchbase/couchbase-lite-net/labels/P3:%20major","name":"P3: major","color":"fbca04"},{"url":"https://api.github.com/repos/couchbase/couchbase-lite-net/labels/peer%20review","name":"peer review","color":"ededed"},{"url":"https://api.github.com/repos/couchbase/couchbase-lite-net/labels/priority-medium","name":"priority-medium","color":"fbca04"},{"url":"https://api.github.com/repos/couchbase/couchbase-lite-net/labels/size-medium","name":"size-medium","color":"fad8c7"}],"state":"open","locked":false,"assignee":{"login":"borrrden","id":2470288,"avatar_url":"https://avatars.githubusercontent.com/u/2470288?v=3","gravatar_id":"","url":"https://api.github.com/users/borrrden","html_url":"https://github.com/borrrden","followers_url":"https://api.github.com/users/borrrden/followers","following_url":"https://api.github.com/users/borrrden/following{/other_user}","gists_url":"https://api.github.com/users/borrrden/gists{/gist_id}","starred_url":"https://api.github.com/users/borrrden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borrrden/subscriptions","organizations_url":"https://api.github.com/users/borrrden/orgs","repos_url":"https://api.github.com/users/borrrden/repos","events_url":"https://api.github.com/users/borrrden/events{/privacy}","received_events_url":"https://api.github.com/users/borrrden/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-net/milestones/11","html_url":"https://github.com/couchbase/couchbase-lite-net/milestones/1.1.1","labels_url":"https://api.github.com/repos/couchbase/couchbase-lite-net/milestones/11/labels","id":1082958,"number":11,"title":"1.1.1","description":"","creator":{"login":"zgramana","id":759830,"avatar_url":"https://avatars.githubusercontent.com/u/759830?v=3","gravatar_id":"","url":"https://api.github.com/users/zgramana","html_url":"https://github.com/zgramana","followers_url":"https://api.github.com/users/zgramana/followers","following_url":"https://api.github.com/users/zgramana/following{/other_user}","gists_url":"https://api.github.com/users/zgramana/gists{/gist_id}","starred_url":"https://api.github.com/users/zgramana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zgramana/subscriptions","organizations_url":"https://api.github.com/users/zgramana/orgs","repos_url":"https://api.github.com/users/zgramana/repos","events_url":"https://api.github.com/users/zgramana/events{/privacy}","received_events_url":"https://api.github.com/users/zgramana/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":12,"state":"open","created_at":"2015-04-24T22:11:46Z","updated_at":"2015-07-10T07:56:20Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2014-11-21T19:07:50Z","updated_at":"2015-07-13T16:55:57Z","closed_at":null,"body":"Reported by `orionhansen` via [a post on our mobile forum](https://forums.couchbase.com/t/error-replicating-to-net-cb-lite-db-from-sync-gateway/2110):\r\n\r\nNot sure what I'm doing wrong here, but I'm getting an exception thrown randomly when I try and sync through the sync gateway to my new Couchbase Lite database. During the replication process, I get an exception (only every 5k-10k rows, or about every 3-4 minutes):\r\n\r\n```\r\n{\"Object reference not set to an instance of an object.\"}\r\n[System.NullReferenceException]: {\"Object reference not set to an instance of an object.\"}\r\nData: {System.Collections.ListDictionaryInternal}\r\nHelpLink: null\r\nHResult: -2147467261\r\nInnerException: null\r\nMessage: \"Object reference not set to an instance of an object.\"\r\nSource: \"Couchbase.Lite\"\r\nStackTrace: \"   at Couchbase.Lite.Replicator.BulkDownloader.ExecuteRequest(HttpClient httpClient, HttpRequestMessage request)\"\r\nTargetSite: {Void ExecuteRequest(System.Net.Http.HttpClient, System.Net.Http.HttpRequestMessage)}\r\n```\r\nAll of the records are actually loaded into memory as far as I can tell (I have an event handler for the replication.Pull event that logs them to a file/console). It takes about 15 minutes to run, but once these are loaded into memory, another error occurs. In the end, nothing get's written to the local lite database.\r\n```\r\nBulkDownloader: Unhandled Exception at Line 129 or 130\r\nSystem.Threading.Tasks.TaskCanceledException: A task was canceled. Replication:  Progress: set error = System.Threading.Tasks.TaskCanceledException: A task was canceled. BulkDownloader: ExecuteRequest Exception: System.NullReferenceException: Object reference not set to an instance of an object. at couchbase.Lite.Replicator.BulkDownloader.ExecuteRequest(HttpClient httpClient, HttpRequestMessage request) Replication:  Progress: set error = System.NullReferenceException: Object reference not set to an instance of an object.\r\n   at Couchbase.Lite.Replicator.BulkDownloader.ExecuteRequest(HttpClient httpClient, HttpRequestMessage request)\r\n```\r\nor\r\n```\r\nBulkDownloader\r\nResponse task timed out: System.Threading.Tasks.Task`1[System.Net.Http.HttpResponseMessage], Couchbase.Lite.Util.SingleThreadTaskScheduler BulkDownloader: ExecuteRequest Exception:\r\n[HttpResponseException: StatusCode = RequestTimeout] Replication:  Progress: set error =\r\n[HttpResponseException: StatusCode = RequestTimeout] BulkDownloader: ExecuteRequest Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Couchbase.Lite.Replicator.BulkDownloader.ExecuteRequest(HttpClient httpClient, HttpRequestMessage request) Replication:  Progress: set error = System.NullReferenceException: Object reference not set to an instance of an object. at Couchbase.Lite.Replicator.BulkDownloader.ExecuteRequest(HttpClient httpClient, HttpRequestMessage request)\r\n```\r\n**Detail:**\r\nI have a bucket with ~200k entries. Sync gateway is setup with a shadow bucket that is getting served out. I believe that is working because the shadow and original buckets match the document count and I don't see errors when I run the SG verbosely. I can query the sync gateway using the REST API and haven't had issues.\r\n\r\nI'm running SyncGateway 1.0.3-81, Couchbase Lite from NuGet v1.0.0, Couchbase Server 3.0.1 EE."},"comment":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-net/issues/comments/120992504","html_url":"https://github.com/couchbase/couchbase-lite-net/issues/356#issuecomment-120992504","issue_url":"https://api.github.com/repos/couchbase/couchbase-lite-net/issues/356","id":120992504,"user":{"login":"brettharrisonzya","id":11575909,"avatar_url":"https://avatars.githubusercontent.com/u/11575909?v=3","gravatar_id":"","url":"https://api.github.com/users/brettharrisonzya","html_url":"https://github.com/brettharrisonzya","followers_url":"https://api.github.com/users/brettharrisonzya/followers","following_url":"https://api.github.com/users/brettharrisonzya/following{/other_user}","gists_url":"https://api.github.com/users/brettharrisonzya/gists{/gist_id}","starred_url":"https://api.github.com/users/brettharrisonzya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brettharrisonzya/subscriptions","organizations_url":"https://api.github.com/users/brettharrisonzya/orgs","repos_url":"https://api.github.com/users/brettharrisonzya/repos","events_url":"https://api.github.com/users/brettharrisonzya/events{/privacy}","received_events_url":"https://api.github.com/users/brettharrisonzya/received_events","type":"User","site_admin":false},"created_at":"2015-07-13T16:55:57Z","updated_at":"2015-07-13T16:55:57Z","body":"You can close this.  I have not been able to reproduce it."}}