Bug 31373 - Hockeyapp component 3.5.0 fails POST request
Summary: Hockeyapp component 3.5.0 fails POST request
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Components ()
Version: Production (addons.xamarin.com)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Jon Dick
Depends on:
Reported: 2015-06-25 08:50 UTC by indrek.koue
Modified: 2016-01-07 21:13 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description indrek.koue 2015-06-25 08:50:38 UTC
When i create a crash in Hockeyapp included application, the crash isn't reported to the Hockeyapp. I have waited more than 48h

I sniffed the request through proxy and found that the POST request returns 400:

2015-06-25 12:56:39 POST https://sdk.hockeyapp.net/api/2/apps/faef339301e8b7de8e90f2f7ba7f3427/crashes/
← 400 text/html 1B 218.29kB/s
Request Response
Content-Length: 573
Content-Type: application/x-www-form-urlencoded
Host: sdk.hockeyapp.net
Connection: Keep-Alive
User-Agent: HockeySDK/Android
URLEncoded form
raw: Package: com.apptanker.basaar
Version: 9
Android: 4.3
Manufacturer: LGE
Model: Nexus 4
Date: 6/25/2015 12:56:28 PM

          System.IndexOutOfRangeException: Index has to be between upper and lower bound of the array.
          ?at System.Array.GetValue(int.args:1337)
          ?at com.apptanker.basaar.Bazaar.Android.Views.Account.EulaView.OnCreate(Android.OS.Bundle.args:1337)
          ?at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_(intptr_intptr_intptr.args:1337)
sdk: HockeySDK
sdk_version: 3.5.0

Potential problem:

Looking the Hockeyapp API dock, we can see that the POST request end is missing /upload: http://support.hockeyapp.net/kb/api/api-crashes#post-custom-crashes 

About the app:

* android:minSdkVersion="10" android:targetSdkVersion="17"
* built on Xamarin Android and C#
* uses official HockeyApp component for Xamarin: https://components.xamarin.com/view/hockeyappandroid
* also uses mvvmcross model-view-viewmodel framework: https://github.com/MvvmCross/MvvmCross
*  HOCKEYAPP_APPID = "faef339301e8b7de8e90f2f7ba7f3427";

Hockeyapp component unitalizing code (direct copy paste from setup document) which is called in second activity right after splash activity:

		protected override void OnCreate (Bundle bundle)
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.home_activity);

			// Register the crash manager before Initializing the trace writer
			HockeyApp.CrashManager.Register (this, HOCKEYAPP_APPID); 

			// Initialize the Trace Writer
			HockeyApp.TraceWriter.Initialize ();

			// Wire up Unhandled Expcetion handler from Android
			AndroidEnvironment.UnhandledExceptionRaiser += (sender, args) => {
				// Use the trace writer to log exceptions so HockeyApp finds them
				HockeyApp.TraceWriter.WriteTrace (args.Exception);
				args.Handled = true;

			// Wire up the .NET Unhandled Exception handler
			AppDomain.CurrentDomain.UnhandledException +=
				(sender, args) => HockeyApp.TraceWriter.WriteTrace (args.ExceptionObject);

			// Wire up the unobserved task exception handler
			TaskScheduler.UnobservedTaskException += 
				(sender, args) => HockeyApp.TraceWriter.WriteTrace (args.Exception);


Exception creator code. This isn't view isn't loaded on app open (to avoid HockeyApp no initialized potential problem) and i navigate manually to this view:

    public class EulaView : BaseView<EulaViewModel>

        protected override void OnCreate (Bundle bundle)
            base.OnCreate (bundle);
			SetContentView (Resource.Layout.settings_webview_currentlocation);
			ActionbarTitle = "EULA WITH CRASH";

			string[] results = "hello".Split(' ', '0');
			Type t = results.GetValue (1000).GetType();

When exception occurs this is logged:

[MonoDroid] System.IndexOutOfRangeException: Index has to be between upper and lower bound of the array.
[MonoDroid] at System.Array.GetValue (int) <IL 0x00045, 0x001a0>
[MonoDroid] at Bazaar.Android.Views.Account.EulaView.OnCreate (Android.OS.Bundle) [0x0003f] in /Users/inc/bazaar-app/Android/Android2/Views/Account/EulaView.cs:28
[MonoDroid] at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d419c934/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.App.Activity.cs:2475
[MonoDroid] at (wrapper dynamic-method) object.89e1795d-2353-4e4b-90d6-e5c92749e7cf (intptr,intptr,intptr) <IL 0x00017, 0x00043>
Writing unhandled exception to: /data/data/com.apptanker.basaar/files/0b7006fe-7669-42e1-846f-bf05dbfb6eea.stacktrace

After exception returning to application displays dialog: do you want to send crash to the developer. After selecting send, this is logged:

06-25 11:26:43.931    6335-6335/com.apptanker.basaar D/HockeyApp﹕ Looking for exceptions in: /data/data/com.apptanker.basaar/files
06-25 11:26:43.931    6335-6335/com.apptanker.basaar D/HockeyApp﹕ Current handler class = md52ce486a14f4bcd95899665e9d932190b.UncaughtExceptionHandler
06-25 11:26:43.931    6335-6717/com.apptanker.basaar D/HockeyApp﹕ Looking for exceptions in: /data/data/com.apptanker.basaar/files
06-25 11:26:43.931    6335-6717/com.apptanker.basaar D/HockeyApp﹕ Found 1 stacktrace(s).
06-25 11:26:43.931    6335-6717/com.apptanker.basaar D/HockeyApp﹕ Transmitting crash data:
    Package: com.apptanker.basaar
    Version: 9
    Android: 4.3
    Manufacturer: LGE
    Model: Nexus 4
    Date: 6/25/2015 11:22:13 AM
    System.IndexOutOfRangeException: Index has to be between upper and lower bound of the array.
            at System.Array.GetValue(int.args:1337)
            at com.apptanker.basaar.Bazaar.Android.Views.Account.EulaView.OnCreate(Android.OS.Bundle.args:1337)
            at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_(intptr_intptr_intptr.args:1337)
06-25 11:26:44.992    6335-6717/com.apptanker.basaar D/HockeyApp﹕ Transmission succeeded

Environment properties:

Xamarin Studio
Version 5.9.3 (build 1)
Installation UUID: be6502f8-c6d0-4a46-ae30-320ebc92ddea
	Mono 4.0.1 ((detached/ed1d3ec)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400010044

Version: (Indie Edition)
Android SDK: /Users/inc/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.2   (API level 17)
		4.4   (API level 19)
Java SDK: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

Xamarin Android Player
Not Installed

Apple Developer Tools
Xcode 6.3.1 (7703)
Build 6D1002

Not Installed

Not Installed

Build Information
Release ID: 509030001
Git revision: 5a524e1726ed103fdd4fe37e0356f2b35466ce9d
Build date: 2015-06-02 16:35:08-04
Xamarin addins: 51957cfbd06be911b212671ad05c2c6221ac90f9

Operating System
Mac OS X 10.10.3
Darwin Indreks-MBP.lan 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
Comment 1 David Humphreys 2016-01-07 21:13:01 UTC

the HockeyApp component has been updated to version 3.8.5 since this issue was raised.  Please can you retest with this latest version and reopen if neccesary.