Appcenter: System.Net.WebException : POST Failed at Xamarin.UITest.Shared.Http.HttpClient.HandleHttpError

Created on 13 Jun 2019  Â·  12Comments  Â·  Source: microsoft/appcenter

What App Center service does this affect?
build & test

Describe the bug
Hi,

I have the following error and I have no idea what it means. It does not happen in the emulator--only when it runs in appcenter with 'Test on a real device' enabled. Xamarin.forms team has not responded in over a week so I assume they think it's a AppCenter issue. See https://forums.xamarin.com/discussion/158165/post-failed-at-xamarin-uitest-shared-http-httpclient-handlehttperror

Error : AppCenter.UITest.Android.Tests.AppDoesLaunch
System.Net.WebException : POST Failed
at Xamarin.UITest.Shared.Http.HttpClient.HandleHttpError (System.String method, System.Net.Http.HttpResponseMessage response, Xamarin.UITest.Shared.Http.ExceptionPolicy exceptionPolicy) [0x00052] in <18ae7883e2424c558186d1d9edf9f14b>:0
at Xamarin.UITest.Shared.Http.HttpClient.SendData (System.String endpoint, System.String method, System.Net.Http.HttpContent content, Xamarin.UITest.Shared.Http.ExceptionPolicy exceptionPolicy, System.Nullable1[T] timeOut) [0x00123] in <18ae7883e2424c558186d1d9edf9f14b>:0 at Xamarin.UITest.Shared.Http.HttpClient.Post (System.String endpoint, System.String arguments, Xamarin.UITest.Shared.Http.ExceptionPolicy exceptionPolicy, System.Nullable1[T] timeOut) [0x00014] in <18ae7883e2424c558186d1d9edf9f14b>:0
at Xamarin.UITest.Shared.Android.HttpApplicationStarter.Execute (System.String intentJson) [0x00035] in <18ae7883e2424c558186d1d9edf9f14b>:0
at Xamarin.UITest.Shared.Android.AndroidAppLifeCycle.LaunchApp (System.String appPackageName, Xamarin.UITest.Shared.Android.ApkFile testServerApkFile, System.Int32 testServerPort) [0x000a1] in <18ae7883e2424c558186d1d9edf9f14b>:0
at Xamarin.UITest.Shared.Android.AndroidAppLifeCycle.LaunchApp (Xamarin.UITest.Shared.Android.ApkFile appApkFile, Xamarin.UITest.Shared.Android.ApkFile testServerApkFile, System.Int32 testServerPort) [0x00007] in <18ae7883e2424c558186d1d9edf9f14b>:0
at Xamarin.UITest.Android.AndroidApp..ctor (Xamarin.UITest.Configuration.IAndroidAppConfiguration appConfiguration, Xamarin.UITest.Shared.Execution.IExecutor executor) [0x00193] in <18ae7883e2424c558186d1d9edf9f14b>:0
at Xamarin.UITest.Android.AndroidApp..ctor (Xamarin.UITest.Configuration.IAndroidAppConfiguration appConfiguration) [0x00000] in <18ae7883e2424c558186d1d9edf9f14b>:0
at Xamarin.UITest.Configuration.AndroidAppConfigurator.StartApp (Xamarin.UITest.Configuration.AppDataMode appDataMode) [0x00017] in <18ae7883e2424c558186d1d9edf9f14b>:0
at AppCenter.UITest.Android.Tests.SetUp () [0x00010] in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <48b95f3df5804531818f80e28ec60191>:0

To Reproduce
See full log at https://appcenter.ms/orgs/Collective2/apps/C2-Mobile/test/runs/b5726c2b-881e-4ac7-b89a-c3bcb11341c1

Expected behavior
No error

Screenshots
n/a

Desktop (please complete the following information):

  • OS: win10
  • Browser chrome
  • Version latest

Smartphone (please complete the following information):
n/a

Additional context
n/a

bug test

Most helpful comment

It was a null object in a dependency injection. Totally my error but difficult to track down due to the obscure debugger error.

All 12 comments

Please reach out to us in support so we can look into your problem.

hi @francis2, did you talk with your support team?

Hi,

Still no resolution, AppCenter support told me yesterday they escalated the
case to one of your engineers for their thoughts on this.

Francis

On Fri, Jun 21, 2019 at 2:31 PM Villars Gimm notifications@github.com
wrote:

hi @francis2 https://github.com/francis2, did you talk with your
support team?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/appcenter/issues/562?email_source=notifications&email_token=ACUMTED3BYH7UVS73KGSVVLP3UUCJA5CNFSM4HX6LPM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYJMEJQ#issuecomment-504545830,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACUMTEA47S3NSM4RICR2L4LP3UUCJANCNFSM4HX6LPMQ
.

I have found your case and can see that you resolved it with Owen. If I have misunderstood, please re-open this issue.

@francis2 Having the same problem. Were you able to solve this?

@Oddj0b any resolution on this issue? In our case this seems to happen on Android 4.4 - API 19 through Android 5.1 - API 22 on newer versions we aren't seeing this issue.

It was a null object in a dependency injection. Totally my error but difficult to track down due to the obscure debugger error.

@francis2 Would you elaborate for inexperienced Android devs? EDIT: Rather how you narrowed it down and found the source of the error? As currently, with no DependencyService calls, we are still seeing this error

I just stepped through the code line by line, starting in appdelegate.cs, and eventually saw an error in my baseviewmodel constructor. This helped: https://xamgirl.com/common-compilations-problems-in-xamarin-and-how-to-solve-it/

I find debugging Xamarin issues very frustrating and incredibly difficult. Maybe I'm just an idiot..

@francis2 Understood, you must have been debugging iOS builds. Running into this issue on Android builds (far less experienced with Android debugging). Unfortunately the error is being produced when running tests via Visual Studio Appcenter on older OS's (below Android 6.0) so we aren't sure how to debug the error..

My issue was I was running debug code and my debug code points to an internal api which AppCenter test cloud doesn't have access to.

I had a similar issue and solved it by uploading a signed APK
(https://docs.microsoft.com/en-us/xamarin/android/deploy-test/release-prep/)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DouglasMarq picture DouglasMarq  Â·  4Comments

Oddj0b picture Oddj0b  Â·  3Comments

galfonso777 picture galfonso777  Â·  3Comments

muhammaddadu picture muhammaddadu  Â·  3Comments

busterlaursen picture busterlaursen  Â·  4Comments