ASP .NET MVC 500 Internal Server Error - on Get and Post - same application / different servers - asp.net-mvc

I'm trying to help our System Admins here, so please don't beat me up for my lack of knowledge. We can run the application locally and we can build and deploy to our Test Server and the application reports work as expected. But when we deploy to our Production Server, many of the Get and Post Ajax calls are getting 500 errors. Essentially, all reports run everywhere EXCEPT on the Production Server.
This is an ASP .NET MVC application with the views being Razor HTML and JavaScript. The model, controllers, and services are all in C#. IIS 8.5 web server and SQL Server for the database.
I've Googled and tried everything I could find. More detailed errors show us the service call that fails along with the parameters and all looks good. Again the application reports run fine in all environments other than the Production Server. Does anyone have any idea why this is happening and what we should be looking at to resolve the issue?
Thank you in advance.

Just turn off custom errors in the web.config file
<system.web>
<customErrors mode="Off">
</system.web>
and then open up the development tools in a browser during one of the GET requests and replay the GET yourself. Should get the exact error message back.

It took us all day to figure out that one of the parameter tables did not have the appropriate permissions. Which would explain why some reports ran while others consistently returned a 500 error.

Related

HTTP Error 500.22 - Internal Server Error - MVC 5 Application From IIS

I am really stuck with an issue in my MVC 5 application from IIS 7.5 sever. Application works fine in my local developing environment but it failed in server. I am sure that the issue is related to URL routing. I can sea my application home page but if i take some link(Link to any application route(Page)), then IIS is showing 500.22 issues.
I tried many solution to fix this issue.
1- Changed mode from Integrated to Classic
2- Added some patches mentioned in https://support.microsoft.com/en-us/kb/980368
3- validateIntegratedModeConfiguration="false"
Finally i installed MVC in my server machine also. Still no hope. Keep getting 500.22 error in case of route. I added some log writing functionality but i coudn't find any log related to that. In case of routing something else happen from IIS.
I am really stuck with issue. If anyone know any info related to this. then please help me.
Thanks in Advance.

MVC Site getting 500 error only on server, how do I get more info on error?

I have an MVC 5 web application that runs perfectly fine in VS when I debug it but the moment I deploy to my IIS server (Windows 2012 R2) I get a 500 internal server error. I have even enabled debug=true in the web.config on the server but get no detailed error. Nothing is showing in the event log I have restarted the web site in IIS and recycled the app pool with no change. What do I have to do to figure out what is not working on the server side?
By default, IIS hides debug information from remote connections. This means you need to log on to the server and browse the site there, or you need to turn off Custom errors in your web.config (change from RemoteOnly to Off).
Many kinds of configuration errors in IIS however, will only show up properly if you browse on the server.
While I did not find exactly what was wrong. I ended up rebuilding my site from the group up and in doing so I did figure out that it was something to do with the web.config but there is so much of the web.config file I left out of the new site I don't know the exact code in it that caused the problem.

Deploying ASP MVC 5 App with IIS 7.5

I try to deploy ASP MVC 5 app in virtual directory (without creating new iis application)
I use IIS 7.5
I already put
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="true" />
in web.config file.
But when i go to app url with IE browser it shows me just directory listing like in screenshot below
Is there a way to deploy MVC 5 in virtual directory and make it work like usual MVC application?
You need to convert the virtual directory to application. Right click on it in the IIS management console and choose Convert To Application.... Also make sure that the associated application is configured to use Integrated Pipeline Mode.
I solved this problem earlier in my production environment by checking the directory pointer in IIS. Apparently when I unzipped the deployed site from one server to the next, the zip utility made an extra level, so IIS was pointing to /MyProject when the files were in /MyProject/MyProject. I had a little better clue though, you have Document Browsing enabled based on that screen shot, make sure not to do that in production. I set the site to log custom errors and got a 403.14 response, from there found a blog on my mistake. You need to setup the environment to find the specific module that's failing, I think something to do with trace routes, idk. I'm a software developer that always gets forced into doing devOps; was googling my own problem and thought I'd throw you a line. Without a specific error message, all I can tell you is IIS is not connecting to .NET; something is not configured correctly. Turn off directory browsing, google how to get good error logs back, and let us know the status code so we can help you: 403.14, 401, 500, 404? Also give us the module that's failing. If it's the last one on the handler list, guess what, IIS isn't connecting to the app, which I suspect is your case.

Azure Websites 500 Error

I've deployed several websites to azure websites previously without a problem. I always add the elmah nuget package because it make diagnosing issues easier. However, I'm currently stuck with http://yis3.azurewebsites.net
When I try to reach the site I get an http 500 error. I've tried following the suggestions from this page msdn but I've hit the following problems:
Will not load symbols when I attach debugger. I've ensured site is compiled and published as debug
Despite enabling tracing and selecting "View Streaming Logs in Output Window" all I get in the VS2013 output window is "Now new trace in the past 1 mins, 2 mins etc"
The website uses EF6 to connect to a SQL Express database. I've checked the connection strings in the web.config and websites portal - they look ok. I guess the site is failing before trying to reach the database though - the /home/documents action should return a view with hard-coded html and even that fails!
I have checked the website is configured to run .Net v4.5
Could anyone please advise what else I can try?

Asp.Net-MVC application dying

I have a strange issue with an Asp.NET MVC application.
Using Asp.NET MVC 3 Preview 1 on IIS 7.5 - Integrated
After building the application everything runs fine. Then after some random amount of time (or sometimes after updating a view or js file) the application dies.
Meaning, requesting the root page, I get the 403 error and requesting any other page I get a 404 error.
After a rebuild everything works fine again for a little while until it dies again.
I am seeing this on two different development machines. Also, I have another application which is very similar (MVC 3, IIS etc) on both dev machines and this one runs without problem. I have inspected the config files in detail and cannot see anything of notable difference.
Does anyone know what could cause an application to die or where to look for further information? (I can still access elmah.axd though no information is there).
There's not much to go on here, but the 403 and 404 are clues that at least ASP.NET routing is not working; 403 is coming back because the web server thinks you want to do a directory browse, 404 because your request doesn't have a valid corresponding resource.
Since you are using the new version of MVC, I would suspect the issue may lye there. When you get the error condition, can you browse to a regular .aspx page? Does it execute server side code correctly?
You have the site hosted in IIS 7.5, not just the built in Visual Studio web server, right? Is it possible to turn on monitoring/event logging to see if IIS is taking a hit?
I apologize for not having any actual answer, sounds like you have a tough issue to debug.
Good Luck!

Resources