Azure emulator wont start as CacheInstaller has stopped working

Several times, I am getting CacheInstaller error as shown below during the starting up of Azure emulator from Visual Studio. Most of the cases I can just ‘Close the program’ and the emulator will continue to start.
cacheInstaller
But there was one occasion that the CacheInstaller error dialog kept coming up each time I closed the dialog; and since then the emulator won’t start. So I clicked the ‘Debug the program’ to attach the CacheInstaller to Visual Studio. And copy the error message in the CacheInstallationException dialog (shown below) to notepad.
CacheInstallationException
And below is the message I got from the exception:

An unhandled exception of type 'Microsoft.ApplicationServer.Caching.AzureServerCommon.CacheInstallationException' occurred in CacheInstaller.exe
Additional information: Install Manifests : Script completed with error: ExitCode: 2
ErrorStream: Configuration error.
Configuration error.

ERROR: wevtutil.exe im Microsoft.ApplicationServer.EventDefinitions.man failed with error 15010
OutputStream: F:\Projects\My Cloud Project\My Cloud Project\csx\Debug\roles\MyCloudWorkerRole\plugins\Caching>C:\Windows\system32\unlodctr.exe /m:Microsoft.ApplicationServer.Caching.PerformanceCounter.man

Info: Successfully uninstalled the performance counters from the counter definition XML file Microsoft.ApplicationServer.Caching.PerformanceCounter.man.
F:\Projects\My Cloud Project\My Cloud Project\csx\Debug\roles\MyCloudWorkerRole\plugins\Caching>C:\Windows\system32\wevtutil.exe um Microsoft.WindowsFabric.EventDefinitions.man

Provider Microsoft-Windows-Fabric{{751c9dc0-4f51-44f6-920a-a620c7c2d13e}} is missing channels under the channelreferances registry key.
F:\Projects\My Cloud Project\My Cloud Project\csx\Debug\roles\MyCloudWorkerRole\plugins\Caching>C:\Windows\system32\wevtutil.exe um Microsoft.ApplicationServer.Caching.EventDefinitions.man
F:\Projects\My Cloud Project\My Cloud Project\csx\Debug\roles\MyCloudWorkerRole\plugins\Caching>C:\Windows\system32\wevtutil.exe um Microsoft.ApplicationServer.Caching.TracingEventDefinitions.man
F:\Projects\My Cloud Project\My Cloud Project\csx\Debug\roles\MyCloudWorkerRole\plugins\Caching>C:\Windows\system32\wevtutil.exe um Microsoft.ApplicationServer.EventDefinitions.man
F:\Projects\My Cloud Project\My Cloud Project\csx\Debug\roles\MyCloudWorkerRole\plugins\Caching>C:\Windows\system32\lodctr.exe /m:Microsoft.ApplicationServer.Caching.PerformanceCounter.man
Info: Successfully installed performance counters in F:\Projects\My Cloud Project\My Cloud Project\csx\Debug\roles\MyCloudWorkerRole\plugins\Caching\Microsoft.ApplicationServer.Caching.PerformanceCounter.man

F:\Projects\My Cloud Project\My Cloud Project\csx\Debug\roles\MyCloudWorkerRole\plugins\Caching>if 0 NEQ 0 (
echo.
 echo ERROR: lodctr.exe failed with error 0  1>&2
 exit /b 2
)

F:\Projects\My Cloud Project\My Cloud Project\csx\Debug\roles\MyCloudWorkerRole\plugins\Caching>C:\Windows\system32\wevtutil.exe in Microsoft.ApplicationServer.EventDefinitions.man
<b>Provider Microsoft-Windows-Fabric{{751c9dc0-4f51-44f6-920a-a620c7c2d13e}} is missing channels under the channelreferances registry key.</b>
F:\Projects\My Cloud Project\My Cloud Project\csx\Debug\roles\MyCloudWorkerRole\plugins\Caching>if 15010 NEQ 0 (
echo.
 echo ERROR: wevtutil.exe im Microsoft.ApplicationServer.EventDefinitions.man failed with error 15010  1>&2
 exit /b 2
)

From the highlighted message above, it is obvious that the wevtutil command is returning error (15010), instead of the expected value:0. And the error is something to do with some missing registry. Hmm, it looks like registry corruption and unfortunately I didn’t have restore point of my VM so that I could restore to the last working state. So I did more research on the wevtutil command, as for developer I am not really familiar with it. To cut the story short, the wevtutil command is provisioning/registering the custom event log defined in the EventDefinition.man file to the Event Viewer and it depends on the registry values in this locations: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Publisher]. Then I searched for registry key {751c9dc0-4f51-44f6-920a-a620c7c2d13e} under the Publisher node and find this node key: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{751c9dc0-4f51-44f6-920a-a620c7c2d13e}] which is the event source for Azure Caching.

In the error message above it complains about missing channels. Under this registry node in my development VM, I only saw 2 channels (channel 1 and channel 2). So I did remote desktop to one of the worker roles in our UAT cloud services and check for this registry setting, and there were 3 channels (0,1, and 2). I added the channel 0 and their associated keys following the one in UAT and restart my visual studio. And finally I can debug my cloud project again.

Below is the registry settings that missing from my development VM:

CacheEventRegistry

Comments are closed.