Error 405 on PUTs, "ignoreme.rastahook" in IIS log - openrasta

We have an Asp.Net application with OpenRasta, and when we deploy it on most of our IISes (7.5), it works fine. In one installation though, for PUT requests, the client receives "405 Method not allowed" errors, and the log shows entries like:
2011-11-15 01:18:20 192.168.0.164 PUT /myapp/ignoreme.rastahook - 80 - 192.168.0.131 AClient 405 0 0 57
ignoreme.rastahook seems to come from OpenRasta's rewriting in OpenRastaModule.cs:
HttpContext.Current.RewritePath(VirtualPathUtility.ToAppRelative("~/ignoreme.rastahook"), false);
The GETs and POSTs work fine though, not sure though if the HTTP method really is what makes the difference. Any idea on what might be going on or where to start debugging? My current guess would be some IIS configuration difference between the working servers and the one that doesn't.
OpenRasta version is 2.0.3, and we run the app on .net 4.
Update:
Fwiw, when changing the verb attribute of the OpenRasta handler mapping from "*" to "GET,POST" in the web.config of my server that works, I get a "ignoreme.rastahook" in the log file as well for the PUTs, but with a 404, not a 405, so that seems to be different from the issue described above.
Update 2
I figured that when I enable WebDAV, I can reproduce the 405 / ignoreme.rastahook issue. Which lead me to https://github.com/openrasta/openrasta-stable/wiki/Installing-OpenRasta-Under-IIS , that states that
please be aware that the WebDAV module can cause problems with IIS 7.5
Update 3
I verified that WebDAV is what caused the problem on that other server, but if anyone knows how to fix the problem without disabling WebDAV altogether, I'd appreciate it.

The problem as you've seen comes from WebDAV. There is no know way that I have found bar adding the entries in your web.config to disable webdav.
This has been added to the wiki page in question.

Related

Web Config Issue with IIS 7.5 MVC 5 App

So I have an MVC 5 application which has been running fine and is published to two individual servers, with the same configuration, however one gives http status 500, the other works perfectly. Both servers are exactly the same windows release, and patched up to asp.net 4.5.1.
Browsing the site locally gives the source of the problem as the web.config file, with the relevant config source lines being -1: and 0: Both showing blank lines.
I've no idea what's going on with this one. I have copied the app in its entirety back from the working instance to the none working instance no avail.
I'm a bit stumped.
To note, i've also removed IIS and reinstalled as i thought that could be the cause of the issue.
So after much headscratching it turns out that some clown removed URL Rewrite module from this box. After reinstalling using the web platform installer all is well. I hope somebody finds this useful in future.
Nicolas Carlo, your response pushed me down an alternate route of diagnosing the problem and was helpful in this instance, thank you.

How to solve the 500 Server error in asp.net mvc without enable the error show stuff

I am using asp.net mvc 4 for my project. my project is going well. I wonder about a thing.
I make a controller Test and ActionResult Index() this action doesn't need any viewdata or any kind of things.
Now When I test it in my local computer it's should work and it is. no problem.
Now amazing thing is it's doesn't work on server.
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
I am amazed that what happen to my code when everything work without any exception.
Now when I told other people about log they don't have anything. I don't want to install any nuget package on live site to test it. Do someone help me to solve this without adding any error checking module.
How I can check the issue on server.
IIS will log 500 errors in the Event Logs. So assuming you have access to the server, you can check there.
Well, I'm sorry but you have to be willing to do something... If you don't want to install packages like Elmah or enable remote iis debugging or etc... the only other thing that comes to my mind is for you to just start changing random stuff and hope it works. Also, most of these 500 internal server errors are caused by something in the web.config file. Make sure everything is set and good in there.
A very common reason for getting 500 Internal Server error is : Issue in Web.Config file.
Many times one can have some tags not closed properly OR missing Double quotes etc..
In general some syntax error is present most of the times in Web.Config. So make sure atleast you PASS this case.

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!

Using ELMAH in medium trust

I'm building an ASP.net mvc app, and am having some problems getting ELMAH deployed using xml logging to a medium trust server, though it works fine on my local machine. It keeps getting a 404 error.
The problem might be that the host doesn't allow relative filepaths, so the "~/App_Data" doesn't work for logging. I switched that to:
logPath="\\Something\Something\ID\www.website.com\web\content\App_Data"
in the web.config. The syntax might be completely off, but I've tried a few variations and none of them worked.
I subsequently found this question and added the recommended code to my web.config, but still no luck. Does anyone know how to get ELMAH to work on medium trust?
Thanks!
The asp.net worker process (or the aspnet user) has minimum rights to write into the filesystem. Try a place like c:\temp where everybody can write files. After this check and set access rights for aspnet user.
It turned out that the ELMAH.dll was calling SQLite, which isn't allowed under medium trust, and was causing ELMAH to fail when deployed to medium trust. I needed to download the source code for ELMAH and re-build it without the reference to SQLite. It is now working. Yay!

Any ideas how to troubleshoot HTTP Error 400 for MVC/Firefox?

Two clients complains on HTTP Error 400 from Mozilla Firefox 3.6.9. This happens when they open any link - both mvc application and also any static images, which are hosted on Classic application pool without any code.
Exact error message is HTTP Error 400. The request is badly formed
No errors in windows log and application error log. Proxy in browser is set to off.
Other browsers works fine for them.
Any ideas about what could cause such behavior?
For now, i can see only one option - ask them to install Firebug, but this is not really user friendly.
For some reason, cookies was corrupted and this was leading to HTTP 400 error.
After user cleaned cookies for this website he was able to get page.
I still need to investigate what exactly went wrong and find source of this problem but it is clear that I need to review all places where I do cookie creation.

Resources