IIS.ServiceMonitor: Intermittent errors with HRESULT 800705b4

We’re running into errors with our Docker images that are using ServiceMonitor.exe as an ENTRYPOINT. The last thing in the Docker logs is:

ERROR: Failed to stop or query status of service 'w3svc' error [800705b4]

Any ideas what would cause this? Is there a suggested work around?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (3 by maintainers)

Most upvoted comments

ServiceMonitor stops w3svc service first to update applicationhost config with the environmental variables first and then restart the service. When container starts, it also starts the all services. There could be a timing issue that entry program (stopping service) was executed before Service started. To work around it, you can reset w3svc start type to manual in docker file, i.e., sc config w3svc start=demand. This will even save container start time.

Ok, I corrected the service name - my hurried mistake. This works thanks so much for the help! Code below to help the next person Docker file:

FROM mcr.microsoft.com/dotnet/framework/aspnet:4.7.2-windowsservercore-ltsc2019 AS base WORKDIR /inetpub/wwwroot EXPOSE 80

FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2-windowsservercore-ltsc2019 AS build WORKDIR /app

COPY . . RUN nuget restore ./Website.csproj -SolutionDirectory ./…

RUN msbuild ./Website.csproj /p:Configuration=Release /p:DebugSymbols=false /p:DebugType=None /p:DeployOnBuild=true /p:PublishProfile=FolderProfile.pubxml

FROM base as runtime ARG source COPY --from=build /app/bin/Release/Publish/. ./

RUN powershell -Command Set-Service -Name w3svc -StartupType ‘Manual’

COPY docker-entrypoint.ps1 / ENTRYPOINT powershell -File C:\docker-entrypoint.ps1

Entry Point.ps1

Set-ItemProperty Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters -Name AllowRemoteConnection -Value 1 Get-Service aspnet_state | Start-Service

C:\ServiceMonitor.exe w3svc