Wednesday, 19 September 2012

The remote procedure call failed (0x800706be)–Windows Azure SDK installation broke SQL Server Config Manager?!?

So I’ve been working on a project which is a large production web application built in ASP.NET MVC.  This is an enterprise level app which means it’s big, it’s complex, and it’s got a lot (i.e. thousands) of unit tests.
When you run all unit tests in solution in Visual Studio, and you’ve got, say, 6000 tests, the memory usage goes way up for devenv.exe, QTAgent32.exe (if you’re using 32 bit version of that; same goes for the 64 bit version, I’ve noticed); and, if you’re doing integration tests and your tests are hitting the database, then, the memory usage goes way up for SQL Server.  And, it doesn’t seem to let go of that memory (for any of those applications) when the tests are done.  (I’ve also noticed this type of behavior when I run certain database build scripts).
Well, I sometimes use the SQL Server Configuration Manager to, primarily, restart SQL Server, for example when I’ve just run a load of unit tests in Visual Studio.  (Yes you can also re-start the service from the normal Windows “Services” list, but I like to do it this way by launching a shortcut from my desktop).   Typically when I do that, it looks like this:
BTW the version of SQL I’m using is a developer version of SQL 2008 R2.
So anyway I’m going on my merry way, doing my daily work on that application.  Meanwhile, for a project on the side, I’m doing some experimentation with Windows Azure / SQL Azure.  So I downloaded the SDK to my dev machine (the host machine, not a VM), from here.  (I installed the WindowsAzureSDK-x64.exe).
A day or two later, I wanted to do my usual thing of restarting SQL from the config manager and instead of the list of services on the right, I saw something more like the screenshot shown in this stack overflow post.
So of course I started googling.  Most of the advice out there regarding this problem is basically rubbish (with all due respect).  Or at least, it didn’t solve my problem.
At that point, wondering what had changed, I realized that it might (obviously) have something to do with the fact that I had installed the Windows Azure SDK.
I found a clue here, did some pondering, and talked it over with colleagues.  So, the SDK, it turns out, installs SQL 2012 Express; one of my Hitachi colleagues suggested maybe the 2012 install had broken something.  I uninstalled everything to do with SQL 2012 Express, re-booted my machine, and lo and behold, the “remote procedure call failed” error went away and the list of services came back.
However, I was still unable to start the SQL Server agent.  It gave me a message saying it started but then stopped.  I thought, well, maybe I never WAS able to start the SQL Server agent.  But I thought, maybe I’d try to uninstall the rest of the Windows Azure stuff.  Maybe that’s still somehow blocking the agent.
Well, I tried to uninstall the Windows Azure tools, and it just gets to the end of the progress bar, then hangs. 
Then when you kill the process, then try to uninstall it again, you get an error saying “please wait while anothe program finishes uninstalling” or something to that effect.  I re-booted and that went away, but then when I tried this whole thing again, it turns out that waiting did eventually let me uninstall something else.
In the end I found, it let me uninstall all the other Windows Azure stuff, but the tools, seemingly, can’t be uninstalled.  It just hangs at the end.
I’m going to contact Microsoft and point them to this blog post… I’ll try another day to get this stuff all working together!  Smile
Until next time… –Dave

UPDATE:  Microsoft says they can't reproduce this.  And that SQL 2012 didn't get installed when they installed the Azure SDK in their lab.  So maybe I installed SQL 2012 with some other download.  More as this story develops.

UPDATE:  Tried this again on 2012-10-18.  Still same exact behavior.  Downloaded the SDK; it broke the configuration manager.