locked
Publishing with IIS generate Error 503. RRS feed

  • Question

  • User1185448985 posted

    I'm using EC2 to deploy my ASP.net Core MVC web application on IIS. I've published a medium sized project and the browser display the following message "HTTP Error 503. The service is unavailable. " I've published another new project "Empty" with the same setting as the previous project and the publishing succeeded i tried many solution such as :

    • making sure that the application poll is not stopped
    • turn the loading user profile to false
    • check the logs files for the following paths

    C:\Windows\System32\LogFiles\HTTPERR

    2021-03-18 22:12:09 ***.**.**.** 3380 ***.**.**.** 80 HTTP/1.1 GET / - 503 4 AppOffline TestApplication

    C:\inetpub\logs\LogFiles\W3SVC4

    2021-03-18 20:57:27 ::1 GET / - 80 - ::1 Mozilla/5.0+(Windows+NT+10.0;+WOW64;+Trident/7.0;+rv:11.0)+like+Gecko - localhost 503 0 1115 4833 264 24
    
    2021-03-18 20:57:27 ::1 GET /favicon.ico - 80 - ::1 Mozilla/5.0+(Windows+NT+10.0;+WOW64;+Trident/7.0;+rv:11.0)+like+Gecko - localhost 503 0 1115 4856 206 6

    i didn't understand the error and I'm hoping for some help

    Thursday, March 18, 2021 11:21 PM

Answers

  • User1185448985 posted
    It turns out that the problem is that i didn't have a valid connection string in my appsetting.json

    My startup.cs file is invoking dbInitializer which requires a valid database connection i struggled finding the correct form for the connection string, this is the form if anyone needs it:

        "DefaultConnection": "Server=data.*************.rds.amazonaws.com;database=data;uid=*****;pwd=*****;"

    ps: my database is hosted by AWS

    Thank you all

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 30, 2021 12:03 AM

All replies

  • User1312693872 posted

    Hi,Amani AI

    You should  Search for the site you are trying to browse in the logs and the last but one field will give you reason. and you can also find the

    evidence of repeated w3wp.exe crashes and Rapid-Fail Protection in Windows Events, in the System log with Source=WAS.

    The 503 response from the IIS machine, Service Unavailable, is the result of repeated application crashes. Since the w3wp.exe worker process,

    created by IIS to execute a web application, is crashing frequently, the respective IIS application pool is turned off. So you can check if the status

    of your application pool is started.

    Best Regards,

    Jerry Cai

    Friday, March 19, 2021 8:56 AM
  • User-474980206 posted

    Did you install aspnet core hosting module on your instance.

    https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-5.0

    Friday, March 19, 2021 2:42 PM
  • User1185448985 posted

    Yes it is downloaded i got the 3.1.13 version

    Saturday, March 20, 2021 10:32 PM
  • User1185448985 posted

    i've provided the logs i found . but i didn't know where is the problem. BTW I've published the same web application previously on Azure and it up and running. Now I'm trying to republish using IIS is the previous publishing may cause this problem ? should i disable or modify something from azure?

    Saturday, March 20, 2021 10:37 PM
  • User1312693872 posted

    Hi,Amani AI

    Your publishing to azure has no effect on publishing to iis, you can also view the related error messages in the Event Viewer.

    Best Regards,

    Jerry Cai

    Monday, March 22, 2021 5:58 AM
  • User1185448985 posted
    It turns out that the problem is that i didn't have a valid connection string in my appsetting.json

    My startup.cs file is invoking dbInitializer which requires a valid database connection i struggled finding the correct form for the connection string, this is the form if anyone needs it:

        "DefaultConnection": "Server=data.*************.rds.amazonaws.com;database=data;uid=*****;pwd=*****;"

    ps: my database is hosted by AWS

    Thank you all

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 30, 2021 12:03 AM