acs-engine icon indicating copy to clipboard operation
acs-engine copied to clipboard

Windows Node UNEXPECTED_KERNEL_MODE_TRAP vfpext.sys

Open y325A opened this issue 8 years ago • 19 comments

Is this a request for help?: Yes


Is this an ISSUE or FEATURE REQUEST? (choose one): Issue


What version of acs-engine?: 0.21.1


Orchestrator and version (e.g. Kubernetes, DC/OS, Swarm) K8s 1.10.7 Windows Server 2016 17134

What happened: Blue screen of death OS crash when scheduling a large number of pods simultaneously.

Your PC ran into a problem and needs to restart.
If you call a support person, give them this info:
UNEXPECTED_KERNEL_MODE_TRAP

vfpext.sys

0x0000000000000008
0xFFFFAD8068589EF0
0xFFFFC2057182AFA0
0xFFFFF80F422CA66F

How to reproduce it (as minimally and precisely as possible): ACS template and Dockerfiles below. It only appears to happen with this particular Dockerfile below (which seems weird, I have other Dockerfiles that don't cause crashes). Scale deployment up to 10 replicas and wait for crash.

{
    "apiVersion": "vlabs",
    "properties": {
        "orchestratorProfile": {
            "orchestratorType": "Kubernetes",
            "orchestratorRelease": "1.10",
            "kubernetesConfig": {
                "addons": [
                    {
                        "name": "kubernetes-dashboard",
                        "enabled": false
                    }
                ],
                "apiServerConfig": {
                    "--token-auth-file": "/etc/kubernetes/token.csv"
                }
            }
        },
        "masterProfile": {
            "count": 1,
            "dnsPrefix": "",
            "vmSize": "Standard_B2ms",
            "customFiles": [
                {
                    "source": "",
                    "dest": "/etc/kubernetes/token.csv"
                }
            ]
        },
        "agentPoolProfiles": [
            {
                "name": "windowspool",
                "count": 1,
                "vmSize": "Standard_B2ms",
                "availabilityProfile": "AvailabilitySet",
                "osType": "Windows",
                "osDiskSizeGB": 127,
                "storageProfile": "StorageAccount"
            }
        ],
        "windowsProfile": {
            "adminUsername": "",
            "adminPassword": "",
            "windowsPublisher": "MicrosoftWindowsServer",
            "windowsOffer": "WindowsServerSemiAnnual",
            "windowsSku": "Datacenter-Core-1803-with-Containers-smalldisk"
        },
        "linuxProfile": {
            "adminUsername": "",
            "ssh": {
                "publicKeys": [
                    {
                        "keyData": ""
                    }
                ]
            }
        },
        "servicePrincipalProfile": {
            "clientId": "",
            "secret": ""
        }
    }
}

Base Dockerfile:

FROM microsoft/dotnet-framework@sha256:c2586af354bc76c2f431e3d6584bd38c277b896a6a5b07dc0042b4ff7480956f

RUN powershell -Command \
    New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters -Name MaxNegativeCacheTtl -PropertyType DWord -Value 0

COPY ./helpers /helpers

App Dockerfile:

ARG REGISTRY

FROM ${REGISTRY}/**my image and tag derived from above Dockerfile**

ARG CONFIGURATION

ENTRYPOINT powershell.exe C:\helpers\install-certs.ps1 && C:\application\myapp.exe

COPY ./bin/${CONFIGURATION} /application

Anything else we need to know: I have a QA env where I can fairly reliably repro the issue if anyone wants me to test anything.

y325A avatar Sep 05 '18 10:09 y325A

This is fixed in an update that's not part of the VM yet. You can work around it using this in your apimodel:

{
  "apiVersion": "vlabs",
  "properties": {
    "orchestratorProfile": {
      "orchestratorType": "Kubernetes",
      "orchestratorRelease": "1.11"
    },
    "masterProfile": {
      "count": 1,
      "dnsPrefix": "plang0607a",
      "vmSize": "Standard_D2_v3"
    },
    "agentPoolProfiles": [
	    {
		"name": "windowspool",
		"count": 2,
		"vmSize": "Standard_D2_v3",
		"availabilityProfile": "AvailabilitySet",
		"osType": "Windows",
		"osDiskSizeGB": 127,
		"extensions": [
	    {
			"name": "windows-patches"
		    }
		]
	    },
	    {
		"name": "linuxpool",
		"count": 2,
		"vmSize": "Standard_D2_v2",
		"availabilityProfile": "AvailabilitySet",
		"osType": "Linux"
	    }
    ],
    "windowsProfile": {
	    "adminUsername": "",
	    "adminPassword": "",
	    "windowsPublisher": "MicrosoftWindowsServer",
	    "windowsOffer": "WindowsServerSemiAnnual",
	    "windowsSku": "Datacenter-Core-1803-with-Containers-smalldisk"
     },
    "extensionProfiles": [
          {
	    "name": "windows-patches",
	    "version": "v1",
            "extensionParameters": "'http://download.windowsupdate.com/c/msdownload/update/software/updt/2018/08/windows10.0-kb4346783-x64_145555faf4e3e494c20f22508f9c28fe12af387a.msu'"
    }
    ],
    "linuxProfile": {
      "adminUsername": "azureuser",
      "ssh": {
        "publicKeys": [
          {
            "keyData": ""
          }
        ]
      }
    },
    "servicePrincipalProfile": {
      "clientId": "",
      "secret": ""
    }
  }
}

PatrickLang avatar Sep 05 '18 17:09 PatrickLang

If that doesn't work - please open a support ticket and they can provide a private patch.

cc @daschott

PatrickLang avatar Sep 05 '18 17:09 PatrickLang

Hi @PatrickLang ,

I have had the same issue today. To apply your suggestion above do I need to completely delete the cluster and deploy a new one or is there some other process to this?

Thanks for your help

tonyschollum avatar Sep 21 '18 08:09 tonyschollum

@tonyschollum you need to open a support ticket with Microsoft/Azure, else there should be a public KB coming out soon (no earlier than mid-November unfortunately.) Will loop back here once it is posted.

Either option does not require you to delete your cluster. You will be required to install an update and reboot each one of your nodes however. If you have a new cluster you are trying to create, you can also apply the patches automatically using Windows Patching Extension

daschott avatar Sep 21 '18 18:09 daschott

If you have a fix from Microsoft support, you can follow the steps here to get access to your existing nodes with Remote Desktop. Then you can post the fix in a storage account, download and install it on the Windows nodes

https://github.com/Azure/acs-engine/blob/master/docs/kubernetes/troubleshooting.md#connecting-to-windows-nodes

Using the Windows patching extension is definitely easier for new clusters.

PatrickLang avatar Sep 21 '18 20:09 PatrickLang

Hey @PatrickLang so I tried to launch a new cluster with the patch and the CSE extension failed to apply.

Deployment failed. Correlation ID: 199ec4cb-75eb-487d-8a95-564419a31e38. {
  "status": "Failed",
  "error": {
    "code": "ResourceDeploymentFailure",
    "message": "The resource operation completed with terminal provisioning state 'Failed'.",
    "details": [
      {
        "code": "DeploymentFailed",
        "message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.",
        "details": [
          {
            "code": "Conflict",
            "message": "{\r\n  \"status\": \"Failed\",\r\n  \"error\": {\r\n    \"code\": \"ResourceDeploymentFailure\",\r\n    \"message\": \"The resource operation completed with terminal provisioning state 'Failed'.\",\r\n    \"details\": [\r\n      {\r\n        \"code\": \"VMExtensionProvisioningError\",\r\n        \"message\": \"VM has reported a failure when processing extension'cse-agent-0'. Error message: \\\"Finished executing command\\\".\"\r\n      }\r\n    ]\r\n  }\r\n}"
          }
        ]
      }
    ]
  }
}
[
    {
        "code": "ComponentStatus/StdOut/succeeded",
        "level": "Info",
        "displayStatus": "Provisioning succeeded",
        "message": "Processing http://download.windowsupdate.com/c/msdownload/update/software/updt/2018/08/windows10.0-kb4346783-x64_145555faf4e3e494c20f22508f9c28fe12af387a.msu\\nDownloading http://download.windowsupdate.com/c/msdownload/update/software/updt/2018/08/windows10.0-kb4346783-x64_145555faf4e3e494c20f22508f9c28fe12af387a.msu\\nInstalling "
    },
    {
        "code": "ComponentStatus/StdErr/succeeded",
        "level": "Info",
        "displayStatus": "Provisioning succeeded",
        "message": "C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.9.2\\Downloads\\1\\installPatches.ps1 : Error running \\nC:\\Windows\\TEMP\\windows10.0-kb4346783-x64_145555faf4e3e494c20f22508f9c28fe12af387a.msu, exitcode -2145124329\\nAt line:1 char:1\\n+ & ./installPatches.ps1 -URIs 'http://download.windowsupdate.com/c/msd ...\\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\\n    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException\\n    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,installPatches.ps1\\n "
    }
]

Do you know if this patch will also address: https://github.com/Azure/acs-engine/issues/4046?

Also is it possible to get instructions to apply this manually? I can already ssh + rdp to my windows node just not sure how to manually apply the msu file.

sylus avatar Nov 26 '18 17:11 sylus

@sylus here are some sample instructions. In theory all you need to do is run the .msu and reboot, but if you want to be more thorough: 1. Clean up any affected Kubernetes deployments 2. bcdedit /set testsigning on 3. Install package (ie just execute it) 4. Reboot + redeploy Kubernetes deployments

daschott avatar Nov 26 '18 18:11 daschott

Ah yeah unfortunately the msu doesn't successfully install but thanks for the help.

I did notice that Datacenter-Core-1809-with-Containers-smalldisk is now on the list of published images and is the equivalent build of Windows 2019. Thinking this would have the fix?

Only issue currently against that SKU is:

Events:
  Type     Reason                  Age               From                   Message
  ----     ------                  ----              ----                   -------
  Normal   Scheduled               5m                default-scheduler      Successfully assigned default/ndmdotnet-admintool-5fb787d6f6-zws7l to 16822k8s9010
  Warning  FailedCreatePodSandBox  3s (x24 over 5m)  kubelet, 16822k8s9010  Failed create pod sandbox: rpc error: code = Unknown desc = failed pulling image "kubletwin/pause": Error response from daemon: repository kubletwin/pause not found: does not exist or no pull access

sylus avatar Nov 27 '18 05:11 sylus

No, this issue still persists on Windows Server 1809 until a hotfix is released (ETA late January). The official hotfix is available now for WS1803: https://support.microsoft.com/en-us/help/4467682/windows-10-update-kb4467682 Can you try it? What errors are you seeing?

For DataCenter-Core-1809, you are correct I also noticed an issue in acs-engine because of the move to the new container registry. You need to build kubletwin/pause image by editing the Dockerfile in C:\k to annotate the mcr.microsoft.com/windows/nanoserver:1809 image and build it as docker build -t kubletwin/pause .

Once you move to azure-CNI 1.0.14, please also double-check that the service CIDR in the 10-azure.conflist isn't set to 10.0.0.0/8 but 10.0.0.0/16. You can check the service CIDR using kubectl cluster-info dump | grep -i service-cluster-ip-range

If you're still having trouble with DNS, one workaround is to remove the entry for the 163.x.y.z nameserver. For some reason it isn't reaching it on my cluster. I'm not from the Azure networking team but I found that worked for all the typical networking flows then.

daschott avatar Nov 27 '18 20:11 daschott

@y325A can you also please use https://support.microsoft.com/en-us/help/4467682/windows-10-update-kb4467682 and confirm whether the issue is resolved?

daschott avatar Nov 27 '18 20:11 daschott

@daschott thanks so much for your guidance just out of curiousity I was looking at the changelog for https://support.microsoft.com/en-us/help/4467682/windows-10-update-kb4467682 do you know which line in particular talks about this problem as don't see it listed.

sylus avatar Nov 27 '18 21:11 sylus

I don't think it's explicitly written there, the changelogs aren't exhaustive and don't always reflect all the fixes unfortunately... But looking at the bug this is the official KB article that contains a complete patch for the BSoD referenced by @y325A here.

daschott avatar Nov 27 '18 22:11 daschott

Ah @daschott your awesome, the msu you referenced does work at least so far and haven't seen the issue for the past hour or so, going to leave on overnight and test. Appreciate you taking the time :D

sylus avatar Nov 28 '18 04:11 sylus

Hey @daschott I think acs-engine now defaults to 1809 so to be able to apply the patch since for 1809 won't be available for a month, should I just revert the generated azuredeploy to call the older 1803 image?

sylus avatar Dec 05 '18 19:12 sylus

Hey @daschott @PatrickLang the update msi patch is no longer hosted. Do you know how I can get this update again? Not sure why it was removed.

sylus avatar Dec 10 '18 16:12 sylus

@sylus, yes it seems like the KB was pulled down because there were some other changes included in the package which introduced regressions. Can you use the new 12B release, it should contain all the fixes from the previous KB without regressions: https://support.microsoft.com/en-us/help/4471324

daschott avatar Dec 11 '18 23:12 daschott

Ah thanks so much @daschott your awesome :)

sylus avatar Dec 12 '18 02:12 sylus

Alright, closing since https://support.microsoft.com/en-us/help/4471324/windows-10-update-kb4471324 is released.

PatrickLang avatar Dec 18 '18 21:12 PatrickLang

For WS2019, this should come out on 01/29 as KB4476976.

daschott avatar Jan 11 '19 21:01 daschott