Bug 23537 - [XVS.iOS only] Active Directory + unusual network routing causes intermittent "Unhandled Activation Error"
Summary: [XVS.iOS only] Active Directory + unusual network routing causes intermittent...
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 8.13 (C6 early alphas)
Hardware: PC Windows
: High critical
Target Milestone: 8.13 (C6 alpha)
Assignee: Bugzilla
Depends on:
Reported: 2014-10-01 17:44 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2015-07-29 11:30 UTC (History)
11 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 Brendan Zagaeski (Xamarin Team, assistant) 2014-10-01 17:44:57 UTC
[XVS.iOS only] Active Directory + unusual network routing causes intermittent "Unhandled Activation Error"

This is a fairly specific variation on bug https://bugzilla.xamarin.com/show_bug.cgi?id=17613 based on closely matching symptoms from 2 different customers.

There are some other known causes of this same activation stack trace related to Region settings and accented characters. We were pretty careful to rule out those issues when I was working with these 2 customers.

Performing an offline activation isn't helpful in this case because the `mtouch.exe` command does not produce accurate `--datafile` or `--entitlements` outputs. As a result, it sees the manually downloaded license file as invalid and deletes it.

## Steps to reproduce

Attempt to activate Xamarin.iOS via Visual Studio.

In both cases, the customers' computers used Active Directory logons and had somewhat complicated network routing configurations. In these conditions the Xamarin.iOS activation will fail _intermittently_. Sometimes the activation will succeed, but other times it will invalidate the licenses on disk and then fail when it attempts to reactivate.

Curiously, but maybe also helpfully, the Xamarin.Android activation seemed to work correctly in both cases, without any intermittent failures. So perhaps this particular form of the "Unhandled Activation Error" can be fixed by modifying the "datafile" and "entitlements" commands in `mtouch` to match the corresponding `mandroid` commands more closely.

## Test results (in the failing state, consistent for both customers)

- The "datafile" from `mtouch.exe` [1] was empty, and there was no output to standard error either.

> [1] "C:\Program Files (x86)\MSBuild\Xamarin\iOS\mtouch.exe" --datafile > %USERPROFILE%\Desktop\mtouch-data.out 2> %USERPROFILE%\Desktop\mtouch-data.err

- In contrast, the "datafile" from `mandroid.exe` [2] was _not_ empty. It contained data that at least superficially correct.

> [2] "C:\Program Files (x86)\MSBuild\Xamarin\Android\mandroid.exe" --datafile > %USERPROFILE%\Desktop\mandroid-data.out 2> %USERPROFILE%\Desktop\mandroid-data.err

- Similarly, the `--entitlements` option produced _no output_ for `mtouch.exe` [3], but normal output for `mandroid.exe` [4].

> [3] "C:\Program Files (x86)\MSBuild\Xamarin\iOS\mtouch.exe" --entitlements > %USERPROFILE%\Desktop\mtouch-entitlements.out 2> %USERPROFILE%\Desktop\mtouch-entitlements.err

> [4] "C:\Program Files (x86)\MSBuild\Xamarin\Android\mandroid.exe" --entitlements > %USERPROFILE%\Desktop\mandroid-entitlements.out 2> %USERPROFILE%\Desktop\mandroid-entitlements.err

- In one of the cases, we tried the `mtouch.exe -v --activate` command too. That also behaved similarly. It produced no outputs.

- The `mtouch.exe` binary was correct. I had both users send their binaries over, and in both cases I was able to produce _correct_ output when I executed the file locally on my computer.

## The primary error message observed during activation

> System.Exception: Could not load machine data:
>   at Xamarin.Components.Ide.Activation.ActivationService.GetErrorWorkflow(LicenseSyncResult[] results, Boolean ignoreSyncErrors)
>   at Xamarin.Components.Ide.Activation.ActivationService.<GenerateFullWorkflowSequence>d__89.MoveNext()
>   at Xamarin.Components.Ide.Activation.ActivationDialog.DisplayWorkflowStep(ActivationWorkflowStep step)
>   at Xamarin.Components.Ide.Activation.ActivationDialog.<>c__DisplayClass13.<StartSpinnerTaskAndScheduleContinuation>b__12(Task t)
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2014-10-01 17:47:16 UTC
Regression status: not a regression. I believe this behavior has been untouched for a long time.
Comment 10 Miguel de Icaza [MSFT] 2015-05-20 21:16:11 UTC
CCiing Michael and Sebastien, they might know.

Raising the priority.