Decoding error 500 on IIS7 - error-handling

I am getting error 500, looking at the log I can see the http headers with the error 500, but how do I find out why it's happening? Is there any other tool I should be looking at? The event viewer is also not showing anything.
Thanks

As was also answered to this other question, a good way to get more detailed information on error 500 is to enable detailed error reporting:
Internet Information Services (IIS) Manager —> Your Web Site —> Error Pages -> Edit Feature Settings -> select "Detailed errors"

Related

Server Error in '/' Application (ASP.net 4.8 MVC) - Plesk Onyx

I uploaded an ASP.net MVC project to Plesk. On the very first page. I get this error:
Server Error in '/' Application
​>
Runtime 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.
I searched the Plesk forum and found a thread on the same topic (an older one but reviewed it anyway). But I didn't get any help as the KB link given in this thread is broken.
https://talk.plesk.com/threads/server-error-in-application.339898/
Since the error described, doesn't provide much detail, I checked 'Log' on the Plesk control panel and found that repeated error is given as
DateTime - 2022-06-05 07:48:21
IP - 1.18X.XXX.1X6
Status Code - 500
Error Code - GET / - HTTP/1.1
I tried searching Stack Overflow but questions are only pointing towards HTTP1.1 enablement or custom error in web.config.
Please help

Moodle File Upload errors: An error occured whilst communicating with the server

With some Uploads in Moodle (3.9) Uploads are not successful, mainly pdf.
The message that comes up is: "An error occured whilst communicating with the server".
not successful requests show
POST /course/dndupload.php undefined
successful requests show
POST /course/dndupload.php HTTP/1.1
When a pdf is reexported with libre office for example the same pdf can be uploaded without problems.
any ideas?
Is the LibreOffice pdf smaller? It could be PHP timing out.
https://docs.moodle.org/311/en/File_upload_size#Modifying_the_php.ini_file
What is the value for max_execution_time ? You can check the PHP values here -
Site administration > Server > PHP info
Also, try switching debug to developer level and see what the error message is.
Site administration > Development > Debugging
Debug messages = Developer
Display debug messages = checked
Although be cautious changing the debug level if its a production site. If you have access to the config.php file then you can specify a user.
// You can specify a comma separated list of user ids that that always see
// debug messages, this overrides the debug flag in $CFG->debug and $CFG->debugdisplay
// for these users only.
// $CFG->debugusers = '2';
Thanks for the response, in the meantime a solution to the problem was found. On the server a measurement against log4j2-vulnerability has been implemented: https://support.f5.com/csp/article/K59329043#proc2. This caused the misbehaviour, the iRule has been removed, now it works again.

The CGI application did not return a valid set of HTTP errors. 502.3 - Bad Gateway: Forwarder Connection Error (ARR) on Azure ASP.NET Core App

All of a sudden we are seeing this random error / exception in our web application.
Failed to load resource: the server responded with a status of 502 (Bad Gateway).
In the Log Stream, we are seeing the following details, with specific error code as 502.3 - Bad Gateway: Forwarder Connection Error (ARR).
Also, sometimes in the browser itself we see "The CGI application did not return a valid set of HTTP errors." getting displayed.
Most of the searches for these error codes refer to "IIS / Proxy Server" configuration. But, we haven't changed any such settings.
The error happens very randomly and not specific to any user action/function. Same functionality works first and on second execution immediately after first one throws this error.
How to figure out what is causing this and how to fix?
I google this question, because the program was normal at the beginning, and the subsequent 502.3 error. After I checked the information on the Internet, I feel that it can only give us an inspiration, and it cannot solve your problem immediately.
So my suggestion is that first you browse post1 and post2 I provided.
Next, proceed to Troubleshoot according to the steps of the official documentation. Specific errors require specific analysis.

WCF and IIS error 500 when using diagnostics

I have problem with WCF on IIS when using diagnostics.
When I call the service I get the following error:
System.Net.WebException: The remote
server returned an error: (500)
Internal Server Error..
If I remove "system.diagnostics" section I dont get error 500 but I get an error
The requested service,
'http://localhost/CustomerServiceSite/Customer.svc'
could not be activated. See the
server's diagnostic trace logs for
more information..
Which obviously needs diagnostics to get fixed.
Any idea why diagnostics doesnt work?
Check event log on web server - http 500 should be logged there. Also check that Account running your AppPool in IIS has access rights to file used for diagnostics.
The diagnostics will write a trace file to disk - maybe the user account WCF/ASP.NET is running under doesn't have permissions to write the file.
If I opened my service in browser (http://localhost/CustomerServiceSite/Customer.svc) I have seen the whole error.
The problem was becouse I used NHibernate and Diagnostics in wrong way. Commenting NHibernate configuration solved my problem.

OData / WCF Data Service - HTTP 500 Error

I have created an OData/WCF service using Visual Studio 2010 on Windows XP SP3 with all current patches installed.
When I click on "view in browser", the service opens and I see the 3 tables from my EF model. However, when I add a table name ("Commands" in this case) to the end of the query string, rather than seeing the data from the table, I get an HTTP 500 error.
(This error (HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying.).
I have not only followed the examples from 2 sites, but have also tried running the sample application that the blog poster sent me (that works on his machine), and still am not having any luck.
The blog post is at Exposing OData from an Entity Framework Model
Does anyone have an idea why this is occurring and how to resolve it?
Here is the output of the "View in Browser":
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
- <service xml:base="http://localhost:1883/VistaDBCommandService.svc/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app">
- <workspace>
<atom:title>Default</atom:title>
- <collection href="Commands">
<atom:title>Commands</atom:title>
</collection>
- <collection href="Databases">
<atom:title>Databases</atom:title>
</collection>
- <collection href="Statuses">
<atom:title>Statuses</atom:title>
</collection>
</workspace>
</service>
Update:
In an effort to get this working, I have:
Removed and re-installed IIS
Ran the %WINDIR%\Microsoft.Net\Framework\v4.0.30319\aspnet_regiis –i –enable command
Ran the %WINDIR%\Microsoft.Net\Framework\v4.0.30319\ServiceModelReg.exe -r command.
Created a new solution and followed the instructions very carefully to assure that I
didn't mess anything up.
After all of this, I am still getting the same HTTP 500 error, with no entries of any kind in the Event Viewer.
Any other ideas?
I figured out that my problem was an issue with opening the database. The way I figured it out was to add the following to the servicename.svc.cs file in the InitializeService method:
config.UseVerboseErrors=true;
Thanks to all who tried to help.
Eric
config.UseVerboseErrors=true; helped me in finding out the problem. The problem was I was using windows authentication for database connection. After changing to SQL Server Authentication everything worked fine.
Please try these debugging tips to see the actual error which happened:
Link
500 always means there was an unhandled exception in the service. Go look in the windows event log to see what that error was.
Received similar output with VS2013:
Resolved by upgrading the Entity Framework.
See answer https://stackoverflow.com/a/21028123/2116188.
You can also activate Failed Request Tracing for your Web Application in IIS
then you will get detailled trace execution in Xml files from IIS when a 500 error occurs
There is a good article here explaining how to setup Failed Request Tracing in IIS :
Using Failed Request Tracing to Trace Rewrite Rules
HTH
Cédric
If you are using SQL Server Compact data file (Like NorthWind.sdf) you need to give write file permission to IUSRS group.
Ex: If you are using NorthWind.sdf in DataDirectory i.e. YourWeb/App_Data then you need to give write permissions to _IUSRS group from IIS Console or from Windows Explorer.