Unknown Error on Remote Server - asp.net

I have a web api running on a remote server that I connect to over VPN in order to deploy updates.
I installed the Rewrite Module for IIS 7 and made a rule to rewrite http to https for all requests.
Suddenly I am getting this error when I attempt to acquire an authorization token (OAuth):
{
"error":"server_error",
"error_description":"Exception has been thrown by the target of an invocation."
}
And this message for any api endpoint:
I cannot for the life of me figure out what's going on. How can I get a more useful error message from asp.net or iis? I cannot do remote debugging and the server does not have visual studio installed.
I have undone all the modifications I made and its still broken.

This is usually a sign that IIS is having problems even starting the application. I'd remove everything from the web.config file and add each line in one by one until you get back to this error message. If it is an application error (i.e., something in your code) you would get a 500. Since you aren't getting a 500, it is a lower level than your application and the next lower level is IIS parsing your web.config file before serving requests.

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...

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

500 Internal Server Error - Any Upload via Wordpress Admin Panel

I am running a Wordpress website on Windows Server 2012 on VPS. I am receiving 500 Internal Server Error when I try to upload anything such as theme, media, plugin via adming panel of wordpress site. I am wondering why is this happenning.
What I could find so far is:
Most likely causes:
IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
IIS was not able to process configuration for the Web site or application.
The authenticated user does not have permission to use this DLL.
The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.
Things you can try:
Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.
Check the event logs to see if any additional information was logged.
Verify the permissions for the DLL.
Install the .NET Extensibility feature if the request is mapped to a managed handler.
Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.
Detailed Error Information:
Module FastCgiModule
Notification ExecuteRequestHandler
Handler PHP-php
Error Code 0x80004005
Requested URL
Physical Path
Logon Method Anonymous
Logon User Anonymous
More Information:
This error means that there was a problem while processing the request. The request was received by the Web server, but during processing a fatal error occurred, causing the 500 error.
View more information ยป
Microsoft Knowledge Base Articles:
294807
Ok, I have found the solution after a day of research. In my case the error was the PHP Support. I changed the PHP support in Plesk from Fast CGI to CGI then boom. It worked. Hope it will help you some how.

Exe Hosted in IIS Calling Generates Http 405 Method not alllowed Error

I want to use Testtrack SDK API and for that needs to host Test Track SDK server on my server Machine, When I had installed Test Track on my server machine and tried to call it through code it gives me Error Http 405 method not allowed.
Is there any specific things which needs to be done in IIS to run exe ?
The 405 error is a security issue with the IIS web server. You can find step by step instructions for configuring CGIs with IIS in the TestTrack user documentation.
http://help.seapine.com/testtrack/2015.0.1/ttinstall/Default.htm#cshid=WebServerConfigIIS7_8

Is there a standard set of HTTP 500.xx codes?

I've seen servers return 500 Internal Server Error codes with extra 'detail' in a decimal-delimited sub-code, e.g. 500.19.
Is this sub-code standardised or can I freely use it? How do I prevent crashing into vendor codes, say, in IIS or ASP.NET?
Luke
Is this sub-code standardised or can I freely use it?
It is not possible to use it, quote RFC 2616:
The Status-Code element is a 3-digit integer
MSDN says for the HttpResponse.SubStatusCode:
Independent of whether tracing is configured, the code is never sent as part of the final response to the request
So, it is only used for logging and troubleshooting, not sent to the client.
There is a Microsoft standard list. See - http://support.microsoft.com/kb/943891
IIS 7.0 defines the following HTTP status codes that indicate a more specific cause of a 500 error:
500.0 - Module or ISAPI error occurred.
500.11 - Application is shutting down on the web server.
500.12 - Application is busy restarting on the web server.
500.13 - Web server is too busy.
500.15 - Direct requests for Global.asax are not allowed.
500.19 - Configuration data is invalid.
500.21 - Module not recognized.
500.22 - An ASP.NET httpModules configuration does not apply in Managed Pipeline mode.
500.23 - An ASP.NET httpHandlers configuration does not apply in Managed Pipeline mode.
500.24 - An ASP.NET impersonation configuration does not apply in Managed Pipeline mode.
500.50 - A rewrite error occurred during RQ_BEGIN_REQUEST notification handling. A configuration or inbound rule execution error occurred.
Note Here is where the distributed rules configuration is read for both inbound and outbound rules.
500.51 - A rewrite error occurred during GL_PRE_BEGIN_REQUEST notification handling. A global configuration or global rule execution error occurred.
Note Here is where the global rules configuration is read.
500.52 - A rewrite error occurred during RQ_SEND_RESPONSE notification handling. An outbound rule execution occurred.
500.53 - A rewrite error occurred during RQ_RELEASE_REQUEST_STATE notification handling. An outbound rule execution error occurred. The rule is configured to be executed before the output user cache gets updated.
500.100 - Internal ASP error.

Resources