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

VM has reported a failure when processing extension 'cse0'

Open IvanCaro opened this issue 9 years ago • 97 comments

Is this a request for help?:


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

What version of acs-engine?: Version: canary GitCommit: 8db990ba GitTreeState: clean

Orchestrator and version (e.g. Kubernetes, DC/OS, Swarm) Kubernetes

What happened: { "status": "Failed", "error": { "code": "ResourceDeploymentFailure", "message": "The resource operation completed with terminal provisioning state 'Failed'.", "details": [ { "code": "VMExtensionProvisioningError", "message": "VM has reported a failure when processing extension 'cse0'. Error message: "Enable failed: failed to execute command: command terminated with exit status=5\n[stdout]\n\n[stderr]\nstat: cannot stat '/opt/azure/containers/provision.complete': No such file or directory\n"." }

What you expected to happen: { "status": "Failed", "error": { "code": "ResourceDeploymentFailure", "message": "The resource operation completed with terminal provisioning state 'Failed'.", "details": [ { "code": "VMExtensionProvisioningError", "message": "VM has reported a failure when processing extension 'cse0'. Error message: "Enable failed: failed to execute command: command terminated with exit status=5\n[stdout]\n\n[stderr]\nstat: cannot stat '/opt/azure/containers/provision.complete': No such file or directory\n"." }

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know:

IvanCaro avatar Nov 21 '17 01:11 IvanCaro

@IvanCaro could you paste the api model that you passed as input to acs-engine?

@JackQuincy I wonder if cse has an non-idiomatic execution context for this change in some cases:

https://github.com/Azure/acs-engine/commit/b5eb43b47f17d8db54ba9bfcd2a9c07bda3e6582#diff-95c1c34f292e829cdcc06906aaf5c4f1

Does it make sense that a stat failure like the above would ever short-circuit as currently implemented?

jackfrancis avatar Nov 21 '17 20:11 jackfrancis

Only reason I could see this failing is if we called set -x or something of the sort earlier in the line/command which would be in parameters common etc.

JackQuincy avatar Nov 21 '17 22:11 JackQuincy

@JackQuincy I can reproduce consistently when specifying "orchestratorRelease": "1.6". @IvanCaro Were you attempting to build a 1.6 cluster when you received this error?

jackfrancis avatar Nov 21 '17 22:11 jackfrancis

hey @jackfrancis this happened with customVnet and DNS Servers, i created the cluster without DNS (i used azure provider) and after i changed (this works).

IvanCaro avatar Nov 22 '17 18:11 IvanCaro

@jackfrancis @JackQuincy Even I have faced this issue before and when I change the location and redeploy it worked. This issue is not consistent and its not happening all time.

tamilmani1989 avatar Dec 01 '17 18:12 tamilmani1989

@IvanCaro Do you agree this is an indeterminate, ephemeral issue and we should close this?

jackfrancis avatar Dec 01 '17 20:12 jackfrancis

Same issue here using Kubernetes 1.6 as an orchestrator and customVnet. Is there a workaround for this?

Update: I had to add maxPods value into the api model, otherwise the value would be empty and prevent the kubelet from starting.

mpluhar avatar Jan 08 '18 23:01 mpluhar

I found that I was having this because my nodes (master and agents) were not able to hit the k8s.gcr.io to download kubectl. I discovered this by logging into the master and looking at /var/log/cluster-provision.log, which ended with:

+ echo 'kubernetes did not start'
kubernetes did not start
+ exit 3

I traced this back to here - https://github.com/Azure/acs-engine/edit/master/parts/k8s/kubernetesmastercustomscript.sh#L571

This indicated it was having trouble running kubectl, so I tried invoking it from the ssh terminal. Low and behold - command not found. That file lead me to the fact that it's installed using a service called kubectl-extract. Looking at its logs using sudo journalctl -n -u kubectl-extract I found the following output:

Jan 17 05:16:15 k8s-master-42756516-0 systemd[1]: Failed to start Kubectl extraction.
Jan 17 05:16:15 k8s-master-42756516-0 systemd[1]: kubectl-extract.service: Unit entered failed state.
Jan 17 05:16:15 k8s-master-42756516-0 systemd[1]: kubectl-extract.service: Failed with result 'exit-code'.
Jan 17 05:16:20 k8s-master-42756516-0 systemd[1]: kubectl-extract.service: Service hold-off time over, scheduling restart.
Jan 17 05:16:20 k8s-master-42756516-0 systemd[1]: Stopped Kubectl extraction.
Jan 17 05:16:20 k8s-master-42756516-0 systemd[1]: Starting Kubectl extraction...
Jan 17 05:16:35 k8s-master-42756516-0 docker[45966]: Error response from daemon: Get https://k8s-gcrio.azureedge.net/v2/hyperkube-amd64/manifests/v1.7.9: Get https://k8s.gcr.io/v2/token?scope=repository%3Ahyperkube-amd64%3Apull&service=k8s.gcr.io: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
Jan 17 05:16:35 k8s-master-42756516-0 systemd[1]: kubectl-extract.service: Control process exited, code=exited status=1

So there was a problem downloading kubectl from k8s.gcr.io. Turns out it was a DNS problem, but that's just my network... Hope this helps someone debug a related issue.

ducas avatar Jan 19 '18 05:01 ducas

I ran into this as well. It failed when ran in westus2. I changed to eastus and it worked

jsturtevant avatar Jan 23 '18 22:01 jsturtevant

I'm having same issues when deploying to custom VNET on WestEurope using acs-engine 0.12.4 and Kubernetes 1.9.1. I've backuped all logs from /var/log/azure & /var/log/containers if it can help.

nakah avatar Jan 25 '18 14:01 nakah

Just to acknowledge this. I get the exact same thing, custom VNET in West Europe, North Europe works just fine.

Update: This is flaky somehow, now I can't deploy without custom VNET without it getting stuck on the extension for the master node. It's a mixed cluster with windows and Linux agent pools. This is a setup that worked last week. Taking the exact same output from acs-engine and deploying it to North Europe works fine.

msorby avatar Jan 30 '18 00:01 msorby

I got the same error and the problem was the DNS resolution at the VNET. After I fixed my custom DNS servers to resolve internet names everything worked fine.

rodrigoffonseca avatar Jan 30 '18 18:01 rodrigoffonseca

I'm getting this error with or without custom VNET. I get it from the simplest of configurations in West Europe, then I deploy the same generated arm template to North Europe and it works. It's related to this I'm guessing, https://github.com/Azure/acs-engine/issues/2162.

And here is the build from a pull request with a potential fix that still failed, https://circleci.com/gh/Azure/acs-engine/14298?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

//Morten

msorby avatar Jan 30 '18 19:01 msorby

cse* errors generally are a result of the provisioning process on the host failing. I'd like to keep this ticket open to encourage folks to share (bad) experiences. We're working on (1) improving logging around this and (2) hunting down transient errors (such as lack of DNS access would incur) and try, where appropriate, to introduce add'l resilience.

jackfrancis avatar Feb 02 '18 23:02 jackfrancis

also met same problem in eastus. cse0 timed out and the master VM can't ssh

feiskyer avatar Feb 03 '18 00:02 feiskyer

Just identified one cause of transient cse errors (DNS availability race condition on cluster provisioning), added some retry resiliency and am hoping that eliminates that symptom. @feiskyer please try to repro using master next week and let me know if you can, thanks!

jackfrancis avatar Feb 03 '18 00:02 jackfrancis

@jackfrancis sure

feiskyer avatar Feb 03 '18 00:02 feiskyer

@jackfrancis Thanks for pushing the fix. I've tested with the latest master, but unfortunately it didn't help in my case.

I consistently face this issue if networking is set to azure. However, even before your fixes I was able to deploy at least several times in a row with networking set to none (for some reason networking was extremely unreliable so that's not a solution) and haven't had it failing.

In case this is useful, here's my template:

{
    "apiVersion": "vlabs",
    "properties": {
        "orchestratorProfile": {
            "orchestratorType": "Kubernetes",
            "orchestratorRelease": "1.9",
            "orchestratorVersion": "1.9.2",
            "kubernetesConfig": {
                "networkPolicy": "azure"
            }
        },
        "masterProfile": {
            "count": 1,
            "dnsPrefix": "my-prefix",
            "vnetSubnetId": "<value>",
            "firstConsecutiveStaticIP": "172.19.5.100",
            "vmSize": "Standard_D2_v2"
        },
        "agentPoolProfiles": [{
            "availabilityProfile": "AvailabilitySet",
            "count": 2,
            "name": "pool1",
            "OSDiskSizeGB": 400,
            "storageProfile" : "ManagedDisks",
            "vmSize": "Standard_D2_v2",
            "vnetSubnetId": "<value>",
            "osType": "Linux",
            "distro": "ubuntu"
         }],
        "linuxProfile": {
            "adminUsername": "<value>",
            "ssh": {
                "publicKeys": [{ "keyData": "<value>" }]
            },
            "secrets": []
        },
        "servicePrincipalProfile": {
            "clientId": "<value>",
            "secret": "<value>"
        },
        "certificateProfile": {}
    }
}

And my acs-engine version output:

Version: canary
GitCommit: 7923b960
GitTreeState: clean

Just tried with calico and it worked fine. Seems to be just azure that's affected in my case.

ilyalukyanov avatar Feb 05 '18 10:02 ilyalukyanov

I've been testing a lot to day with ace-engine 0.12.5 and I've yet to run into this issue. Last week with 0.12.4 and 0.12.2 I got it all the time. So it seems to be much better 👍

msorby avatar Feb 05 '18 18:02 msorby

@ilyalukyanov This PR also moves the ball forward:

https://github.com/Azure/acs-engine/pull/2196

That is aimed for master today, should reduce further cse flakiness.

jackfrancis avatar Feb 05 '18 18:02 jackfrancis