5

One of our users is getting an error in our web application. We couldnt duplicate this problem, and I suspected it was network related. I had the user try the application using their notebook at their office and their home, and confirmed the problem only happens at their office.

I logged into the server and looked at the event viewer right after they tried at their office and the following warning was in the log.

I'm at a loss on how to even start tracking this down. Any suggestions?

Event Viewer Log below:

Event code: 3005 Event message: An unhandled exception has occurred. Event time: 6/20/2012 6:32:45 PM Event time (UTC): 6/20/2012 10:32:45 PM Event ID: ebf8f628a9b3457cbea117c8c2da2186 Event sequence: 2970 Event occurrence: 26 Event detail code: 0 Application information:

Application domain: /LM/W3SVC/50/ROOT-1-129847041933281152 
Trust level: Full 
Application Virtual Path: / 
Application Path: c:\websites\foobar.acme.com\ 
Machine name: MyServer    Process information: 
Process ID: 15152 
Process name: w3wp.exe 
Account name: NT AUTHORITY\NETWORK SERVICE    Exception information: 
Exception type: HttpException 
Exception message: Server cannot set content type after HTTP headers have been sent.    Request information: 
Request URL: http://foobar.acme.com/Project/Evaluate/ResultsXML.aspx?step=89&uid=4397&rnd=hhf8oe

Request path: /Project/Evaluate/ResultsXML.aspx 
User host address: 192.168.102.1 
User:  
Is authenticated: False 
Authentication Type:  
Thread account name: NT AUTHORITY\NETWORK SERVICE    Thread information: 
Thread ID: 12 
Thread account name: NT AUTHORITY\NETWORK SERVICE 
Is impersonating: False 
Stack trace:    at System.Web.HttpResponse.set_ContentType(String value)    at System.Web.UI.Page.SetIntrinsics(HttpContext context,
Boolean allowAsync)    at
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)   
at System.Web.UI.Page.ProcessRequest(HttpContext context)    at
ASP.error_aspx.ProcessRequest(HttpContext context)    at
System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler,
TextWriter writer, Boolean preserveForm, Boolean setPreviousPage,
VirtualPath path, VirtualPath filePath, String physPath, Exception
error, String queryStringOverride)
Custom event details:
Community
  • 1
  • 1
WhiskerBiscuit
  • 4,795
  • 8
  • 62
  • 100
  • possible duplicate of [Server cannot set status after HTTP headers have been sent IIS7.5](http://stackoverflow.com/questions/2383169/server-cannot-set-status-after-http-headers-have-been-sent-iis7-5) – Chase Florell Jun 22 '12 at 14:26
  • possible duplicate of [Server cannot set content type after HTTP headers have been sent](http://stackoverflow.com/questions/901083/server-cannot-set-content-type-after-http-headers-have-been-sent) – Chase Florell Jun 22 '12 at 14:29
  • possible duplicate of [Server cannot set content type after HTTP headers have been sent](http://stackoverflow.com/questions/9360857/server-cannot-set-content-type-after-http-headers-have-been-sent) – Chase Florell Jun 22 '12 at 14:31
  • 1
    That case everyone was using MVC. We are not. – WhiskerBiscuit Jun 22 '12 at 17:01
  • We would likely need to see some of the CS code behind the "ResultsXML.aspx" file to help. Like the error said though, the code is simply attempting to set a HTTP header after all the headers have been flushed to the client. This can occur if you set something like that after the [Render Event](http://msdn.microsoft.com/en-us/library/ms178472%28VS.100%29.aspx) in .Net. Please provide the code for us to help more. – Turnerj Sep 09 '13 at 08:41

2 Answers2

0

Might have to do with integrated versus classic pipeline mode. Compare your two environments and ensure they do not differ in this respect.

IIRC in integrated pipeline mode you can reset or remove headers after they have been written; in classic mode you can't.

If you don't know the difference, check this article.

Community
  • 1
  • 1
John Wu
  • 50,556
  • 8
  • 44
  • 80
  • 1
    What two environments? There is only one server, unless I am misreading the question? –  Sep 23 '13 at 22:17
  • Interesting, I read the question as having an environment that doesn't work ("office") and others that do. But on a second read perhaps there is only one server and it's a browser/network issue of some kind. If that's the case, the error in the event log is either a red herring or this is one weird problem. – John Wu Sep 24 '13 at 00:35
0

I'm adding a second answer in case I completely misunderstood the question when I wrote the first answer. In this answer I'll assume there is exactly one server and this is a browser/user-specific issue.

  1. Confirm that the error you posted is not a red herring-- check the event logs for other occurrences and make sure it only happens when your user encounters his or her error.

  2. Please describe the behavior associated with the error (e.g. what does the browser display? 500 error? System error message of some kind? Network disconnect?)

  3. Inspect the traffic coming from the browser (e.g. look at the IIS logs). Your server doesn't care one whit about anything about the user other than how (s)he appears in the traffic. In particular I would keep an eye out for differences in the accept headers, which can be browser specific and may be triggering a different logic path in the server-- one that attempts to set the content type to something the user's browser will accept.

Here's my wild guess at at answer for now:

The purpose of ResultsXml.aspx is to return a document of some kind; that document requires an external app (such as a PDF or XML viewer); it returns it with a content-disposition of inline; and the office computer's local security policy disables caching. In this case the third party viewer app will fail to find the file because the cache won't be there.

If I'm wrong, please post the above, and I'll keep guessing :)

John Wu
  • 50,556
  • 8
  • 44
  • 80