Opserver icon indicating copy to clipboard operation
Opserver copied to clipboard

In /about/caches, JSON for SQL Server named instances returns 404

Open SQLSourcerer opened this issue 7 years ago • 2 comments
trafficstars

When I have a named instance of SQL Server (i.e. name contains a backslash) and attempt to inspect the JSON for its caches in /about/caches, I get the 404 - Not Found page.

I tried changing the link on About.Caches.cshtml to use the new UrlPathEncode extension method. But apparently, that still wasn't enough to get the routing on JsonCache in DataController.cs to pick it up.

SQLSourcerer avatar Feb 15 '18 19:02 SQLSourcerer

This should be resolved in latest - can you give it a try please?

NickCraver avatar Feb 19 '18 01:02 NickCraver

No luck. I should clarify that I'm trying to get to the JSON for a particular cache, so ParentMemberName doesn't seem to be what was tripping it up. The path that's not finding its way into the JsonCache method in DataController looks like this: /json/SQL/SERVERNAME%5CINSTANCENAME/Databases

It seems to particularly dislike the backslash character in the path, even encoded. It happens on all the browsers I tried it on, so I suspect it's either IIS or ASP.NET MVC's routing engine that objects. One thing I tried was replacing the backslash with another character like ¤ before the UrlEncode. That gets it through the routing pipeline. Of course, then the replacement has to undone inside JsonCache.

SQLSourcerer avatar Feb 19 '18 15:02 SQLSourcerer