azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

Failing to run az aks get-credentials with KeyError: 'users'

Open piyush-nimbalkar opened this issue 6 years ago • 7 comments

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az aks get-credentials

Errors:

'users'
Traceback (most recent call last):
python3.6/site-packages/knack/cli.py, ln 215, in invoke
    cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 631, in execute
    raise ex
cli/core/commands/__init__.py, ln 695, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
cli/core/commands/__init__.py, ln 688, in _run_job
    six.reraise(*sys.exc_info())
lib/python3.6/site-packages/six.py, ln 693, in reraise
    raise value
...
cli/command_modules/acs/custom.py, ln 3192, in _print_or_merge_credentials
    merge_kubernetes_configurations(path, temp_path, overwrite_existing, context_name)
cli/command_modules/acs/custom.py, ln 1185, in merge_kubernetes_configurations
    _handle_merge(existing, addition, 'users', replace)
cli/command_modules/acs/custom.py, ln 1120, in _handle_merge
    if existing[key] is None:
KeyError: 'users'

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here...
  • az aks get-credentials -g {} -n {}

Expected Behavior

Environment Summary

Linux-3.10.0-693.5.2.el7.x86_64-x86_64-with-centos-7.4.1708-Core
Python 3.6.8
Installer: RPM

azure-cli 2.5.1

Additional Context

piyush-nimbalkar avatar May 08 '20 01:05 piyush-nimbalkar

routing to appropriate team

yungezz avatar May 08 '20 09:05 yungezz

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/aks-pm.

ghost avatar May 08 '20 09:05 ghost

@piyush-nimbalkar - please check local file ~/.kube/config. There are 3 required keys which must be present: clusters, contexts and users. If there are no entries under these keys, they should contain empty lists.

You can also rename or delete the file and az aks get-credentials should start working again.

Duplicate issue: https://github.com/Azure/azure-cli-extensions/issues/1787

bpdohall avatar May 30 '20 04:05 bpdohall

@piyush-nimbalkar Apologies for the late reply. I hope you had a chance to follow the action plan mentioned above. That should help in resolving this issue. Alternatively you can pass the --file or --overwrite-existing parameter and run the command again. More Info here.

This issue is open for quite sometime now. Please let us know if you still need assistance on this. Awaiting your reply.

navba-MSFT avatar Feb 10 '22 11:02 navba-MSFT

@piyush-nimbalkar I wanted to do quick follow-up to check if you had a chance to look at my above comment. This github issue is open for quite sometime. Please let us know if you need any further assistance on this. Awaiting your reply.

navba-MSFT avatar Feb 13 '22 12:02 navba-MSFT

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

ghost avatar Feb 20 '22 14:02 ghost

@navba-MSFT I haven't tried this in a while. I will close this issue for now as it is very old. I will re-open it in case it happens again.

piyush-nimbalkar avatar Feb 25 '22 01:02 piyush-nimbalkar