The page cannot be displayed because an internal server error has occurred iis

I've just deployed an update to an existing ASP.NET MVC3 site (it was already configured) and I'm getting the IIS blue screen of death stating HTTP Error 500.0 - Internal Server Error The page

I’ve just deployed an update to an existing ASP.NET MVC3 site (it was already configured) and I’m getting the IIS blue screen of death stating

HTTP Error 500.0 — Internal Server Error
The page cannot be displayed because an internal server error has occurred.

However; there is nothing showing up in the Application Event Log where I would expect to see a (more) detailed description of the entry.

How can I go about diagnosing this issue?

asked Jul 15, 2012 at 21:25

Greg B's user avatar

Greg BGreg B

1,5585 gold badges17 silver badges32 bronze badges

1

Take a look at IIS7’s Failed Request Tracing feature:

Troubleshooting Failed Requests Using Tracing in IIS 7
Troubleshoot with Failed Request Tracing

The other thing I would do is tweak your <httpErrors> setting because IIS may be swallowing an error message from further up the pipeline:

<configuration>
  <system.webServer>
    <httpErrors existingResponse="PassThrough" />
  </system.webServer>
</configuration>

If the site is written in Classic ASP then be sure to turn on the Send Errors to Browser setting in the ASP configuration feature:

enter image description here

And finally, if you’re using Internet Explorer then make sure you’ve turned off Show friendly HTTP error messages in the Advanced settings (though I suspect you’ve done that already or are using a different browser).

answered Jul 15, 2012 at 22:10

Kev's user avatar

KevKev

7,79717 gold badges79 silver badges108 bronze badges

2

In my case:

  • The Event Log was empty.
  • web.config wasn’t corrupt — verified by using same on local machine / using inetmgr

Finally…

  • Checking IIS logs showed a request like this

...Chrome/57.0.2987.133+Safari/537.36 500 19 5 312

The key being:

sc-status sc-substatus sc-win32-status
500 19 5

which with some googling pointed me to the IIS_USRS not having read permissions to the www folder

answered May 16, 2017 at 23:25

fiat's user avatar

fiatfiat

77711 silver badges16 bronze badges

1

The most obvious issue is improper or zero NTFS rights on the web application folder. So make sure the account serving the site has the right permissions. Without proper NTFS rights to the web directory it doesn’t matter what you put in the web.config as it will never be read.

A quick check can be to give everyone full rights — if the site starts working then you know it’s a rights problem and you can then set about assigning appropriate rights to a more appropriate account.

answered Sep 10, 2016 at 22:33

rism's user avatar

rismrism

3012 silver badges12 bronze badges

If upgrading from IIS6, then it may be one of the the web.config works on 6, but not in IIS 7.5 … Double click on all the icons in IIS for the website and you may get an error about the format (Section must be below other section…)

answered May 13, 2013 at 22:11

M Hall's user avatar

I had the same problem with an Azure Web App. While debugging locally, error messages (JSON) returned from ajax calls were fully returned to the browser. But once deploy to the Web App, the messages were swallowed and i was returned a default 500 error message.
So I had to explicitly set the existingResponse value to PassThrough in the web.config httpErrors tag.

Andrew Urquhart's user avatar

answered Dec 23, 2015 at 8:45

Loul G.'s user avatar

I ran in this issue many times. 500 error from a ASP.NET 4.x website. No details in the eventLog and even the tracing above didn’t help. In my case it was caused by the fact that the web.config contains rewrite rules. So check your web.config if it has something like:

<system.webServer>
  <rewrite>
    <rules>
      ...
    </rules>
  </rewrite>
</system.webServer>

If it does, you need to install iis rewrite module:

https://www.iis.net/downloads/microsoft/url-rewrite

answered Dec 1, 2021 at 10:47

Maarten Kieft's user avatar

If your Internet Information Services (IIS) produces a 500 – Internal server error, your website is in serious trouble. Debugging an IIS 500 – Internal server error can take some time, so you’d better be prepared for the worst-case scenario. You don’t want to research how to deal with this error under time pressure.

Contents

  1. Cause of 500 – Internal server error
  2. Debugging an IIS 500 – Internal server error
  3. Resolving an IIS 500 – Internal server error
  4. Common 500.x substatus codes
  • Author
  • Recent Posts

Surender Kumar has more than twelve years of experience in server and network administration. His fields of interest are Windows Servers, Active Directory, PowerShell, web servers, networking, Linux, virtualization, and penetration testing. He loves writing for his blog.

Latest posts by Surender Kumar (see all)

  • Extending LVM space in Ubuntu — Thu, Feb 2 2023
  • Backup in Proxmox VE — Thu, Jan 26 2023
  • Snapshots in Proxmox VE — Wed, Jan 25 2023

In my previous posts, you learned about detailed errors and failed request tracing in IIS (Internet Information Server). I recommend reading those articles first before you proceed with this one.

Cause of 500 – Internal server error

This is the most common error you will encounter with any website hosted with IIS. In most cases, a developer messed up. Thus, the fastest way is often to simply reverse the last action taken, such as restoring an earlier version of your web application. Once your system is running again, you can investigate the cause of the error on your test side in peace.

500 Internal server error

500 Internal server error

The HTTP 500 error is a server-side error. While we understand that the problem is on the server end, the error is usually ambiguous. It doesn’t exactly tell the administrator what is wrong with the server. Thus, debugging a 500 – Internal server error often takes some time.

Debugging an IIS 500 – Internal server error

Since the above error doesn’t really tell what’s actually wrong with the server, we need to enable detailed errors, as discussed in my previous post. Once detailed errors are enabled, you will see more detailed error information, including an HTTP substatus code. Sometimes even the detailed errors don’t show any useful information right away. For example, see the following screenshot:

The page cannot be displayed because an internal server error has occurred

The page cannot be displayed because an internal server error has occurred

Here I am getting: The page cannot be displayed because an internal server error has occurred. There is no HTTP status code or substatus code listed on the error page. If you get such an error even when detailed errors are enabled, right-click anywhere in the browser window and select Inspect (or press F12).

Opening developer tools in web browser to reveal server errors

Opening developer tools in web browser to reveal server errors

This opens the developer tools in your browser window. Now, click the Console tab. The actual error thrown by the web server is displayed.

Viewing server errors using the Console tab of the web browser's developer tools

Viewing server errors using the Console tab of the web browser’s developer tools

To further understand the exact cause of 500 errors, enable Failed Request Tracing, as discussed in my previous post. Now, try to replicate the problem. If you can replicate it, open the newly generated XML log file in a web browser. The following screenshot shows the actual cause of a 500 – internal server error with a substatus code of 19 (HTTP 500.19 error):

Determining the cause of a 500 error using the Failed Request Tracing log file

Determining the cause of a 500 error using the Failed Request Tracing log file

Usually, substatus code 19 indicates that the configuration data is invalid. This could be due to some malformed or unidentified element in a server-level config file (ApplicationHost.config) or website-level config file (web.config). If you take a closer look at the ConfigExceptionInfo field of the log file, you will find the exact line number (6 in our case) in the web.config file that caused the exception. Now let’s take a look at the web.config file itself.

Viewing the problematic element in the web.config file

Viewing the problematic element in the web.config file

Here, you can see that the developer tried to add a mime type in the config file, but it was already defined in the server-level configuration file (i.e., ApplicationHost.config). Therefore, the Cannot add duplicate collection entry of type ‘mimeMap’ with unique key attribute ‘fileExtension’ set to ‘.mp4’ exception was returned. Furthermore, if there is some unidentified element, a syntax error, or even a typo in the web.config file, you will most likely get a similar error.

Resolving an IIS 500 – Internal server error

To resolve an IIS 500 – Internal server error, you could simply remove the line that is causing the exception. Alternatively, if you don’t want to remove this line for some reason, add the following code right above line 6 in web.config:

<remove fileExtension=".mp4" />

By doing this, you are essentially overriding the server-level element. In the end, your web.config file should look as shown below:

Overriding the server level mime element with web.config file

Overriding the server level mime element with web.config file

Now refresh the page, and the error should go away. This was just one example of resolving a 500.19 error. If you get a 500 error with a different substatus code, use the same approach to troubleshoot the problem.

Common 500.x substatus codes

The following table covers some of the most common HTTP 500 substatus codes, along with their probable causes and troubleshooting advice:

Subscribe to 4sysops newsletter!

Status Code Probable Cause Troubleshooting Advice
500.11 The application is shutting down on the web server The application pool is shutting down. You can wait for the worker process to finish the shutdown and then try again.
500.12 The application is busy restarting on the web server This is a temporary error and should go away automatically when you refresh the page. If the error persists, something is wrong with the web application itself.
500.13 The web server is too busy This error indicates that the number of incoming concurrent requests exceeded the number that your IIS application can process. This could be caused when the performance settings are not right. To troubleshoot such issues, a memory dump needs to be captured and analyzed using tools such as Debug Diagnostic.
500.15 Direct requests for Global.asax file are not allowed A direct request was made for the Global.asa or Global.asax file, which is not allowed by the web server
500.19 The configuration data is invalid We already covered how to fix this error above
500.21 The module not recognized This status code is caused by a partial installation of the IIS server, such as missing ISAPI modules. To fix this error, identify the missing IIS components and install them.

Once you troubleshoot the problem, don’t forget to disable Failed Request Tracing and revert the detailed errors to custom errors on your web server.

I’ve just deployed an update to an existing ASP.NET MVC3 site (it was already configured) and I’m getting the IIS blue screen of death stating

HTTP Error 500.0 — Internal Server Error
The page cannot be displayed because an internal server error has occurred.

However; there is nothing showing up in the Application Event Log where I would expect to see a (more) detailed description of the entry.

How can I go about diagnosing this issue?

asked Jul 15, 2012 at 21:25

Greg B's user avatar

Greg BGreg B

1,5585 gold badges17 silver badges32 bronze badges

1

Take a look at IIS7’s Failed Request Tracing feature:

Troubleshooting Failed Requests Using Tracing in IIS 7
Troubleshoot with Failed Request Tracing

The other thing I would do is tweak your <httpErrors> setting because IIS may be swallowing an error message from further up the pipeline:

<configuration>
  <system.webServer>
    <httpErrors existingResponse="PassThrough" />
  </system.webServer>
</configuration>

If the site is written in Classic ASP then be sure to turn on the Send Errors to Browser setting in the ASP configuration feature:

enter image description here

And finally, if you’re using Internet Explorer then make sure you’ve turned off Show friendly HTTP error messages in the Advanced settings (though I suspect you’ve done that already or are using a different browser).

answered Jul 15, 2012 at 22:10

Kev's user avatar

KevKev

7,79717 gold badges79 silver badges108 bronze badges

2

In my case:

  • The Event Log was empty.
  • web.config wasn’t corrupt — verified by using same on local machine / using inetmgr

Finally…

  • Checking IIS logs showed a request like this

...Chrome/57.0.2987.133+Safari/537.36 500 19 5 312

The key being:

sc-status sc-substatus sc-win32-status
500 19 5

which with some googling pointed me to the IIS_USRS not having read permissions to the www folder

answered May 16, 2017 at 23:25

fiat's user avatar

fiatfiat

77711 silver badges16 bronze badges

1

The most obvious issue is improper or zero NTFS rights on the web application folder. So make sure the account serving the site has the right permissions. Without proper NTFS rights to the web directory it doesn’t matter what you put in the web.config as it will never be read.

A quick check can be to give everyone full rights — if the site starts working then you know it’s a rights problem and you can then set about assigning appropriate rights to a more appropriate account.

answered Sep 10, 2016 at 22:33

rism's user avatar

rismrism

3012 silver badges12 bronze badges

If upgrading from IIS6, then it may be one of the the web.config works on 6, but not in IIS 7.5 … Double click on all the icons in IIS for the website and you may get an error about the format (Section must be below other section…)

answered May 13, 2013 at 22:11

M Hall's user avatar

I had the same problem with an Azure Web App. While debugging locally, error messages (JSON) returned from ajax calls were fully returned to the browser. But once deploy to the Web App, the messages were swallowed and i was returned a default 500 error message.
So I had to explicitly set the existingResponse value to PassThrough in the web.config httpErrors tag.

Andrew Urquhart's user avatar

answered Dec 23, 2015 at 8:45

Loul G.'s user avatar

I ran in this issue many times. 500 error from a ASP.NET 4.x website. No details in the eventLog and even the tracing above didn’t help. In my case it was caused by the fact that the web.config contains rewrite rules. So check your web.config if it has something like:

<system.webServer>
  <rewrite>
    <rules>
      ...
    </rules>
  </rewrite>
</system.webServer>

If it does, you need to install iis rewrite module:

https://www.iis.net/downloads/microsoft/url-rewrite

answered Dec 1, 2021 at 10:47

Maarten Kieft's user avatar

Мы описывали как настраивать веб-публикацию на IIS в инструкции.

Но после настройки веб-публикации при подключении к базе может возникать ошибка “Ошибка HTTP 500.0 — Internal Server Error”.

Если модуль был установлен с 32-битного клиента, то требуется это указать в пуле приложений. Для этого мы делаем следующую настройку:

  • Заходим в Панель управления → Администрирование → Диспетчер служб IIS.
  • Выбираем Пулы приложения которые задействованы в веб-публикации, в нашем случае DefaultAppPool.
  • Нажимаем ПКМ Дополнительные параметры.
  • В строке Разрешены 32-разрядные приложения мы указываем True как на Рисунке 1.
  • Нажимаем ОК.

главная страница

Рисунок 1 — Дополнительные параметры пула приложений

Если не сработало, есть следующие возможные решения:

  1. Убедитесь, что разрешения NTFS для файла web.config верны и обеспечивают доступ к учетной записи компьютера веб-сервера. Заходим в директорию, где размещена публикация (по умолчанию — C:inetpubwwwrootИМЯ_БАЗЫ). Нажимаем ПКМ на web.config → Свойства → Безопасность. Убедитесь в том, что у группы IIS_USERS есть права на чтение, выполнение, запись и изменение файла. Если нет — нажмите кнопку Изменить, в появившемся окне Добавить → Дополнительно и найдите в списке IIS_USERS. Добавьте эту группу и назначьте соответствующие права.
  2. Проверьте журналы событий, чтобы посмотреть, была ли зафиксирована какая-либо дополнительная информация. Открываем Выполнить (ПКМ на кнопку меню пуск или сочетанием клавиш Win+R), вводим “eventvwr.msc”, нажимаем Enter. Возможно, журнал даст подсказку какой компонент может сбоить.
  3. Переустановите компонент IIS на сервере. В диспетчере серверов удалите роль Веб-сервера IIS, перезагрузите сервер, а затем установите заново через оснастку Добавить роли и компоненты.
  4. Установите компонент расширения .NET, если запрос сопоставлен управляемому обработчику.

В Windows Server 2012 и младше: заходим в Диспетчер серверов → Добавить роли и компоненты → Роли сервера → Веб-сервер (IIS) → Веб-сервер → Разработка приложений → Расширяемость .NET. Далее идём далее по указаниям системы.

После применения настроек, мы можем подключаться к настроенной веб-публикации без ошибок.

Нужна готовая настройка веб-доступа к 1С? Попробуйте наш сервер 1С в аренду, в услугу включены все настройки и обслуживание.

This is another common error that troubles a lot of ASP.NET users.

Problem Statement

Generally, the questions are framed like:

I receive a HTTP 500 – Internal Server Error  exception while trying to browse my hosted web application. Exception message says “This error (HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying”. Please help, how to resolve it?

Assessment

Any HTTP request made to web application running on IIS (or any other web server) returns the status of the response. This HTTP status code indicates about the request success or failure. If the request was unsuccessful, it might provide the reason why so.

Out of various status code, 5xx are the codes related to Server error. They indicate that the server failed to complete the request because server encountered an error.

The 500 Internal Server Error is a very general HTTP status code. It means something has gone wrong on the website and web server is unable to specify what exactly, thus failing in fulfilling the request made by the client. This is not related to client and the fault is in the webpage/website requested that resides on server. This status code can be considered as a ‘catch-all’ server error of Web server.

More details around various HTTP status code: The HTTP status code in IIS 7.0, IIS 7.5, and IIS 8.0

Possible Resolutions

Make sure that internally web server maintains some kind of internal error logs that gives more detail of what went wrong and thus help in diagnosing the issue. Generally, it is logged into Windows Event Logs on the server. Thus, first thing while troubleshooting the error is to see Windows Event Logs on the server to find what went wrong.

Other useful thing to troubleshoot it would be to disable friendly HTTP error messages to see if the raw content can provide a direction to look more. Steps:

  • Go to menu Tools/Internet Options in your IE.
  • Click on the Advanced tab & then uncheck “Show friendly HTTP error messages” option & then click Ok.
  • Now, when on accessing the same web page, much more developer meaningful error message will be shown.

Moving on, following are most common:

Option #1:
HRESULT: 0x80070035 – The page cannot be displayed because an internal server error has occurred.
This occurs because the server that is running IIS cannot access the configured root directory of the requested location.

Resolution would be to make sure that the server that is running IIS can access the configured root directory of the requested location.

Option #2:
HRESULT: 0x800700c1 – The page cannot be displayed because an internal server error has occurred.
This occurs because a script mapping is not valid.

Resolution would be to make sure that the script mapping points to the ISAPI.dll file that can process the request.
To do this, follow these steps:

  1. Click Start, click Run, type inetmgr.exe, and then click OK.
  2. In IIS Manager, expand server name, expand Web sites, and then click the Web site that you want to modify.
  3. In Features view, double-click Handler Mappings.
  4. Make sure that the script mapping points to the correct ISAPI.dll file. (e.g: .asp files should map to the %windir%system32inetsrvasp.dll file)

Option #3:
HRESULT: 0x8007007f – There is a problem with the resource you are looking for, so it cannot be displayed.
This occurs because the handler mapping for the requested resource points to a .dll file that cannot process the request.

Resolution would be to edit the handler mapping for the requested resource to point to the .dll file that can process the request.
To do this, follow these steps:

  1. Click Start, click Run, type inetmgr.exe, and then click OK.
  2. In IIS Manager, expand server name, expand Web sites, and then click the Web site that you want to modify.
  3. In Features view, double-click Handler Mappings.
  4. Right-click the script mapping that you want to edit, and then click Edit.
  5. In the Edit Script Map dialog box, type the appropriate executable file in the Executable box, and then click OK.

Option #4:
One of the other possibilities could be an issue in the way web application is hosted. Some security configuration issue or conflict due to multiple config files.

Resolution would be to make sure application is hosted correctly by published the application as website and setting up the virtual directory as needed.
More details around the known issues and their resolution:
Error message when you visit a Web site that is hosted on IIS 7.0: “HTTP Error 500.0 – Internal Server Error”
Troubleshoot an “HTTP 500 – Internal Server Error” error message on IIS 4.0 or on IIS 5.0

Conclusion

This is a server error and can only be solved by website admin who has access to files and the web-server. There can be one of/or multiple reasons to get this error. One has to track down the issue and handle accordingly.

Keep learning!

Понравилась статья? Поделить с друзьями:
  • The outer worlds как изменить показатели
  • The installer has encountered an unexpected error 2503 2502
  • The installer has encountered an unexpected error 2203 что делать
  • The long dark как изменить уровень сложности
  • The logo should be of single color bmp как исправить