The application host helper service encountered an error trying to delete the history directory

Event ID 9009 — IIS Application Host History Configuration

Event ID 9009 — IIS Application Host History Configuration

Updated: January 20, 2010

Applies To: Windows Server 2008

The ApplicationHost Helper Service (AppHostSvc) maintains a history of Internet Information Services (IIS) configuration by saving the ApplicationHost.config file to separate configuration history subdirectories. If you make a mistake when you modify the ApplicationHost.config file, you can restore an earlier version of the file from a configuration history subdirectory by copying the earlier version into the %Windir%system32inetsrvconfig directory. You can specify the frequency with which AppHostSvc checks for configuration changes, the path of the directory that contains the subdirectories, and how many subdirectories to keep.

By default, the Application Host Helper Service checks for changes in the ApplicationHost.config file every two minutes. If it detects that the configuration has changed, it creates a backup. The default location for the configuration history files is %SystemDrive%inetpubhistory. AppHostSvc creates one subdirectory under this directory for each configuration file backup. By default, the maximum number of history subdirectories is 10. If the number of configuration history subdirectories reaches the maximum specified, the oldest subdirectory is deleted.

AppHostSvc is a runtime-independent service that does not require the Windows Process Activation Service (WAS) or the World Wide Web Publishing Service (W3SVC) to operate. AppHostSvc does not depend on any other service and its startup type is Automatic. If the ApplicationHost Helper Service is stopped, the configuration history feature will not work.

Event Details

Product: Internet Information Services
ID: 9009
Source: Microsoft-Windows-IIS-APPHOSTSVC
Version: 7.0
Symbolic Name: APPHOSTSVC_HISTORY_CANT_DELETE_DIRECTORY_WARNING
Message: The Application Host Helper Service encountered an error trying to delete the history directory ‘%1’. The directory will be skipped and ignored. Note that the directory may still get deleted in the future if the service restarts. The data field contains the error number.

Resolve
Stop and restart AppHostSvc

If the Application Host Helper Service (AppHostSvc) cannot delete a history directory, it will try to do so the next time that the service starts. Normally you do not have to take any action when this occurs. However, if the problem persists, you can stop and restart the service manually.

To perform this procedure, you must have membership in Administrators, or you must have been delegated the appropriate authority.

To stop and restart the Application Host Helper Service:

  1. Open an elevated Command Prompt window. Click Start, point to All Programs, click Accessories, right-click Command Prompt, and then click Run as administrator.
  2. At the command prompt, type net stop apphostsvc.
  3. At the command prompt, type net start apphostsvc.

Verify

To verify the configuration of the AppHostSvc configuration history backup feature, you can do the following:

  • Use notepad to examine the current configHistory section settings in the ApplicationHost.config file.
  • Use the Appcmd.exe command-line administration utility to view the configHistory section in the ApplicationHost.config file.

To perform these procedures, you must have membership in Administrators, or you must have been delegated the appropriate authority.

View the configHistory section by using notepad

To view the configHistory section by using notepad:

  1. Open an elevated Command Prompt window. Click Start, point to All Programs, click Accessories, right-click Command Prompt, and then click Run as administrator.
  2. Type cd %Windir%system32inetsrvconfig.
  3. Type notepad ApplicationHost.config.
  4. In notepad, search for the configHistory section under system.applicationHost. The contents should resemble the following:

    <system.applicationHost>

        <configHistory enabled=”true” path=”%SystemDrive%inetpubhistory” maxHistories=”10″ period=”00:02:00″ />

    </system.applicationHost>

View the configHistory section by using Appcmd.exe

To view the configHistory section by using Appcmd.exe:

  1. Open an elevated Command Prompt window. Click Start, point to All Programs, click Accessories, right-click Command Prompt, and then click Run as administrator.
  2. Type cd %Windir%system32inetsrv.
  3. Type appcmd list config “Default Web Site” /section:configHistory /config:*. (This example uses the default Web site; replace the site name as necessary.)

See Also

IIS 7.0: configHistory Element (IIS Settings Schema)

Related Management Information

IIS Application Host History Configuration

Internet Information Services (IIS) 7.0

Introduction

Suddenly this Monday, the PC hosting the bug tracker site jumped from Win10 1611 to 1709.

At the end of the upgrade process, the site was not available anymore.
IIS seemed up and running, but something occurred and put the site offline.

Looking at the event log, I saw swarms of the following errors:

Error 2307 – IIS-W3SVC-WP
The worker process for application pool ‘DefaultAppPool’ encountered an error ‘Cannot read configuration file’ trying to read configuration data from file ‘\?<EMPTY>’, line number ‘0’. The data field contains the error code.
Error 5002 – WAS
Application pool ‘DefaultAppPool’ is being automatically disabled due to a series of failures in the process(es) serving that application pool.
Error 5189 – WAS
The Windows Process Activation Service failed to generate an application pool config file for application pool ‘DefaultAppPool’. The error type is ‘5’. To resolve this issue, please ensure that the applicationhost.config file is correct and recommit the last configuration changes made. The data field contains the error number.
Error 5203 – WAS
A process serving application pool ‘DefaultAppPool’ reported a failure trying to read configuration during startup. The process id was ‘6240’. Please check the Application Event Log for further event messages logged by the worker process on the specific error. The data field contains the error number.
Warning 9009 – IIS-APPHOSTSVC
The Application Host Helper Service encountered an error trying to delete the history directory ‘C:inetpubhistoryCFGHISTORY_0000000012’. The directory will be skipped and ignored. Note that the directory may still get deleted in the future if the service restarts. The data field contains the error number.

‘DefaultAppPool’ is my IIS configuration, and it seemed to be correct.

The Resolution

After some investigation on the web, I found that it is a known problem and that it probably involves this folder:

C:inetpubtempappPoolsDefaultAppPool

I discovered that for unknown reasons, ‘DefaultAppPool’ was a corrupted shortcut into the ‘appPools’ folder.

To fix it, you need to:

  • open a Command Prompt with administrative access rights
  • stop IIS service
iisreset /stop
  • delete or rename ‘DefaultAppPool‘ shortcut.  If you tried to access to IIS site, this folder may be locked by some other system account.  To work around this, reboot and repeat the process without engaging IIS.
  • (optional) delete everything you can, from this folder:
C:inetpubhistory
  • reboot

In my case, IIS began working again.

Post Mortem Analysis

It seems that:

  • when the system starts, ‘C:inetpubtempappPoolsDefaultAppPool‘ isn’t present.
  • at the first site page request, ISS creates it
  • if an error occurs, it isn’t able to fix it by itself.

Post Views: 10,264

I working with .NET Core 2.0 application few months. Today I started creating .NET Core 2.1 application. On Visual studio everything working fine. The database, logging, services, file saving, everything. But after publish and deploy it on IIS server I get this error:

HTTP Error 502.5 - Process Failure

After open event viewer I found this tree errors:

The Application Host Helper Service encountered an error trying to delete the history directory 'C:inetpubhistoryCFGHISTORY_0000000100'.  The directory will be skipped and ignored.  Note that the directory may still get deleted in the future if the service restarts.  The data field contains the error number.
The Application Host Helper Service encountered an error trying to delete the history directory 'C:inetpubhistoryCFGHISTORY_0000000101schema'.  The directory will be skipped and ignored.  Note that the directory may still get deleted in the future if the service restarts.  The data field contains the error number.
The Application Host Helper Service encountered an error trying to delete the history directory 'C:inetpubhistoryCFGHISTORY_0000000101'.  The directory will be skipped and ignored.  Note that the directory may still get deleted in the future if the service restarts.  The data field contains the error number.

I looking for those directories and they do not exist.
For resolve this problem I tried these steps:

  • I restarted the IIS server.
  • I restarted Application host helper service.
  • I installed Runtime & Hosting Bundle 2.1.2.

But still the same problem. For first I trying resolve this problem on my IIS server on my PC because I have webhosting and there also not working. I can’t change permission. In my PC ofc, yes but not at webhosting server of the provider.

I have installed these nuget packages:

  • HtmlAgilityPack v1.8.5
  • Microsoft.AspNetCore.App v2.1.1
  • Microsoft.EntityFrameworkCore v.2.1.1
  • Microsoft.NetCore.App v2.1.0
  • Microsoft.VisualStudio.Web.CodeGeneration.Design v2.1.1
  • Serilog.AspNetCore v2.1.1
  • Serilog.Sinks.RollingFile v.3.1.0

Thank you for any advice.

Понравилась статья? Поделить с друзьями:
  • The application has encountered an error and has closed mx vs atv reflex
  • The application has encountered an error 0x800700a1
  • The application has encountered a critical error warcraft 3
  • The application has encountered a critical error 134
  • The application has encountered a critical error 132