question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az acs kubernetes get-credentials fails authentication

See original GitHub issue

On a fresh install of azure-cli via homebrew, it installs python3 as a dependency, and successfully installs. I am able to login using az login, and can then subsequently run az acs list -o table and see my clusters (full output below). Then when trying to get the credentials, authentication fails for some unknown reason - az acs kubernetes get-credentials.

I was able to run the same process on a Linux system using yum to install az and it worked fine. It did use Python 2.7 rather than 3.6.


Environment summary

OSX 10.13.1 installed via homebrew version 2.0.22 zsh using iTerm2

az --version
azure-cli (2.0.22)

acr (2.0.16)
acs (2.0.21)
advisor (0.1.0)
appservice (0.1.21)
backup (1.0.3)
batch (3.1.7)
batchai (0.1.3)
billing (0.1.6)
cdn (0.0.10)
cloud (2.0.10)
cognitiveservices (0.1.9)
command-modules-nspkg (2.0.1)
configure (2.0.12)
consumption (0.2.0)
container (0.1.14)
core (2.0.22)
cosmosdb (0.1.15)
dla (0.0.15)
dls (0.0.18)
eventgrid (0.1.5)
extension (0.0.6)
feedback (2.0.6)
find (0.2.7)
interactive (0.3.11)
iot (0.1.14)
keyvault (2.0.14)
lab (0.0.13)
monitor (0.0.13)
network (2.0.18)
nspkg (3.0.1)
profile (2.0.15)
rdbms (0.0.9)
redis (0.2.10)
reservations (0.1.0)
resource (2.0.19)
role (2.0.15)
servicefabric (0.0.6)
sql (2.0.16)
storage (2.0.20)
vm (2.0.19)

Python location '/usr/local/opt/python3/bin/python3.6'
Extensions directory '/Users/derek/.azure/cliextensions'

Python (Darwin) 3.6.3 (default, Oct  4 2017, 06:09:38)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)]

CLI Output

$$ az acs list -o table
Location        Name          ProvisioningState    ResourceGroup
--------------  ------------  -------------------  -------------------
northcentralus  abcd  Succeeded            1234

$$ az acs kubernetes get-credentials -n abcd -g 1234
Authentication failed.
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.0.22/libexec/lib/python3.6/site-packages/azure/cli/main.py", line 36, in main
    cmd_result = APPLICATION.execute(args)
  File "/usr/local/Cellar/azure-cli/2.0.22/libexec/lib/python3.6/site-packages/azure/cli/core/application.py", line 216, in execute
    result = expanded_arg.func(params)
  File "/usr/local/Cellar/azure-cli/2.0.22/libexec/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 381, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/Cellar/azure-cli/2.0.22/libexec/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 630, in _execute_command
    reraise(*sys.exc_info())
  File "/usr/local/Cellar/azure-cli/2.0.22/libexec/lib/python3.6/site-packages/six.py", line 693, in reraise
    raise value
  File "/usr/local/Cellar/azure-cli/2.0.22/libexec/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 612, in _execute_command
    result = op(client, **kwargs) if client else op(**kwargs)
  File "/usr/local/Cellar/azure-cli/2.0.22/libexec/lib/python3.6/site-packages/azure/cli/command_modules/acs/custom.py", line 866, in k8s_get_credentials
    _k8s_get_credentials_internal(name, acs_info, path, ssh_key_file)
  File "/usr/local/Cellar/azure-cli/2.0.22/libexec/lib/python3.6/site-packages/azure/cli/command_modules/acs/custom.py", line 887, in _k8s_get_credentials_internal
    '.kube/config', path_candidate, key_filename=ssh_key_file)
  File "/usr/local/Cellar/azure-cli/2.0.22/libexec/lib/python3.6/site-packages/azure/cli/command_modules/acs/acs_client.py", line 72, in secure_copy
    ssh.connect(host, username=user, pkey=pkey, sock=proxy)
  File "/usr/local/Cellar/azure-cli/2.0.22/libexec/lib/python3.6/site-packages/paramiko/client.py", line 424, in connect
    passphrase,
  File "/usr/local/Cellar/azure-cli/2.0.22/libexec/lib/python3.6/site-packages/paramiko/client.py", line 714, in _auth
    raise saved_exception
  File "/usr/local/Cellar/azure-cli/2.0.22/libexec/lib/python3.6/site-packages/paramiko/client.py", line 691, in _auth
    self._transport.auth_publickey(username, key))
  File "/usr/local/Cellar/azure-cli/2.0.22/libexec/lib/python3.6/site-packages/paramiko/transport.py", line 1450, in auth_publickey
    return self.auth_handler.wait_for_response(my_event)
  File "/usr/local/Cellar/azure-cli/2.0.22/libexec/lib/python3.6/site-packages/paramiko/auth_handler.py", line 226, in wait_for_response
    raise e
paramiko.ssh_exception.AuthenticationException: Authentication failed.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
ursqontiscommented, Aug 21, 2018

I have the same issue as @DaveVoyles. Note that these exact commands are mentioned in the MS walkthrough document https://docs.microsoft.com/en-us/azure/container-service/kubernetes/container-service-kubernetes-windows-walkthrough, which does not work because of this problem.

1reaction
derekperkinscommented, Dec 18, 2017

@Andre-Freitas Does acs use different credential validation than aks?

Read more comments on GitHub >

github_iconTop Results From Across the Web

az acs kubernetes get-credentials fails with error The api-version ...
az login az acs kubernetes get-credentials. Expected behavior. I was getting kubeconfig file and suddenly it stops working with this error.
Read more >
opal-azure-cli-acs - PyPI
az acs/aks install-cli will install to under %USERPROFILE%.azure-kubectl on Windows ... fix a certificate verification error for az aks install-cli in Cloud ...
Read more >
Kubernetes Adventures on Azure — Part 1 ... - 4wardPRO Blog
az acs kubernetes get-credentials --resource-group myAcsTest --name myK8sCluster ... in another way): this step failed with “Authentication failed” error.
Read more >
Set up GitLab CE or EE on Azure Container Service
Various failures block Let's Encrypt, and thus GitLab; General notes ... az acs kubernetes get-credentials --name tanukiWebsite -g GitLabDemos; az acs ...
Read more >
Azure Kubernetes Error when running "az aks get-credentials ...
It led to re-login and fix the issue. ... When you use the command az aks get-credentials without parameter --admin , it means...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found