Unable to run StatLight (HTTP Error 503: The service is unavailable)

Mar 18, 2011 at 10:28 PM

I have previously been able to launch StatLight from a VisualStudio 2010 command prompt using this command:

StatLight -x="pathToMyXap.xap" -b

Recently, when I try to launch, I get the following error in the browser window:

Service Unavailable
HTTP Error 503. The service is unavailable

Does anyone know what service this is referring to? Other team members can launch the test xap without problems, but I can't for some reason.

I'm running version 1.3.3981.

Mar 19, 2011 at 12:10 AM

Could you try including the --debug parameter and posting that? It might let me see what's going on inside StatLight.

Mar 21, 2011 at 5:49 PM
staxmanade wrote:

Could you try including the --debug parameter and posting that? It might let me see what's going on inside StatLight.

Here is the result of running with the --debug parameter:

C:\<Path>\StatLIght -x="MyXap.xap" -b --debug

StatLight - Version 1.3.3981
Copyright (C) 2009 Jason Jarrett
All Rights Reserved.

DiskXapHostFileLoader cannot find file - C:\<Path>\StatLight.Client.For.December2008.xap
DiskXapHostFileLoader cannot find file - C:\<Path>\StatLight.Client.For.March2009.xap
****************** Input options as configured ******************
ContinuousIntegrationMode          : False
ForceBrowserStart                  : False
IsRequestingDebug                  : True
MethodsToTest                      : IEnumerable<string>
MicrosoftTestingFrameworkVersion   :
NumberOfBrowserHosts               : 1
OutputForTeamCity                  : False
QueryString                        :
ShowHelp                           : False
ShowTestingBrowserHost             : True
StartWebServerOnly                 : False
TagFilters                         :
UnitTestProviderType               : Undefined
UseRemoteTestPage                  : False
WebBrowserType                     : SelfHosted
XapPath                            : IEnumerable<string>
XmlReportOutputPath                :
RunnerType = OneTimeConsole
Incoming MSTest file's hash = 357A677957F309AE85C3E5AEEDA43A32BCA23AD3
XapItems.FilesContainedWithinXap = AppManifest.xaml
XapItems.FilesContainedWithinXap = Microsoft.Silverlight.Testing.dll
XapItems.FilesContainedWithinXap = Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll
XapItems.FilesContainedWithinXap = OurCompany.dll
XapItems.FilesContainedWithinXap = OurCompany.Tests.dll
XapItems.FilesContainedWithinXap = System.Xml.Serialization.dll
Loading XapHost file [MSTestApril2010]
Loading XapHost [C:\<Path>\StatLight.Client.For.April2010.xap]
testPageUrlWithQueryString = http://localhost:8887/GetHtmlTestPage?
IRunner typeof(OnetimeRunner)

Starting Test Run: 3/21/2011 11:42:31 AM

Listening on http://localhost:8887/

Mar 21, 2011 at 5:51 PM

And here is the output after letting it run until it times out:


No communication from the web browser has been detected. We've waited longer than the configured time of 00:05:00

------------------ Test Failed ------------------
Test Namespace:
Test Class:
Test Method:
Other Info: No communication from the web browser has been detected. We've waited longer than the configured time of 00:

--- Completed Test Run at: 3/21/2011 11:47:32 AM. Total Run Time: 00:05:01.1061076

Test run results: Total 1, Successful 0, Failed 1,

Mar 21, 2011 at 9:28 PM

I'm not seeing any particular problems.

Another thing to try. Use the --webserveronly option and take the url it gives you and paste it into a web browser. What do you see? (try a different web browser?)

Any other details you can provide? What do your co-workers have setup that you don't?

Mar 21, 2011 at 10:09 PM

When I use the --webserveronly option I still get the same "Service Unavailable" error message. And I haven't been able to discover anything different about my setup, as compared to my co-workers. And as I mentioned in the original post, I was able to run StatLight fine a couple of weeks ago. Unfortunately, I can't think of anything that has changed recently that would have any effect on being able to run it.

Mar 22, 2011 at 1:34 PM

Can't say this will solve anything, but since I don't have any other ideas, you could try the latest code. Goto the github site, download and run the build-Full-Release-skip-tests.bat to get the latest build and give that a shot? (Don't expect this to actually solve it, but something to try)

Mar 23, 2011 at 5:10 PM

I didn't try updating to the latest code, but my genius colleague has found a fix for the problem., although it's a little unclear how this became a problem in the first place.

The issue was that I was running the Visual Studio Commpand Prompt (2010) as an administrator every time, and at some point we had run the command 

netsh http add urlacl url=http://+:8887/ user=DOMAIN\user

as described in this post. For some reason, it appears that that was preventing the server from binding to that port. That seems pretty odd, since it sounds like that command was supposed to give permission to non-administrators to use that port. It's also a little odd that we didn't try running that command until after I encountered the original service unavailable error. One of the troubleshooting steps we tried was running that command, since other developers on our team have had to run that. So I still don't know what caused the error initially. But at least we finally found a way to fix it, by just deleting the reserved url:

netsh http delete urlacl url=http://+:8887/

Once we deleted that, I could run StatLight just fine in both an administrator VS command prompt, and in a regular VS command prompt. If I add the reserved url, then the regular VS command prompt still works fine, but the admin starts reporting the service unavailable error. I'm always logged in to a local profile with admin rights (on Windows 7), so maybe that's why I don't need that reserved url for it to work in a regular VS command prompt.

Thanks for you quick responses, staxmanade!

Mar 23, 2011 at 6:14 PM

That's great - Thank you for the investigation and describing the problem/solution here.

There was a change in StatLight v.1.3 that allowed one to run it without being administrator. However I wasn't aware of any issues if you already had the ACL configured on that port. StatLight should have auto-detected it couldn't use the port and tried the next port 8888 and so on. So I'll take a look into why this wasn't working and not making it discoverable for you.

Thanks again.

Apr 5, 2011 at 3:50 PM

FYI: I just ran into this today at my work. I had an admin console open and tried to run the StatLight build and received the service unavailable message. 

I spent a few minutes looking into it, but couldn't seem to find a way to automatically detect this situation.

Oh well - at least for now we have a workaround...