Aaron Langley - 85 - Jun 16, 2014

Mini Profiler seems to be broken in 4.0.21. Was there a breaking change regarding this? I can’t find anything in the release notes.

This now returns a 404 error:
 /api/ssr-results?id=443c899d-3349-4b7d-9b5e-9cf2a17e107e&popup=1?_=1402970813698

Though the other stuff, such as the ssr- stuff for javascript and html is available. 

No changes were made to MiniProfiler, and everything’s still working for me locally. 

ssr-results does return 404 if it can’t find a record of the profiled result. By default it stores results in the HttpRuntime Cache so shouldn’t have any dependency issues.

Do you have any StartUp errors in your debug info, i.e: ?debug=requestinfo
https://github.com/ServiceStack/ServiceStack/wiki/Debugging#request-info

If you don’t have any StartUp errors, can you create a new issue at:
https://github.com/ServiceStack/Issues

Please include the output of ?debug=requestinfo and the HTTP Request/Response of calling /ssr-results (which you can get from WebInspector or Fiddler).

Aaron Langley:

?debug=requestinfo always returns an empty response. I’ve checked Config.DebugMode is set to true. Is there anything else that’s required to enable it?

Nope that’s it, are you requesting it from the path where servicestack is mounted? i.e. /api?debug=requestinfo (if you have SS registered at /api custompath)

Aaron Langley:

yes it’s just empty content for /?debug=requestinfo And I upgraded my fork of EmailContacts to 4.0.21 and it does the same. (After enabling debug mode)  With Email Contacts the mini profiler is inconsistent in .19 and does’t return a result in .21 so far. What forces mini profiler to create data sometimes and not others?

I’ve just updated EmailContacts to v4.0.21 in this commit: 
https://github.com/ServiceStack/EmailContacts/commit/c603bda62e8afe4f8596ebeb7c495c7d93302b80

And the MiniProfiler works as it did before, here’s a screenshot:
http://i.imgur.com/xcX1Jlh.png

Can you try pulling the latest version of EmailContacts (it’s now at v4.0.21) and then send screenshots of the issue.

Aaron Langley:

Ok I got it again and the issue still happens (on Mac through XS / xsp4). I’ll spin up my Windows VM and see if it’s environmental.

http://imgur.com/D57WRQH

Marc-Antoine Latour:

Hi guys, maybe it’s just a URL issue, your URL seems to contain 2 question mark

Aaron Langley:

Yes it’s working on Windows + VS. Just not from Mac + XS. 

Found the issue:

The EndRequest event in the Global.asax, i.e:

protected void Application_EndRequest(object src, EventArgs e) {
        Profiler.Stop();
}

Doesn’t have HttpContext.Current set which it needs to be able to save the results to the HTTP Runtime Cache.

A solution is to move the call to Profiler.Stop() in the AppHost’s OnEndRequest by overriding it in your AppHost, i.e:

public override void OnEndRequest ()
{
        base.OnEndRequest ();
        Profiler.Stop();
}

Aaron Langley:

Nice find. Thanks :slight_smile: