Replication error with Http Message Failed to send

Hi.

I’m on CBLite 1.4.0. (.net). I have set up continuous pull/push replications for my app which seems to be working fine, except for some times, when it occasionally stops syncing with the following log.

WARN) SYNC (RemoteSession): [11] 2018-3-28 10:17:13.047+05:45 Http Message failed to send, or got error response, passing to callback… http://serveraddress:4984/bucketname/_local/ccaf43d1ee9f07233c3b3d21ff07e4bb308e02dc, :
System.AggregateException: One or more errors occurred. —> System.AggregateException: One or more errors occurred. —> System.AggregateException: One or more errors occurred. —> Java.IO.IOException: unexpected end of stream on Connection{serveraddress:4984, proxy=DIRECT hostAddress=serveraddress cipherSuite=none protocol=http/1.1} (recycle count=5) —> Java.IO.IOException: \n not found: size=0 content=…
— End of inner exception stack trace —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in :0
at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00069] in <334a5882ad164b4987c0ab3fb6844d5d>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualInt32Method (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in <334a5882ad164b4987c0ab3fb6844d5d>:0
at Java.Net.HttpURLConnection.get_ResponseCode () [0x0000a] in <616ad29416af446c8e20adccafa0e9d2>:0
at Xamarin.Android.Net.AndroidClientHandler+<>c__DisplayClass44_0.b__2 () [0x00000] in <616ad29416af446c8e20adccafa0e9d2>:0
at System.Threading.Tasks.Task1[TResult].InnerInvoke () [0x0000f] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Threading.Tasks.Task.Execute () [0x00010] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in :0
at Xamarin.Android.Net.AndroidClientHandler+d__44.MoveNext () [0x00367] in <616ad29416af446c8e20adccafa0e9d2>:0
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in :0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in :0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in :0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in :0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at Xamarin.Android.Net.AndroidClientHandler+<SendAsync>d__39.MoveNext () [0x0022c] in <616ad29416af446c8e20adccafa0e9d2>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in :0
at System.Net.Http.MessageProcessingHandler+d__4.MoveNext () [0x00093] in :0
— End of inner exception stack trace —
at Couchbase.Lite.Util.TransientErrorRetryHandler.HandleTransientErrors (System.Threading.Tasks.Task1[TResult] request, System.Object state) [0x0021d] in <bb3bb8c4fbb54f939fa09402030f6081>:0 at Couchbase.Lite.Util.TransientErrorRetryHandler+<ResendHandler>c__AnonStorey0.<>m__0 (System.Threading.Tasks.Task1[TResult] t) <0xbf268ec8 + 0x00053> in :0
at System.Threading.Tasks.ContinuationResultTaskFromResultTask2[TAntecedentResult,TResult].InnerInvoke () [0x00024] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Threading.Tasks.Task.Execute () [0x00010] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in :0
at System.Net.Http.HttpClient+d__49.MoveNext () [0x000ca] in :0
— End of inner exception stack trace —
at Couchbase.Lite.CouchbaseLiteHttpClient+c__AnonStorey2.<>m__1 (System.Threading.Tasks.Task1[TResult] t) [0x00000] in /Volumes/Data/jenkins/workspace/couchbase-lite-net-build@2/1.4/Android/couchbase-lite-net/src/Couchbase.Lite.Shared/Replication/ChangeTracker.cs:70 at System.Threading.Tasks.ContinuationResultTaskFromResultTask2[TAntecedentResult,TResult].InnerInvoke () [0x00024] in :0
at System.Threading.Tasks.Task.Execute () [0x00010] in :0
— End of inner exception stack trace —
—> (Inner Exception #0) System.AggregateException: One or more errors occurred. —> System.AggregateException: One or more errors occurred. —> Java.IO.IOException: unexpected end of stream on Connection{serveraddress:4984, proxy=DIRECT hostAddress=serveraddress cipherSuite=none protocol=http/1.1} (recycle count=5) —> Java.IO.IOException: \n not found: size=0 content=…
— End of inner exception stack trace —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in :0
at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00069] in <334a5882ad164b4987c0ab3fb6844d5d>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualInt32Method (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in <334a5882ad164b4987c0ab3fb6844d5d>:0
at Java.Net.HttpURLConnection.get_ResponseCode () [0x0000a] in <616ad29416af446c8e20adccafa0e9d2>:0
at Xamarin.Android.Net.AndroidClientHandler+<>c__DisplayClass44_0.b__2 () [0x00000] in <616ad29416af446c8e20adccafa0e9d2>:0
at System.Threading.Tasks.Task1[TResult].InnerInvoke () [0x0000f] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Threading.Tasks.Task.Execute () [0x00010] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in :0
at Xamarin.Android.Net.AndroidClientHandler+d__44.MoveNext () [0x00367] in <616ad29416af446c8e20adccafa0e9d2>:0
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in :0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in :0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in :0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in :0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at Xamarin.Android.Net.AndroidClientHandler+<SendAsync>d__39.MoveNext () [0x0022c] in <616ad29416af446c8e20adccafa0e9d2>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in :0
at System.Net.Http.MessageProcessingHandler+d__4.MoveNext () [0x00093] in :0
— End of inner exception stack trace —
at Couchbase.Lite.Util.TransientErrorRetryHandler.HandleTransientErrors (System.Threading.Tasks.Task1[TResult] request, System.Object state) [0x0021d] in <bb3bb8c4fbb54f939fa09402030f6081>:0 at Couchbase.Lite.Util.TransientErrorRetryHandler+<ResendHandler>c__AnonStorey0.<>m__0 (System.Threading.Tasks.Task1[TResult] t) <0xbf268ec8 + 0x00053> in :0
at System.Threading.Tasks.ContinuationResultTaskFromResultTask2[TAntecedentResult,TResult].InnerInvoke () [0x00024] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Threading.Tasks.Task.Execute () [0x00010] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in :0
at System.Net.Http.HttpClient+d__49.MoveNext () [0x000ca] in :0
— End of inner exception stack trace —
at Couchbase.Lite.CouchbaseLiteHttpClient+c__AnonStorey2.<>m__1 (System.Threading.Tasks.Task1[TResult] t) [0x00000] in /Volumes/Data/jenkins/workspace/couchbase-lite-net-build@2/1.4/Android/couchbase-lite-net/src/Couchbase.Lite.Shared/Replication/ChangeTracker.cs:70 at System.Threading.Tasks.ContinuationResultTaskFromResultTask2[TAntecedentResult,TResult].InnerInvoke () [0x00024] in :0
at System.Threading.Tasks.Task.Execute () [0x00010] in :0
—> (Inner Exception #0) System.AggregateException: One or more errors occurred. —> Java.IO.IOException: unexpected end of stream on Connection{serveraddress:4984, proxy=DIRECT hostAddress=serveraddress cipherSuite=none protocol=http/1.1} (recycle count=5) —> Java.IO.IOException: \n not found: size=0 content=…
— End of inner exception stack trace —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in :0
at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00069] in <334a5882ad164b4987c0ab3fb6844d5d>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualInt32Method (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in <334a5882ad164b4987c0ab3fb6844d5d>:0
at Java.Net.HttpURLConnection.get_ResponseCode () [0x0000a] in <616ad29416af446c8e20adccafa0e9d2>:0
at Xamarin.Android.Net.AndroidClientHandler+<>c__DisplayClass44_0.b__2 () [0x00000] in <616ad29416af446c8e20adccafa0e9d2>:0
at System.Threading.Tasks.Task1[TResult].InnerInvoke () [0x0000f] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Threading.Tasks.Task.Execute () [0x00010] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in :0
at Xamarin.Android.Net.AndroidClientHandler+d__44.MoveNext () [0x00367] in <616ad29416af446c8e20adccafa0e9d2>:0
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in :0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in :0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in :0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in :0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at Xamarin.Android.Net.AndroidClientHandler+<SendAsync>d__39.MoveNext () [0x0022c] in <616ad29416af446c8e20adccafa0e9d2>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in :0
at System.Net.Http.MessageProcessingHandler+d__4.MoveNext () [0x00093] in :0
— End of inner exception stack trace —
at Couchbase.Lite.Util.TransientErrorRetryHandler.HandleTransientErrors (System.Threading.Tasks.Task1[TResult] request, System.Object state) [0x0021d] in <bb3bb8c4fbb54f939fa09402030f6081>:0 at Couchbase.Lite.Util.TransientErrorRetryHandler+<ResendHandler>c__AnonStorey0.<>m__0 (System.Threading.Tasks.Task1[TResult] t) <0xbf268ec8 + 0x00053> in :0
at System.Threading.Tasks.ContinuationResultTaskFromResultTask2[TAntecedentResult,TResult].InnerInvoke () [0x00024] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Threading.Tasks.Task.Execute () [0x00010] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in :0
at System.Net.Http.HttpClient+d__49.MoveNext () [0x000ca] in :0
—> (Inner Exception #0) Java.IO.IOException: unexpected end of stream on Connection{serveraddress:4984, proxy=DIRECT hostAddress=serveraddress cipherSuite=none protocol=http/1.1} (recycle count=5) —> Java.IO.IOException: \n not found: size=0 content=…
— End of inner exception stack trace —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in :0
at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00069] in <334a5882ad164b4987c0ab3fb6844d5d>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualInt32Method (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in <334a5882ad164b4987c0ab3fb6844d5d>:0
at Java.Net.HttpURLConnection.get_ResponseCode () [0x0000a] in <616ad29416af446c8e20adccafa0e9d2>:0
at Xamarin.Android.Net.AndroidClientHandler+<>c__DisplayClass44_0.b__2 () [0x00000] in <616ad29416af446c8e20adccafa0e9d2>:0
at System.Threading.Tasks.Task1[TResult].InnerInvoke () [0x0000f] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Threading.Tasks.Task.Execute () [0x00010] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in :0
at Xamarin.Android.Net.AndroidClientHandler+d__44.MoveNext () [0x00367] in <616ad29416af446c8e20adccafa0e9d2>:0
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in :0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in :0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in :0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in :0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at Xamarin.Android.Net.AndroidClientHandler+<SendAsync>d__39.MoveNext () [0x0022c] in <616ad29416af446c8e20adccafa0e9d2>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <ff3f19a2b833411c9256d2cda40b6eb1>:0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in :0
at System.Net.Http.MessageProcessingHandler+d__4.MoveNext () [0x00093] in :0
— End of managed Java.IO.IOException stack trace —
java.io.IOException: unexpected end of stream on Connection{serveraddress:4984, proxy=DIRECT hostAddress=serveraddress cipherSuite=none protocol=http/1.1} (recycle count=5)
at com.android.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:258)
at com.android.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:104)
at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:1156)
at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:976)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:509)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:438)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:567)
Caused by: java.io.EOFException: \n not found: size=0 content=…
at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:210)
at com.android.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:239)
… 6 more
<—
<—
<—

WARN) SYNC (RemoteSession): [11] 2018-3-28 10:17:13.138+05:45 Failed content:
WARN) SYNC (Replication): [11] 2018-3-28 10:17:13.142+05:45 Unable to save remote checkpoint for 2907f645-b2d7-4be5-9879-eb19c8aa9d00:
Java.IO.IOException: \n not found: size=0 content=…
— End of managed Java.IO.IOException stack trace —
java.io.EOFException: \n not found: size=0 content=…
at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:210)
at com.android.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:239)
at com.android.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:104)
at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:1156)
at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:976)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:509)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:438)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:567)

INFO) SYNC (Replication): [11] 2018-3-28 10:17:13.147+05:45 Puller 2907f645-b2d7-4be5-9879-eb19c8aa9d00 stopped. Elapsed time 72.035 sec

This only happens occasionally, and it seems to work fine when the app is restarted.

This is happening on Android device. The app is built on Xamarin.

Please let me know if I’m doing something wrong or if there’s any extra information required from me.

This is my sync URL : http://serveraddress:4984/bucketname/

This is somewhat of a known issue. Xamarin Android is annoying because it throws up weird platform specific exceptions instead of standard .NET ones so the exception analyzer doesn’t recognize them as transient. The workaround is to start the replication again when you have detected it has stopped via the callbacks.

How would you suggest to handle it through the callbacks? Here’s what I’ve done to catch an Authentication error.

Pusher.Changed += HandleChange;
Puller.Changed += HandleChange;

void HandleChange(object sender, ReplicationChangeEventArgs e)
{
Replication rep = sender as Replication;
if (e.LastError != null)
{
Exception error = e.LastError;
if (error is HttpResponseException)
{
HttpResponseException exception = (HttpResponseException)error;
AppLog.WriteLogD(TAG, “Exception:”, exception.StatusCode.ToString());
if ((int)exception.StatusCode == 401)
{
AppLog.WriteLogE(TAG, “Authentication error”);
ShowAlert(“Unauthorized”);
}
}
}
}

I’m not getting a log here, so how do I go about catching it?

HttpResponseException exception = (HttpResponseException)error;
AppLog.WriteLogD(TAG, “Exception:”, exception.StatusCode.ToString());

The logs indicate that it is sending the error to the callback. It’s not an HttpResponseException by the way…it’s an AggregateException which wraps a Java.IO.IOException.

Thank You. I’ll adjust the code as suggested and let you know what cooks up!