15

When switching sites to Beer, Wine, and Spirits on the site switcher on data.SE (this thing), I get a Runtime Error:

error


Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".

<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" 
defaultRedirect="mycustompage.htm"/>
    </system.web>
 </configuration>

Tested on this query and this one.

  • 7
    The server probably detected that you're not of age yet and aren't allowed to access this site :P – Glorfindel May 29 '17 at 13:51
  • 2
    This should be resolved now. I recently fixed some of the names in the Sites table and rene confimed it's working. – Taryn Aug 13 at 19:05
8
+100

It's not just that switcher, I can repro with the main dropdown as well:

The issue appears to be that the dropdowns generate the wrong site name for that site, attempting to use beer, wine & spirits stack exchange instead of beer and incorrectly sending you to:

http://data.stackexchange.com/beer,%20wine%20&%20spirits%20stack%20exchange/query/new

It has something to do with how those dropdowns work. They appear to use the Name parameter from http://data.stackexchange.com/sites rather than the actual data explorer site name, for example if you go to:

http://data.stackexchange.com/Chinese Language Meta/query/new

You will be redirected to:

http://data.stackexchange.com/meta.chinese/query/new

I suspect it has something to do with the & in Beer, Wine & Spirits's Name field in /sites, as that is unique to that site1 and it's the only site I could find where that redirect fails. It's not just that it isn't encoded (replacing it with %26 does not create a working link), it's something more than that.

As a temporary workaround it does work if you click the site from the site list or visit http://data.stackexchange.com/beer/query/new directly.

An alternate solution, if correcting the underlying routing error is too complex, might be to fix that site's Name field to be Beer (and a similar fix for its meta).


1 Note that there are other sites with & in their name, but only Beer, Wine & Spirits has it in the fields in /sites. For example, English Language & Usage Meta's "official" name contains the ampersand but its entry is:

{"Id":25,
 "Url":"http://meta.english.stackexchange.com",
 "Name‌​":"EnglishMeta",
 "Ico‌​nUrl":"https://cdn.s‌​static.net/Sites/eng‌​lishmeta/img/icon-16‌​.png",
 "LongName":"En‌​glish Language and Usage Meta"},

And it is displayed with the word and in the dropdowns.

7

Cross posted from Can't select Beer, Wine & Spirits on Data Explorer

The problem is the & in the name of the site. The actual error thrown is:

A potentially dangerous Request.Path value was detected from the client (&).

Here is my local reproduction of the error:

error due to &

The easiest fix for now is to change the record for alcohol.se in the Sites table as found the Data.StackExchange database. I don't fancy fiddling with webserver settings

Particularly I propose to change the Name column to Beer, Wine and Spirits Stack Exchange but keep the Longname column with the &. That change will still show the site name as we are used to, even in the site switcher:

site switcher

while it uses the value from the Name column to construct the url when you click that item.

A quick inspection didn't reveal any other serious mishaps with this change in place.

Now we need to bribe someone with database access to execute this query on Data.StackExchange:

update sites 
set name = 'Beer, Wine and Spirits Stack Exchange'
where Id = 224 -- oh I hope these ids are stable ... please let them be 

update sites 
set name = 'Beer, Wine and Spirits Meta Stack Exchange'
where Id = 225 -- oh I hope these ids are stable ... please let them be 

Looking at sites.xml over at the Data Dump in the Internet Archive I start to believe those Id's are stable ...

  • Someone might say this breaks existing queries ... – rene Aug 7 at 18:42
  • I believe those names in your updates have been fixed in Sites. Please check to see if you still get the error. – Taryn Aug 13 at 18:56
  • 1
    @Taryn yes, if I follow the network traffic I see a https://data.stackexchange.com/beer,%20wine%20and%20spirits/query/new with a 301 repsonse and a Location header to /beer/query/new. That is all good now! Thanks. – rene Aug 13 at 19:03
  • Cool, thanks for confirming – Taryn Aug 13 at 19:04
  • @Taryn it looks like both Name and Longname have been changed. That wasn't needed to overcome this particular bug. I suggested to only change the Name field so the Longname could be kept as is and the same as used on alcohol.se. Unless there were other pressing reasons to change it that I overlooked. – rene Aug 13 at 19:15
  • They were changed to fix this bug – Taryn Aug 13 at 19:19
  • 1
    @Taryn okay, didn't account for that. – rene Aug 13 at 19:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .