Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FieldAccessException during sync #777

Closed
rainerg2000 opened this issue Nov 28, 2016 · 7 comments
Closed

FieldAccessException during sync #777

rainerg2000 opened this issue Nov 28, 2016 · 7 comments

Comments

@rainerg2000
Copy link

rainerg2000 commented Nov 28, 2016

System.FieldAccessException: Field System.Net.HttpWebRequest:ResendContentFactory' is inaccessible from method System.Net.Http.HttpClientHandler/c__async0:MoveNext ()'

I am seeing this issue hourly on a test device with my Xamarin Forms app using Couchbase Lite for .Net on Android. I have not found any way to handle the exception and retry the operation successfully. The only method to recover seems to be to kill and restart the app.

Android Nexus 5X, Nougat
couchbase-lite-net release 1.3.1
also confirmed after rebuilding from couchbase-lite-net commit e29b8e1 (Nov 25, 2016)

This issue seems similar to anaisbetts/ModernHttpClient#228

Log excerpt:
[0:] INFO) SYNC (Replication): [13] 2016-11-28 09:29:56.940-08:00 Pusher b09a50b8-8dd0-41a6-9800-9ceefe344ec8 successfully logged in!
[0:] INFO) SYNC (Replication): [13] 2016-11-28 09:29:56.946-08:00 Puller b1ea3c9a-b275-4fff-9cc7-fcf9189b888e successfully logged in!
[0:] VERBOSE) SYNC (RemoteSession): [18] 2016-11-28 09:29:57.031-08:00 b09a50b8-8dd0-41a6-9800-9ceefe344ec8 - Sending GET request to: https://<>/_local/b8b1dfc0efc49af5d2359ee99f5464b6de9c11ec
[0:] VERBOSE) SYNC (RemoteSession): [18] 2016-11-28 09:29:57.035-08:00 b1ea3c9a-b275-4fff-9cc7-fcf9189b888e - Sending GET request to: https://<>/_local/376e1c19ab7ba35efb23da975f0231e9d204555e
[0:] VERBOSE) SYNC (ExceptionResolver): [6] 2016-11-28 09:29:57.200-08:00 No further information can be gained from this exception, attempting to find other nested exceptions...:
System.FieldAccessException: Field System.Net.HttpWebRequest:ResendContentFactory' is inaccessible from method System.Net.Http.HttpClientHandler/c__async0:MoveNext ()'

at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1[TResult].Start[TStateMachine] (TStateMachine& stateMachine) [0x00031] in /Users/builder/data/lanes/3511/77cb8568/source/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:471 at System.Net.Http.HttpClientHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x0001f] in <6e92ad09d0bd49b996fe288564eee203>:0 at System.Net.Http.DelegatingHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x00000] in /Users/builder/data/lanes/3511/77cb8568/source/mono/mcs/class/System.Net.Http/System.Net.Http/DelegatingHandler.cs:76 at System.Net.Http.MessageProcessingHandler.<SendAsync>__BaseCallProxy0 (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) <0xc8329f30 + 0x00067> in <6e92ad09d0bd49b996fe288564eee203>:0 at System.Net.Http.MessageProcessingHandler+<SendAsync>c__async0.MoveNext () [0x0003e] in /Users/builder/data/lanes/3511/77cb8568/source/mono/mcs/class/System.Net.Http/System.Net.Http/MessageProcessingHandler.cs:51 Thread started: <Thread Pool> #21 11-28 09:29:57.228 D/Mono (13166): [0xc348d920] worker starting [0:] VERBOSE) SYNC (ExceptionResolver): [6] 2016-11-28 09:29:57.216-08:00 No further information can be gained from this exception, attempting to find other nested exceptions...: System.FieldAccessException: Field System.Net.HttpWebRequest:ResendContentFactory' is inaccessible from method `System.Net.Http.HttpClientHandler/c__async0:MoveNext ()'

at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].Start[TStateMachine] (TStateMachine& stateMachine) [0x00031] in /Users/builder/data/lanes/3511/77cb8568/source/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:471
at System.Net.Http.HttpClientHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x0001f] in <6e92ad09d0bd49b996fe288564eee203>:0
at System.Net.Http.DelegatingHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x00000] in /Users/builder/data/lanes/3511/77cb8568/source/mono/mcs/class/System.Net.Http/System.Net.Http/DelegatingHandler.cs:76
at System.Net.Http.MessageProcessingHandler.__BaseCallProxy0 (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) <0xc8329f30 + 0x00067> in <6e92ad09d0bd49b996fe288564eee203>:0
at System.Net.Http.MessageProcessingHandler+c__async0.MoveNext () [0x0003e] in /Users/builder/data/lanes/3511/77cb8568/source/mono/mcs/class/System.Net.Http/System.Net.Http/MessageProcessingHandler.cs:51

@borrrden
Copy link
Member

I saw something similar to this before, it's just so odd to have this happen sporadically. If the field were truly not accessible then it should happen every single time. I'll have to keep an eye out for it.

@borrrden
Copy link
Member

@jdluzen
Copy link

jdluzen commented Dec 7, 2016

I see 2 different things happening with ResendContentFactory in the past few months. Is Mono.Security.dll in your bin folder?

@djpongh
Copy link
Contributor

djpongh commented Dec 10, 2016

Looks like a Xamarin issue. Let us know if you feel this is not the case.

@smulrich
Copy link

I am getting this issue coming through as an error in my Replication's Replication.Changed event handler. So if it is originating from Xamarin it is bubbling through CBL. I wonder if it is similar to the set_ReadWriteTimeout error here?
#742

@borrrden
Copy link
Member

borrrden commented Jan 6, 2017

The difference between this and #742 is that there is no reference to ResendContentFactory anywhere in the Couchbase Lite codebase.

borrrden added a commit that referenced this issue Jan 6, 2017
@borrrden
Copy link
Member

borrrden commented Jan 6, 2017

Couchbase Lite manually sets the HttpMessagingHandler so I put in some logic to use AndroidClientHandler on platforms where it is available (>= 5.0). Unlike HttpClientHandler it doesn’t use ResendContentFactory so hopefully it can avoid the issue. The next build (build 14 or above) will have this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants