"Incorrect padding" when trying to create managed Kubernetes cluster on Azure with AKS

4/18/2018

I am working through the instructions outlined here to try and set up a Couchbase cluster on Azure Container Service (AKS). That tutorial is using terminal/Mac, and I'm using Powershell/Windows.

I'm getting an error before I even get to the Couchbase part. I successfully created a resource group (which I called "cb_ask_spike", and yes it does appear on the Portal) from the command line, but then I try to create an AKS cluster:

az aks create --resource-group cb_aks_spike --name cbakscluster

I also tried:

az aks create --resource-group cb_aks_spike --name cbakscluster --generate-ssh-keys

In both cases, I get an error:

az aks create: error: Incorrect padding

enter image description here

I don't know what this error message means, and I can't seem to find any reference to it in the documentation or anywhere. What am I doing wrong?

I'm using azure-cli v2.0.31.

-- Matthew Groves
azure
azure-cli
azure-container-service
kubernetes

2 Answers

11/5/2019

I am fairly confident that I solved why I'm getting this error, and I've updated issue 6142 on azure-cli. At this time, I believe this is a bug, and it's not fixed, but there is a workaround.

First it's important to note that --generate-ssh generates a new ssh key in ~/.ssh

I had a hunch that since ~ for me is "C:\Users\Matthew Groves" that the space in the path was causing the problem. Sure enough, I created a new account called "mgroves". ~ is now "C:\Users\mgroves" and voila, I don't get the "incorrect padding" error message anymore.

So, the workaround is either to use a new account (huge pain) or rename the folder (this is what I have done, and it's also a huge pain and I'm still finding little problems here and there all throughout my system because of it.

-- Matthew Groves
Source: StackOverflow

4/21/2018

Just verified today using az cli in Powershell for version 2.0.31. You might need to first run the az group and then create az aks command. Screenshot for your reference. Azure CLI AKS Create

-- Baskar
Source: StackOverflow