Cannot get ASP.Net to serve any pages under IIS6 - asp.net

I am trying to set up another instance of a live website for a customer to evalulate, however i am unable to get the server to serve up any ASP.NET pages at all.
I know this is normally a bit of a noob question, but i have set up these servers a hundred times and know all the usual gotchas, i have done all of the following to no avail, and for my example i have created a simple test page that writes out hello world, and i'm still unable to get anything to serve..
This is windows server 2003 R2 SPII
I have registered ASP.NET using aspnet_regiis.exe -i
I have enabled the web service extensions
I have created it as a virtual directory, and created the application
I have set the version of ASP.NET for my virtual directory to use
I have even created a new App Pool and given it administrator permissions.
I have run Auth Diag From Microsoft, i get and error from the authentication check, but it is blank
I have given full control to the everyone group for the folder
I have tried creating a new website with a different port, same problem
In fiddler i get the following repsonse when loading an asp.net page :
HTTP/1.1 504 Fiddler - Receive Failure
Content-Type: text/html
Connection: close
Timestamp: 09:43:01:0634
ReadResponse() failed: The server did not return a response for this request.
Looking at the IIS logs, i dont see any entries for any of the ASP.NET requests unless i turn on windows authentication, then i see
2011-04-12 08:13:23 W3SVC1 10.4.3.16 GET /test/Test.aspx - 80 - 10.2.16.17 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+Trident/4.0;+GTB6.6;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.4506.2152;+.NET+CLR+3.5.30729;+InfoPath.2;+.NET4.0C;+.NET4.0E) - 401 2 2148074254
2011-04-12 08:13:26 W3SVC1 10.4.3.16 GET /test/Test.aspx - 80 - 10.2.16.17 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+Trident/4.0;+GTB6.6;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.4506.2152;+.NET+CLR+3.5.30729;+InfoPath.2;+.NET4.0C;+.NET4.0E) - 401 1 0
HTML Pages serve up just fine, i'm stumped and about to get the server re-built as i have wasted long enough on this..
Any ideas :( ?

I ended up removing IIS and re-installign it, set the site back up and it worked fine...

Have you checked the windows event log for information that may lead to what is causing this?
You could also try removing the application role and adding it again encase there was an issue when originally setting it up.

Related

Azure VM IIS HTTP Status Codes Changed

I have a couple Azure VMs behind a Basic Load Balancer with an HTTP URL Health Probe for the Backend Pool. To mark a server down, that URL returns Status Code 503 (Service Unavailable), but when I call that page from those VMs, the Status Code returned is 403. That still has the desired effect, I suppose, of marking the server down - but I dont understand why the code I set has changed.
This is from an ASP.NET web forms application on the VMs. I look at developer tools in the browser, and from my local machine or from a Dev server on our local network, that page returns Status Code 503, but calling that page from the VMs in Azure, the Status Code is 403.
Here's where I set the Status Code in that page:
Response.Clear()
Response.StatusCode = 503
Response.Flush()
I suppose I should mention that my local is a Windows 10 box, and the server VM is Windows Server 2016. Both are running IIS 10. The application is compiled with .NET Framework 4.6.
Here's the dev tools from my localhost:
Here's the dev tools from the server in azure:
Why the change? Anything I can do to stop this behavior?
So today I tried enabling Failed Request Tracing, but either something wasnt set up correctly, or the error was being handled elsewhere, and didnt result in any failed requests being logged.
Since I wasnt getting any failed requests logged, I opened up Process Monitor and could see that immediately after the call to my Health Probe page, I was getting a call to my custom HTTP Error page. That page must have been what was giving the 403 (dont know why, b/c that page works correctly for other HTTP Errors with a friendly error message and logging of the error to my custom error tracking solution).
I was going to change the Status Code to see if there was something special with the 503 that I was setting that was handled differently in IIS, but that got me thinking about how I was setting the status code...
In my research today, I saw this page https://www.leansentry.com/HowTo/AspNet-Response-Flush-Poor-Performance which cautions against using Response.Flush(). The code that I had implemented was in the Page_PreRender method, so there's not really a need to Flush there anyway.
I removed the Response.Flush and of course, my troubles went away.
The Health Probe page no longer triggers an Error from the Azure VM, and therefore, the status code that I get in my client browser is the 503 that I set in code.
So I guess this case is closed. I will need to figure out why the HTTP Error page was throwing a 403 instead of returning the friendly error message, but that should be easy enough...

502 bad gateway on iis 8.0 intermittently using ARR

We have two application server having different url which are called as internal url and we have two more servers on where we have implemented ARR rules which are having set of rules for more 7 applications and accessed as public domain.
I am getting "502 bad gateway" again and again but after restarting iis on arr box it starts working.
First, check the iis site error logs and find out what is the sub status code of the error.
To fix 502 error try below things:
refresh the URL in the browser.
clear your browser cache, cookie, and history.
try to Start your browser in Safe Mode.
restart your iis server.
Edit:
Please refer below article for more detail about the troubleshooting:
https://blogs.iis.net/richma/502-3-bad-gateway-the-operation-timed-out-with-iis-application-request-routing-arr
https://learn.microsoft.com/en-us/iis/extensions/troubleshooting-application-request-routing/troubleshooting-502-errors-in-arr

XMLHttpRequest Internal Server Error 500 Debugging

I have an api application which are givin me quite a headache. So in desperation I'm posting my problem here.
Short version
In short I need to know how I can debug my application to figure out what is causing the 500 Internal Server Error, I've tried to look into the Event log, but it doesn't tell me much besides which requests have failed, nothing about why they failed. So I honestly have no clue where to go from here.
The API is an ASP.Net MVC project and is hosted on an IIS 8.5 Windows Server 2012 R2
try sending a get request and reading the response. To get an increased level of error info, enable remote errors
https://technet.microsoft.com/en-us/library/bb684665.aspx

ASP.NET debugger gives errors with http, while working with https

I really desperately need your help because I got very unusual problem with my programs:
I am receiving this error when I am trying to debug my ASP.NET or MVC Application on local IIS Server 7.5:
"Unable to start debugging on the web server. The debug request could not be processed by the server due to invalid syntax. "
I tried literally every solution I could find in google until this day. I spent 12 hours trying to figure this out. Without luck.
Error happens only with this address: http:// localhost/AspDemo not with this one: https:// localhost/AspDemo. Basically, I can debug like always if I put https instead of http.
https is disabled on my local IIS server :), I mean it is set to ignore.
Moreover I CAN open my sites with using BOTH protocols in IIS Control Panel
If I disable ASP.NET Debugger in Properties of my App in Visual Studio, Application runs fine.
This is the error from the httperr log:
2014-10-30 00:23:46 ::1%0 2977 ::1%0 80 - - - 400 - Verb -
I am not sure where exactly, but in some other log I saw reference to something like this: Error 400 "Bad Request - Invalid Verb"
A week ago ALL applications I got problems with were working perfectly with asp.net debugger from visual studio, I had no idea what happened.
I suspect some update. Because updates lately messed with my custom bootloader as well.
When I enable tracing - log is empty with http
Fiddler log is empty as well, maybe there is some config I can use in Fiddler to produce some more logs? (It logs of course with modified machine.config when I use https)
Would be eternally grateful for your help, if you need some more logs, please don't hestitate to ask.
I would like to mention as well that yes, I saw similar posts on this site, but none of them described problem this similar to mine.
/edit
From what I was able to observe, error happens BEFORE debugger access machine.config file, can you guys tell me how to catch errors in that moment?
==== /edit 2 ====
Anyone? No one knows the answer?
Recently I was able to find the complete error message in: C:\Users\\AppData\Local\Temp\Visual Studio Web Debugger.log
http://localhost/MVCDemo/debugattach.aspx
Status code=400 (Bad Request)
Protocol version=1.1
Cached=False
Connection=close
Content-Length=326
Content-Type=text/html; charset=us-ascii
Date=Fri, 31 Oct 2014 03:44:14 GMT
Server=Microsoft-HTTPAPI/2.0
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request - Invalid Verb</h2>
<hr><p>HTTP Error 400. The request verb is invalid.</p>
</BODY></HTML>
In proccess monitor, I found this one as well:
<event>
<ProcessIndex>1339</ProcessIndex>
<Time_of_Day>04:40:33,3661553</Time_of_Day>
<Process_Name>devenv.exe</Process_Name>
<PID>10768</PID>
<Operation>CreateFile</Operation>
<Path>C:\Users\<UserName>\AppData\Roaming\Microsoft\VisualStudio\12.0\Debugger\StepIntoFilterData.ini</Path>
<Result>PATH NOT FOUND</Result>
<Detail>Desired Access: Read Data/List Directory, Read Attributes, Synchronize, Disposition: Open, Options: Sequential Access, Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Delete, AllocationSize: n/a</Detail>
</event>
I really, really need help with this.
=== /edit 3 ===
Second error is not relevant, I just checked and it is present with https as well (C:\Users\\AppData\Roaming\Microsoft\VisualStudio\12.0\Debugger\StepIntoFilterData.in), and debugging as https localhost works perfectly.
=== /edit 4 ===
Here are Process Monitor logs captured during Visual Studio Debugging HTTP (not working) and HTTPS (working)
(Test performed on random MVC Tutorial)
Use CTRL+F and Look for "Visual Studio Web Debugger.log" in logs to get the idea when it is happening. In https log is good, in http log returns Invalid Verb error mentioned before.
HTTP (not working)::
https://www.dropbox.com/s/7b26ybogtyqlico/LogFile%20HTTP%20NOT%20Working.CSV?dl=0
HTTPS (working):
https://www.dropbox.com/s/ggsj57v97ky90e6/LogFile%20HTTPS%20Working.CSV?dl=0
I might be wrong, but I think the key here is that only HTTP doesn't work and only with VS Debugger, everything else is just fine (HTTP and HTTPS without debugging and HTTPS with debugging.)
(It happens with every solution on IIS, new ones are affected too, all of these solutions were working, moreover some of them were not even changed from the time they have been working, IIS config didn't change as well)
I do not see the name of the verb in any of the description here, but my guess is VS debugger using a special verb (DEBUG) rather than the standard GET, HEAD, POST, etc. If you re-installed IIS after VS, the ISAPI mapping probably got nuked. This may solve the problem:
https://msdn.microsoft.com/en-us/library/ms165022%28v=vs.90%29.aspx

IIS7 .NET (2.0, 4.0) completely hosed with a Bad Request (Error Code 400) error

All of a sudden all of my websites on my server return 400 Bad Request Error. I don't have a clue what happened. App Pools are running in Classic pipeline mode (4.0, 2.0), doesn't matter.
Every URL that I type comes back as 400 Bad Request. Real URLs, even fake URLs that don't exist (which should come back as 404) all are 400.
http://mywebsite.com/AFile.aspx
http://mywebsite.com/AFolder/AnotherFile.aspx
http://mywebsite.com/Bfolder/YetAnotherSillyPage.aspx
http://mywebsite.com/A_stupid_URL_that_does_not_even_exist_fjfjffjfj.aspx
Everything 400 Bad Request. Totally screwed up my ASP.NET. Where should I begin to look? Machine.config? Web.config?
UPDATE:
After trying a million different settings, I finally set the App Pool to Integrated and set the Identity to LocalSystem and all of a sudden it works.
Bad Request usually is HTTP.sys stopping the request due to something really bad (like invalid URLs, or something like that).
You probably should look at HTTP.sys logs (Not IIS) at:
C:\Windows\System32\LogFiles\HTTPERR
Also, maybe something got broken in the http.sys configuration so try running:
netsh http show servicestate
And see if for your web site it has the correct bindings, for example it could be that the bindings are only listening on only specific IP Addresses and yet its coming from another one, or similar problem but with Host Name, etc.
Finally you might want to run:
C:\Windows\System32\inetsrv\appcmd list sites
And see if the bindings and status makes sense.
Have you tried some mixture of re-installing (or uninstall/install) asp.net using the aspnet_regiis.exe utility? That's fixed strange IIS/ASP.NET server issues for me in the past.
Have you looked in the event log for any error messages or further clues?

Resources