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

Installing Cluster fails with exist code 99

Open mo-saeed opened this issue 7 years ago • 30 comments

Describe the bug Installation of kubernetes 1.13.6 with aks-engine 0.37.4 fails with the following error:

"code": "VMExtensionProvisioningError",
        "message": "VM has reported a failure when processing extension 'cse-master-0'. Error message: \"Enable failed: failed to execute command: command terminated with exit status=99\n[stdout]\n\n[stderr]\nConnection to k8s.gcr.io 443 port [tcp/https] succeeded!\nConnection to gcr.io 443 port [tcp/https] succeeded!\nConnection to docker.io 443 port [tcp/https] succeeded!\n\"."

ERR_APT_UPDATE_TIMEOUT=99 # Timeout waiting for apt-get update to complete

It seems that it's related to this change https://github.com/Azure/aks-engine/pull/1538

Steps To Reproduce Install a new k8s cluster (1.13.6) with aks-engine 0.37.4

Expected behavior To be able to install cluster with 0.37.4

AKS Engine version 0.37.4 Kubernetes version 1.13.6

mo-saeed avatar Jul 07 '19 15:07 mo-saeed

Have met the same issue with aks-engine 0.37.4 and k8s 1.15.0

tumluliu avatar Jul 08 '19 15:07 tumluliu

Looking

CecileRobertMichon avatar Jul 08 '19 16:07 CecileRobertMichon

This is due to the clear-containers key expiring:

+ tee /tmp/apt-get-update.out
+ grep -E '^([WE]:.*)|([eE]rr.*)$'
Err:8 http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04  Release.gpg
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04  Release: The following signatures were invalid: KEYEXPIRED 1562449942
W: Failed to fetch http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04/Release.gpg  The following signatures were invalid: KEYEXPIRED 1562449942
W: Some index files failed to download. They have been ignored, or old ones used instead.
+ '[' 0 -ne 0 ']'
+ cat /tmp/apt-get-update.out
Hit:1 http://azure.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://azure.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:3 http://azure.archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
Ign:5 http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04  InRelease
Hit:6 http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04  Release
Hit:7 https://packages.microsoft.com/ubuntu/16.04/prod xenial InRelease
Err:8 http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04  Release.gpg
  The following signatures were invalid: KEYEXPIRED 1562449942
Reading package lists...
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04  Release: The following signatures were invalid: KEYEXPIRED 1562449942
W: Failed to fetch http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04/Release.gpg  The following signatures were invalid: KEYEXPIRED 1562449942
W: Some index files failed to download. They have been ignored, or old ones used instead.

CecileRobertMichon avatar Jul 08 '19 16:07 CecileRobertMichon

Kata / clear containers regenerated the keys so this issue should be fixed now, @mo-saeed @tumluliu can you please confirm?

CecileRobertMichon avatar Jul 08 '19 16:07 CecileRobertMichon

@CecileRobertMichon I never used kata/clear containers, but anyway i will try to deploy the cluster and will update you

mo-saeed avatar Jul 08 '19 16:07 mo-saeed

@mo-saeed the clear containers apt source is pre-baked in the base Ubuntu image the VMs are built with, that's why you would see this error even without specifying clear containers.

CecileRobertMichon avatar Jul 08 '19 16:07 CecileRobertMichon

@CecileRobertMichon I still have the same issue } Deployment failed. Correlation ID: 7c9d0dc0-5138-4bad-ae61-5791caec4908. { "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 'cse-master-0'. Error message: \"Enable failed: failed to execute command: command terminated with exit status=99\n[stdout]\n\n[stderr]\nConnection to k8s.gcr.io 443 port [tcp/https] succeeded!\nConnection to gcr.io 443 port [tcp/https] succeeded!\nConnection to docker.io 443 port [tcp/https] succeeded!\n\"." } ] } }

And it only happens with 0.37.4 when using 0.36.1 it passes

mo-saeed avatar Jul 08 '19 17:07 mo-saeed

@mo-saeed could you please ssh into the master VM and send me the output of tail /var/log/azure/cluster-provision.log?

Also what apimodel are you using and what region? I'll try to repro as well.

I'm also working on v0.38.0 right now so I'd be interested in knowing if it repros there if you're able to build from source. If not, I'll upload the binaries soon.

CecileRobertMichon avatar Jul 08 '19 17:07 CecileRobertMichon

Here's the log :

Err:7 http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04  Release.gpg
  The following signatures were invalid: KEYEXPIRED 1562449942
Fetched 1,163 B in 0s (1,462 B/s)
Reading package lists...
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04  Release: The following signatures were invalid: KEYEXPIRED 1562449942
W: Failed to fetch http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04/Release.gpg  The following signatures were invalid: KEYEXPIRED 1562449942
W: Some index files failed to download. They have been ignored, or old ones used instead.
+ '[' 10 -eq 10 ']'
+ return 1
+ exit 99```

It's in west-europe.

mo-saeed avatar Jul 08 '19 17:07 mo-saeed

@mo-saeed can please you share your apimodel? I still can't repro...

CecileRobertMichon avatar Jul 08 '19 20:07 CecileRobertMichon

@CecileRobertMichon

  "apiVersion": "vlabs",
  "properties": {
    "orchestratorProfile": {
      "orchestratorType": "Kubernetes",
      "orchestratorVersion": "1.14.3",
      "kubernetesConfig": {
        "networkPlugin": "azure",
        "networkPolicy": "azure",
        "loadBalancerSku": "basic",
        "enablePodSecurityPolicy": false,
        "enableRbac": true,
        "addons": [{
            "name": "tiller",
            "enabled": false
          },
          {
            "name": "kubernetes-dashboard",
            "enabled": false
          },
          {
            "name": "heapster",
            "enabled": false
          },
          {
            "name": "keyvault-flexvolume",
            "enabled": false
          },
          {
            "name": "metrics-server",
            "enabled": false
          },
          {
            "name": "blobfuse-flexvolume",
            "enabled": false
          }
        ],
        "kubeletConfig": {
          "--max-pods": "110"
        },
        "apiServerConfig": {
        },
        "controllerManagerConfig": {},
        "schedulerConfig": {}
      }
    },
    "masterProfile": {
      "count": 1,
      "dnsPrefix": "aks-dev",
      "vmSize": "Standard_B2s",
      "vnetSubnetId": "****",
      "availabilityProfile": "AvailabilitySet",
      "firstConsecutiveStaticIP": "****"
    },
    "agentPoolProfiles": [{
      "name": "minion",
      "count": 2,
      "dnsPrefix": "",
      "vnetSubnetId": "****",
      "vmSize": "Standard_D2s_v3",
      "availabilityProfile": "VirtualMachineScaleSets"
    }],
    "linuxProfile": {
      "adminUsername": "admin",
      "ssh": {
        "publicKeys": [{
          "keyData": "****"
        }]
      }
    },
    "servicePrincipalProfile": {
      "clientId": "****",
      "secret": "****"
    }
  }
}

mo-saeed avatar Jul 08 '19 20:07 mo-saeed

Thanks. If you have time, can you please give https://github.com/Azure/aks-engine/releases/tag/v0.38.0 a try?

CecileRobertMichon avatar Jul 08 '19 20:07 CecileRobertMichon

Sure, let me try.

mo-saeed avatar Jul 08 '19 20:07 mo-saeed

@CecileRobertMichon Now it works with 0.38.0 👍 What was the change ?

mo-saeed avatar Jul 08 '19 20:07 mo-saeed

@mo-saeed I'm not sure I still haven't been able to repro. I might just be that the expired key was regenerated by the Kata folks since you last tried. Or it could be that the base image used by v0.37.4 has the expired key but not the one used by v0.38.0. I still need to get to the bottom of this.

CecileRobertMichon avatar Jul 08 '19 21:07 CecileRobertMichon

I still couldn't repro with 0.37.4 using the same apimodel. I'm going to assume this was fixed by the regenerated key.

opened #1587 as a secondary fix.

CecileRobertMichon avatar Jul 09 '19 00:07 CecileRobertMichon

Just FYI @CecileRobertMichon I just used v0.38.0 to launch an AvailabilitySet node to create a new image from it and the key has not been updated in the image:

Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:2 https://nvidia.github.io/libnvidia-container/ubuntu16.04/amd64  InRelease                    
Hit:3 https://nvidia.github.io/nvidia-container-runtime/ubuntu16.04/amd64  InRelease               
Hit:4 https://nvidia.github.io/nvidia-docker/ubuntu16.04/amd64  InRelease                                                    
Ign:5 http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04  InRelease           
Hit:7 https://packages.microsoft.com/ubuntu/16.04/prod xenial InRelease                                                      
Get:6 http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04  Release [682 B]
Hit:8 http://azure.archive.ubuntu.com/ubuntu xenial InRelease                                      
Get:9 http://azure.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]  
Get:10 http://azure.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]  
Get:11 http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04  Release.gpg [481 B]
Err:11 http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04  Release.gpg
  The following signatures were invalid: KEYEXPIRED 1562449942
Fetched 217 kB in 1s (206 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04  Release: The following signatures were invalid: KEYEXPIRED 1562449942
W: Failed to fetch http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04/Release.gpg  The following signatures were invalid: KEYEXPIRED 1562449942
W: Some index files failed to download. They have been ignored, or old ones used instead.

To make matters worse, when I use that image to launch a VMSS the VMSS does not register with the master nodes despite the deployment showing a success state. I'll open a ticket for that now.

PacoGuy avatar Jul 09 '19 01:07 PacoGuy

For reference I ended up here because of the exact same issue as the original poster with v0.34.0 and 1.13.5 which had been previously working. Also the log above is from:

Linux k8s-agentpool1-*********-vmss000000 4.15.0-1050-azure #55-Ubuntu SMP Sat Jun 29 00:27:54 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux111```

PacoGuy avatar Jul 09 '19 01:07 PacoGuy

@CecileRobertMichon many thanks for your investigating. But I still got the same error from my side with aks-engine 0.38.0, k8s 1.15.0 and distro aks-ubuntu-18.04. The logs from /var/log/azure/cluster-provision.log:

Err:11 http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04  Release.gpg
  The following signatures were invalid: EXPKEYSIG CCC19FA1383BC8D1 home:clearcontainers OBS Project <home:[email protected]>
Fetched 1163 B in 1s (1366 B/s)
Reading package lists...
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04  Release: The following signatures were invalid: EXPKEYSIG CCC19FA1383BC8D1 home:clearcontainers OBS Project <home:[email protected]>
W: Failed to fetch http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_16.04/Release.gpg  The following signatures were invalid: EXPKEYSIG CCC19FA1383BC8D1 home:clearcontainers OBS Project <home:[email protected]>
W: Some index files failed to download. They have been ignored, or old ones used instead.
+ '[' 10 -eq 10 ']'
+ return 1
+ exit 99

my region is also west-eu

tumluliu avatar Jul 09 '19 08:07 tumluliu

It seems it's really can't be reproduced all the time, sometimes this key works and sometimes not.

mo-saeed avatar Jul 09 '19 08:07 mo-saeed