HTTP 400 'Request Header too long' error when accessing ASP.NEt application - asp.net

Our website is an ASP.net 4.0 webforms website using AjaxControlToolkit. It was online in the last week without a problem but since today one of our clients is receiving an 'HTTP Error 400. The size of the request headers is too long' when accessing the site from Firefox. It works in IE. Looking at the logs I see requests with really long junk attached after the URL:
...Statistics.aspx?_TSM_HiddenField_=ctl00_scriptManager_HiddenField&_TSM_CombinedScripts_=;;AjaxControlToolkit,+Version=4.1.51116.0,+Culture=neutral,+PublicKeyToken=28f01b0e84b6d53e:de-DE:fd384f95-1b49-47cf-9b47-2fa2a921a36a:475a4ef5:effe2a26:8e94f951:1d3ed089:addc6819:
5546a2b:d2e10b12:37e2e5c9:5a682656:c7029a2:e9e598a9
The URL should simply be .../Statistics.aspx.

I have found the problem: there were too many cookies on the site. Removing them solved the issue.
The problem had nothing to do with AjaxControlToolkit. Sorry for misleading the community with irrelevant details.
Edit:
I personally have cleaned the cookies using the Firecookie plugin for Firebug in Firefox but you can clean your cookies by pressing Ctrl+Shift+Del and selecting 'Cookies'.

Related

ASP.NET cached pages forces you to download the HTML page

I've got a high traffic blog (300,000 pageviews per day) made with asp.net that uses output cache for article pages.
It usually works well, but many users have complained about being prompted to download the page instead of being shown the page on the browser. I've seen it myself too a couple of times.. it goes away only when the cache for that page is refreshed.
It happens with II7 and below, using both .NET 4.0 and 2.0 (I recently updated the framework's version and the problem continues).
Any idea why?
I finally found the answer to my problem.
In case anyone else is interested, the problem was that, sometimes, pages were cached after a request made by a mobile user. For some reason, IIS sends back the response type as WML instead of text/html in that case, which is only accepted by some mobile browsers, not desktop.
Here's the simple solution for it:
Make IIS not render pages as WML. Ever!

Blank WebResource.axd

Have a rather large problem. About two weeks ago I noticed that alert based validation (ValidationSummary) stopped working on my website. Upon further review, WebResource.axd is coming back blank. It's not throwing an error, just blank.
I've tried tracing the request via Fiddler and Firebug, and the response is 200 at first. Subsequent cached requests (same page) return 304 (as I would expect).
I've checked IIS configuration, web.config, installed updates, Global.asax, httpHandlers etc... to try to find out what happened or why it's failing.
I've been troubleshooting this issue for two days now and am running out of options. Does anyone have any idea what the cause of this could be? Any help is greatly appreciated.
This appears to be a tricky issue, can you check and answer the following two questions:
By any chance is debugging enabled on your deployed site.
Was the deployed website build properly in release mode?
I found the issue. Whilst installing John Papa's Hot Towel MVC project into a web forms/MVC hybrid, the routing config does not contain an IgnoreRoute instruction for AXD paths.
This means routing picks up the request ahead of the HttpHandler, and returns a 200 even when no controller exists for the given route pattern - hence a 200 response with an empty body.
I'll pull the bounty but I will upvote Shashank's answer.

How to resolve "The requested URL was rejected. Please consult with your administrator." error?

I have a ASP application. On click of a particular link, some VB scripts are executed and an ASP page is to be shown, but instead I get a screen that says:
Information Not Available.
The requested URL was rejected. Please consult with your administrator.
Your support ID is: XXXXXXXXXXXXXXXXXXXXXX"
The IIS and event viewer logs do not show any error message.
This happens only for some users, but works fine for other users.
What are the possible causes for this error ?
Your http is being blocked by a firewall from F5 Networks called Application Security Manager (ASM). It produces messages like:
Please consult with your administrator.
Your support ID is: xxxxxxxxxxxx
So your application is passing some data that for some reason ASM detects as a threat. Give the support id to you network engineer to learn the specific reason.
Encountered this issue in chrome. Resolved by cleaning up related cookies.
Note that you don't have to cleanup ALL your cookies.
I found the issue. This is a firewall message and an error was occurring in the VB script due to wrong data in database, but the error was not logged/caught properly.
It is not related with Firewall. I had the same issue accessing from office and from mobile.
I cleaned the cookies and worked fine. You can read more at https://support.google.com/chromebook/answer/1085581?hl=en
I was able to resolve my clearing my cookies and cache.
I have faced the same issue using Google Chrome browser. Same website was opening normally using the incognito mode and different browsers. At first, I cleared cached files and cookies over the past 24 hours, but this didn't help.
I realized that my first visit to the website was during the past 10 days. So, I cleared cached files and cookies over the past 4 weeks and that resolved the problem.
Note: I didn't clear my browsing history data

Chrome returns "Bad Request - Request Too Long" when navigating to local IIS Express

I have a web application that runs perfectly fine when I use the Visual Studio 2010 development server (Cassini). However when I try to use IIS Express to host the site Chrome just displays a "Bad Request - Request Too Long" error. The IIS Express site does display in other browsers (FireFox and IE9) so I'm kind of confused. The error occurs in Chrome when I try request pages in my application or even basic resources like an image, so I don't think it is an issue with URL rewriting or routing.
Just to see if the problem was somehow a result of my site's code, I created a new MVC3 website and tried running that. This worked in the VS development server, but once again produced the "Bad Request" error when running under IIS Express.
I am about to start testing the site using some mobile devices so I need to get this running under IIS. Any suggestions would be greatly appreciated.
EDIT:
The root url of the site (http://localhost:50650/) is being requested using GET. I am currently using Chrome v12.0.742.112.
I get this all the time ONLY in Chrome and I have to clear browsing data to fix it.
Wrench > Tools > Clear Browsing Data
Check the following:
Clear browsing history
Clear download history
Empty the cache
Delete cookies and other site data
Then click "Clear Browsing Data" button and refresh your page.
UPDATE:
I figured out that it has to do with writing too many cookies to the browser and that if you just close all instances of Chrome, the error goes away for a while. To prevent it, you'll need to clear out your cookies programmatically.
Instead of clearing all the cookies, just do the following:
Right click the lock in the address bar area (see picture below)
Under cookies there is a link saying how many cookies are used
Click that link
Remove all cookies in there (or just the troublesome if you can identify them)
Problem gone
This error is caused by a corrupt cookie for the website you are trying to view, so to clear it all you need to do is clear the bad cookie(s) for that website.
In Chrome, go to...
chrome://settings/cookies
(Or manually go to Settings->Advanced Settings->Privacy->Content->All Cookies and Site data)
From there, you can search for cookies that match the site you are having problems on. Finally, click "remove all" for the matching cookies.
The problem is usually that the site in question has accumulated too many cookies or created cookies which are too large, making the HTTP headers swell beyond the allowed maximum.
One-time work-around
As has been mentioned, you can go to Settings|Advanced|Content Settings|All Cookies and Site Data, search for the site in question, and delete the cookies using the X button on the right. This reduces the header size of the HTTP request when contacting the site.
Long-term work-around
In addition to removing them one-time, however, you can prevent further problems with heavy cookie sites by going to Settings|Advanced|Content Settings|Manage Exceptions, and add the base site url (e.g. "msdn.microsoft.*" without the quotes) and select Behavior as "Clear on Exit". You might have to login more often to these sites, but this should prevent the problem.
I encountered this problem when using ADB2C login from ASP.NET WebApp. In Firefox you can do similar use case to delete related coockies and problem is gone for a while. Click on HTTPS (i) lock icon with, select ">" button on the right, select More information, select Security tab, click on View Cookies and click on Remove All. Done 4 a while.
If Above methods didn't work then enter
chrome://settings/resetProfileSettings
and Click on Reset Settings
This will reset your startup page, new tab page, search engine, and pinned tabs. It will also disable all extensions and clear temporary data like cookies. Your bookmarks, history and saved passwords will not be cleared.

asp.net site demo over webex, weird issues seen

Our customer experienced multiple errors on a demonstration to a customer of theirs.
The site is asp.net 3.5 based and has been running pretty well lately. They said 2 hours later site was ok again... (needless to say they are not happy)
The traces in the health log look very weird, it appeared to be as if incomplete pages were returning to the server for processing..
A fair of of the errors were errors generated by scriptresource.axd with bits of the page source showing up as part of the url... very very odd. I'd never seen this before...
I was talking to their lead tester who then told me this only happened during a webex (cisco sharing product) demo and was fine after...
Is it possible the webex session could have impacted the site http stream between client and server...
This is a known IE8 issue. I bet you will see Trident/4.0 for all "broken" requests in the user agent field. (Google for "IE8 4K bug")
You can either run a different browser or appply the latest IE8 patch (this issue has already been fixed)

Resources