microsoft / IIS.ServiceMonitor

An entrypoint process for running IIS in Windows containers
MIT License
127 stars 41 forks source link

4.8-20201013-windowsservercore-1909 image doesn't start #75

Open MichaelSimons opened 3 years ago

MichaelSimons commented 3 years ago

@dasiths commented on Mon Nov 09 2020

The W3SVC doesn't start on the 4.8-windowsservercore-1909 image

I'm trying to run the image using docker run but keep running in to this error.

PS C:\Users\Administrator> docker run mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-1909                                           
 Service 'w3svc' has been stopped

ERROR: Failed to start or query status of service 'w3svc' error [80004005]

 Service 'w3svc' has been stopped

When defining the port it fails with a slightly different error

PS C:\Users\Administrator> docker run mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-1909 -p:80:8080                                
 Service 'w3svc' has been stopped

APPCMD failed with error code 4312

Failed to update IIS configuration

I also tried to create my own dockerfile from this image. In the build steps I tried calling

Start-Service W3SVC

which failed with

Service 'World Wide Web Publishing Service (W3SVC)' cannot be started due to the following error: Cannot start service W3SVC on computer '.'.

Then I tried doing this

docker run -it --rm --entrypoint powershell mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-1909

and when inside the container ran following commands to start w3svc with no success as well.

PS C:\> start-service w3svc
start-service : Service 'World Wide Web Publishing Service (w3svc)' cannot be started due to the following error:
Cannot start service w3svc on computer '.'.
At line:1 char:1
+ start-service w3svc
+ ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
   ServiceCommandException
    + FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand

PS C:\> net start w3svc
System error 1068 has occurred.

The dependency service or group failed to start.

Steps to Reproduce

docker pull mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-1909
docker run mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-1909

Other Information

Output of docker version

PS C:\Users\Administrator> docker version                                                                                                            Client: Docker Engine - Enterprise
 Version:           19.03.5
 API version:       1.40
 Go version:        go1.12.12
 Git commit:        2ee0c57608
 Built:             11/13/2019 08:00:16
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Enterprise
 Engine:
  Version:          19.03.5
  API version:      1.40 (minimum version 1.24)
  Go version:       go1.12.12
  Git commit:       2ee0c57608
  Built:            11/13/2019 07:58:51
  OS/Arch:          windows/amd64
  Experimental:     false

Output of docker info

PS C:\Users\Administrator> docker info 
 Client:
 Debug Mode: false
 Plugins:
  cluster: Manage Docker clusters (Docker Inc., v1.2.0)

Server:
 Containers: 10
  Running: 0
  Paused: 0
  Stopped: 10
 Images: 275
 Server Version: 19.03.5
 Storage Driver: windowsfilter
  Windows:
 Logging Driver: json-file
 Plugins:
  Volume: local
  Network: ics internal l2bridge l2tunnel nat null overlay private transparent
  Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
 Swarm: inactive
 Default Isolation: process
 Kernel Version: 10.0 18363 (18362.1.amd64fre.19h1_release.190318-1202)
 Operating System: Windows Server Datacenter Version 1909 (OS Build 18363.836)
 OSType: windows
 Architecture: x86_64
 CPUs: 4
 Total Memory: 16GiB
 Name: IP-0A9D15BF
 ID: 3KVH:ECXF:6ALL:XNFM:CDKW:APWQ:RJW3:RVQE:3VP2:MS4N:JH76:RG3A
 Docker Root Dir: C:\ProgramData\docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

@MichaelSimons commented on Mon Nov 09 2020

@HongGit - Can you help out with this issue?


@dasiths commented on Mon Nov 09 2020

it's possibly related to https://github.com/microsoft/IIS.ServiceMonitor/issues/34


@dasiths commented on Mon Nov 09 2020

I've just checked the same image on a Windows 10 pro machine with 2004 kernel version and it works. So it's tied to the Windows Data Centre version I tried before.

Here is the environment it fails in. It's running in an AWS EC2 instance.

PS C:\Users\Administrator> [System.Environment]::OSVersion.Version

Major  Minor  Build  Revision
-----  -----  -----  --------
10     0      18363  0

PS C:\Users\Administrator> (Get-WmiObject -class Win32_OperatingSystem).Caption
Microsoft Windows Server Datacenter
PS C:\Users\Administrator> systeminfo /fo csv | ConvertFrom-Csv | select OS*, System*, Hotfix* | Format-List

OS Name             : Microsoft Windows Server Datacenter
OS Version          : 10.0.18363 N/A Build 18363
OS Manufacturer     : Microsoft Corporation
OS Configuration    : Standalone Server
OS Build Type       : Multiprocessor Free
System Boot Time    : 11/9/2020, 10:00:54 AM
System Manufacturer : Xen
System Model        : HVM domU
System Type         : x64-based PC
System Directory    : C:\Windows\system32
System Locale       : en-us;English (United States)
Hotfix(s)           : 10 Hotfix(s) Installed.,[01]: KB4552931,[02]: KB4497165,[03]: KB4513661,[04]: KB4517245,[05]:
                      KB4521863,[06]: KB4524569,[07]: KB4528759,[08]: KB4541338,[09]: KB4552152,[10]: KB4556799

PS C:\Users\Administrator> docker run -it --rm --entrypoint powershell mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-1909
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\> get-iissite

Name             ID   State      Physical Path                  Bindings
----             --   -----      -------------                  --------
Default Web Site 1    Stopped    %SystemDrive%\inetpub\wwwroot  http *:80:

PS C:\> start-iissite "default web site"
start-iissite : The World Wide Web Publishing Service (W3SVC) is stopped. Websites cannot be started unless the World
Wide Web Publishing Service (W3SVC) is running.
At line:1 char:1
+ start-iissite "default web site"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Start-IISSite], ServerManagerException
    + FullyQualifiedErrorId : Microsoft.Web.Administration.ServerManagerException,Microsoft.IIS.Powershell.Commands.St
   artIISSiteCommand

PS C:\> net start w3svc
System error 1068 has occurred.

The dependency service or group failed to start.

@MichaelSimons commented on Tue Nov 10 2020

@dasiths - did you try the workaround mentioned here?

@shirhatti, I'm transferring this to IIS as this seems related to microsoft/IIS.ServiceMonitor#34.

dasiths commented 3 years ago

That work around mentioned there only applies to ECS. All the error logs mentioned above are from me trying to run it on an EC2 instance using Docker. No orchestration platform is involved.

chadmyers commented 7 months ago

I can't get the images to run either unless I do not pass in any port binding or environment variables, but then the container is largely useless.

https://github.com/microsoft/dotnet-framework-docker/issues/1111

How does anyone get these containers to work? It looks like some people are getting them to work, but for me on my Windows 11 laptop, they just fail immediately. What am I missing?