12

Hi I have been trying to solve my problem, however couldn't do anything about it.

The problem is

http://localhost/productservice/service.svc when type this address in my browser it gives me 503 Service Unavailable error

When I run my code from VS 2010 it gives me

The HTTP service located at http://localhost/ProductsService/Service.svc is too busy. exception.

ProductService is running in the ASP.NET v4.0 integrated application pool with the ApplicationPoolIdentity.

I just got no idea what I need to do!

(Windows 7 Home & IIS7)

basicHttpBinding is used

the server side config is

<?xml version="1.0"?>
<configuration>
    <connectionStrings>
        <add name="AdventureWorksEntities" connectionString="metadata=res://*/ProductsModel.csdl|res://*/ProductsModel.ssdl|res://*/ProductsModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=PINCHY\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/>
    </connectionStrings>
    <system.web>
        <compilation debug="true" targetFramework="4.0">
            <assemblies>
                <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            </assemblies>
        </compilation>
    </system.web>
    <system.serviceModel>
        <behaviors>
            <serviceBehaviors>
                <behavior>
                    <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
                    <serviceMetadata httpGetEnabled="true"/>
                    <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
                    <serviceDebug includeExceptionDetailInFaults="false"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
    </system.serviceModel>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
</configuration>

the client app.config is

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IProductsService" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="None">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:80/ProductsService/Service.svc"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IProductsService"
                contract="ProductsService.IProductsService" name="BasicHttpBinding_IProductsService" />
        </client>
    </system.serviceModel>
</configuration>

Any help will be much appreciated Thanks

Pinchy
  • 1,506
  • 8
  • 28
  • 49
  • 2
    You need to give us more to go on!! What is your config? What binding do you use? Show us the server-side config!! (anything inside the tag) – marc_s Jan 25 '11 at 12:03
  • Your configuration looks correct. Did you try to debug your service? Btw. Windows 7 Home has IIS7? – Ladislav Mrnka Jan 26 '11 at 21:40
  • I did Microsoft Service Trace Viewer! What I can see is System.ServiceModel.ServerTooBusyException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 And yes Windows 7 Home has IIS 7.5 do you think I am missing something here? After I have that exception the application pool stops working I have to restart it again. – Pinchy Jan 27 '11 at 12:17
  • I couldn't get it working, whatever I tried didn't help! I had to fully uninstall and install ISS 7.5, .Net V4.0 framework. Now it is working fine. I guess it was .Net 4 compatibility issue with IIS 7.5 thanks for the help :) Cheers! – Pinchy Feb 04 '11 at 13:26

5 Answers5

22

Had the same problem, but a different cause. In IIS (left side panel), click on Application Pools and make sure the ASP.NET version you've selected is actually running. Mine was off for some reason.

Brian
  • 3,653
  • 1
  • 22
  • 33
  • 1
    My app pool was off because our COTS CRM system thought it would be a great idea to turn it off. – Bruno Jul 01 '15 at 15:24
8

I just have the same issue. The issue for me turned out be an invalid password. My password recently changed and the app pool for IIS uses the old password. Once the password was updated the application worked again.

Hopes that help.

Nam Hoang
  • 81
  • 1
  • 2
  • Thanks Nam! Looks like the password for the account that was running hte app pool and the site had changed. Reset and did a stop/start and no error on build or package in VS. – sealz Jan 16 '14 at 14:59
3

I also ran into the same problem and the solution is,

In IIS click on ProductsService website under default website. On the right side under actions pane click on advanced settings. Check the Enabled Protocol property the values for this property should be comma separated ex: http,net.tcp . Actually I had entered semi colon instead of comma and I used to get the same exception which you are facing. try replacing semicolon which comma. I think it should work.

akjoshi
  • 15,374
  • 13
  • 103
  • 121
2

Our team experienced the same issue, 503 Service Unavailable. In our case, the application pool was fine, (the identity was set correctly and the app pool was started).

After some evaluation, we discovered a WCF based service was installed on the server that reserved port 80. Using the netsh http command we were able to see the url reservation.

netsh http show urlacl

Reserved URL            : http://+:80/

The following link proved helpful: http://blogs.msdn.com/b/webtopics/archive/2010/02/17/a-not-so-common-root-cause-for-503-service-unavailable.aspx

Seymour
  • 7,043
  • 12
  • 44
  • 51
  • Thanks. Same cause in my case but with https - 443. It works after removal. – gdenuf Jan 25 '17 at 04:04
  • Dead link, available at archive.org: https://web.archive.org/web/20190122182217/https://blogs.msdn.microsoft.com/webtopics/2010/02/17/a-not-so-common-root-cause-for-503-service-unavailable/ – tr00st Jun 30 '21 at 08:25
1

I kept getting the 503 error in IIS 7 running a .NET 4.0 website on localhost. I got rather smug about it because all I had to do was click on Application Pools in the left-hand pane where you see sites and application pools listed. Sure enough, the relevant application pool was always stopped and I just re-started it. However, today (the reason I came back to this question) this didn't solve the problem. In my case I have a website with some public pages, then 2 applications which are password-protected. Only one of the applications was giving the 503 error. I selected the application and clicked Advanced settings and realised that the problem was the application pool. It was pointing to the DefaultAppPool instead of the application pool for the overall website. When I corrected that, all 3 areas of the website began working normally again. So, to sum up, a 503 error may be caused by a stopped application pool. Just make sure you re-start the right application pool to get your website running again.

DavidHyogo
  • 2,838
  • 4
  • 31
  • 48