Not 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):
{"Object reference not set to an instance of an object."}
[System.NullReferenceException]: {"Object reference not set to an instance of an object."}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
HResult: -2147467261
InnerException: null
Message: "Object reference not set to an instance of an object."
Source: "Couchbase.Lite"
StackTrace: " at Couchbase.Lite.Replicator.BulkDownloader.ExecuteRequest(HttpClient httpClient, HttpRequestMessage request)"
TargetSite: {Void ExecuteRequest(System.Net.Http.HttpClient, System.Net.Http.HttpRequestMessage)}
All 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.
BulkDownloader: Unhandled Exception at Line 129 or 130
System.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.
at Couchbase.Lite.Replicator.BulkDownloader.ExecuteRequest(HttpClient httpClient, HttpRequestMessage request)
or
BulkDownloader
Response task timed out: System.Threading.Tasks.Task`1[System.Net.Http.HttpResponseMessage], Couchbase.Lite.Util.SingleThreadTaskScheduler BulkDownloader: ExecuteRequest Exception:
[HttpResponseException: StatusCode = RequestTimeout] Replication: Progress: set error =
[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)
Detail:
I 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.
I’m running SyncGateway 1.0.3-81, Couchbase Lite from NuGet v1.0.0, Couchbase Server 3.0.1 EE.
It looks like the transient error handler was not able to successfully retry the bulk download before the entire request timed out. Unfortunately, it looks like I didn’t correctly catch the