HTTP Error 503 - But only when using domain name to navigate - asp.net

I am currently having a strange issue that has taken me by surprise, I have not had the issue before and I have no idea why I am getting it now.
I have an asp.net mvc 3 website which has a number of controllers all with actions. It is important to note that this issue is only present with one controller and the problem is with all Actions.
The error I am getting is "HTTP Error 503. The service is unavailable."
However, this error only occurs if I browse to the page using the domain name, for example...
subdomain.example.com/controller
but everything works fine if I browse with the ip address and port number...
xxx.xxx.xxx.xxx:xxxxx/controller
remember all other controllers work fine regardless of the method used to browse.
I have tried looking for answers to this and trying to find any useful logging information but have found nothing of use. Hopefully somebody here will have seen this issue before

Ok I have created a sample mvc project with a Reports controller that works so I don't believe it is a problem with MVC.
I'd reccomend looking at your routes and your web.config and make sure you don't have anything intercepting it there into an httphandler or module. Then I'd look at the IIS instance and check for virtual directories. You pretty much are trying to figure out where exactly it is failing - is it even reaching ASP.Net?
One last option to look into is your company proxy - does going to the URL directly go through the proxy? I know at my company this can happen - so there may be a rule there that is intercepting it.

Related

IIS - Unexplained 302 response code

What scenarios cause IIS to generate a 302 besides response.redirect? I'm working on an legacy ASP.NET app and it's generating 302s in IIS. The thing is, the code doesn't make any response.redirect calls. I don't know how to debug this thing. Could losing session generate a 302? I'm totally lost.
It can happen if you return a CSS file in ASP.NET over http when it should be over https, ive seen that happen in the past. Also if any web services tied into that application that are getting hit or making passes that fail, that could cause it too. Just shooting from my hip and trying to recall the last time I seen those issue's arise.
Check at the IIS level, not ASP.NET level.
Check the IIS management console. Possible options are:
"URL rewrite module"
"HTTP redirect" (under the website settings, for IIS7)

Creating a customised 503 page in IIS 7

This is my first question :)
Is there any way to create a cutomised 503 error page in IIS7. Form what I have read, this error page is served up internally by http.sys and cannot be overriden. This is confirmed at the top of this page.
However, I have seen Questions on Stackoverflow where this is apparently possible, but I have had no luck trying to implement it. Could anyone give me a definitive answer?
Thanks in advance.
Sadly, the TechNet article is accurate - there is no way to replace 503 for the scenario you describe.
The error is detected by the IIS server as it attempts to hand the incoming request to your application. Everything your application does is performed in its app pool. Modules like rewrite rules and custom HTTP responses are all executed in this way.
If your application has no app pool to run in, it unavailable to do any custom processing: there is essentially no code running for your application.

WCF and Client accessing error, local runs fine, on uploading gives 404

I have a RESTful service on a server whose url say is www.webserve.com
i have a proxy client on my local machine to hit and get the details from this service.. the client has a page name default.aspx which post and hit the www.webserve.com and get the data.
it works fine but as soon as i upload this client on the same server(IIS) with a name say www.proxyclient.com and open it with my browser the default.aspx works fine but as soon as i post the data and hit the service through it it gives mt a 404 error..
I dont know whats wrong with it.. may be this is the static vs dynamic IP mess or something like that..
can u please help me out. i need to get this done on urgent basis
Thnx guys
Alright got the solution. my proxyclient was using a handler to handle a custom extension. I mapped that extension to IIS with aspnet dll and it worked.. thnx guys for ur support :)
Actually I needed to register .svc to my IIS ISAPI with .net framework dll
then it worked fine :)

500 - Internal server error for ASPX page

I have created one test.aspx and my local machine it is working fine. Once I upload the same to server the page is not working. It's showing
500 - Internal server error. There is a problem with the resource you
are looking for, and it cannot be displayed.
It is impossible to help you without getting more info about the IIS configuration on your local machine and the server.
However, here's a quick stab of some things you should look at:
Check if Asp.net is installed on the server.
Make sure your app is targeting the proper .Net version that is on the server.
Check if all the assemblies your code is using are deployed correctly on the IIS server.
Add some exception handling and error logging to your code.
In particular, I'd venture to make a wild guess that your page is using some code that requires the IIS7 integrated pipeline and your server is either running IIS6 or is running IIS7 in classic mode. Though this is a stab in the dark and could turn out to be completely wrong. :-)
500 server errors are as useful as saying 'something broke'. They are the result of literally any exception you code throws plus anything else IIS croaks on. From your error msg, it sounds like an IIS config issue but it could still be your code. attaching a debugger to it would eliminate that possibility.
If you haven't looked at the server event log you can see if it registered anything.
There are a number of things that you can do to try to get a better, more specific exception. One way I try to diagnose them is to connect a remote debugger so I can see what's going on. If you have access to do so, I'd go that route.
You will need admin access to the server to install the Visual Studio remote debugging client (I'm assuming this is a .net app).
Another thing that can help are try/catch blocks and logging to a file or the event log--but have have to change your app most likely to implement that.
You have probably forgotten to upload the associated .dll. Have you tried right clicking on the project and using the publish feature?
If you are using IE, then you also need to turn off the "Show friendly error messages" option in Tools - Options - Advanced settings so that you get more details.
You may also need to change the web.config file so that error message details are shown, see the CustomErrors tag.

ASP.Net when post back get The specified URL cannot be found

When clicking the save button on a asp.net web form page, I get the following immediately:
The specified URL cannot be found
This does not happen when I try this using a browser on the web server.
Has anyone run across this problem before? Is this some kind of security issue?
More information. I tried a test page that included all of the form fields and a button that didn't do anything but write to a log4net log. Same problem on the button click. This is just weird.
Found the solution to this!!! Turns out the firewall was blocking request that had more then 40 parameters in the query string.
Could you provide a bit more information?
This could be caused by a lot of things:
Is IIS configured properly for the site? Authentication, host header settings?
Did you try http://localhost/.. on the webserver or did you use the webserver's host name?
Are you redirecting the user? What are you doing in the button event?
Are you using URL routing? Or a handler that might be causing problems?
What version of the .NET framework are you running? 1.1 / 2.0 / higher?
Does the page include javascript that could cause unexpected results?
Checked for crazy stuff in your web.config?
Sometimes it's a good idea to take a step back and create a new ASPX page and test if that one works. Start from a predictable scenario and move towards your current scenario in baby steps.

Resources