Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

az aks get-credentials fails after upgrade to 2.30.0 #20343

Closed
drwoods opened this issue Nov 15, 2021 · 11 comments
Closed

az aks get-credentials fails after upgrade to 2.30.0 #20343

drwoods opened this issue Nov 15, 2021 · 11 comments
Assignees
Labels
AKS az aks/acs/openshift customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team Service Attention This issue is responsible by Azure service team.

Comments

@drwoods
Copy link

drwoods commented Nov 15, 2021

This is autogenerated. Please review and update as needed.

Describe the bug

Used brew to update to the latest azure-cli 2.30.0 on MacOS 11.6.1 and while az logout, az account clear, az login and az set --subscription still work, I can't fetch AKS creds.

Command Name
az aks get-credentials

Errors:

The command failed with an unexpected error. Here is the traceback:
cannot import name 'Iterable' from 'collections' (/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 556, in execute
    self.commands_loader.load_arguments(command)
  File "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/azure/cli/core/__init__.py", line 517, in load_arguments
    self.command_table[command].load_arguments()  # this loads the arguments via reflection
  File "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 313, in load_arguments
    super(AzCliCommand, self).load_arguments()
  File "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/knack/commands.py", line 104, in load_arguments
    cmd_args = self.arguments_loader()
  File "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 125, in arguments_loader
    op = self.get_op_handler(self.op_path)
  File "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 59, in get_op_handler
    handler = import_module(mod_to_import)
  File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/dwoods/.azure/cliextensions/aks-preview/azext_aks_preview/custom.py", line 44, in <module>
    from tabulate import tabulate  # pylint: disable=import-error
  File "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/tabulate.py", line 16, in <module>
    from collections import Iterable
ImportError: cannot import name 'Iterable' from 'collections' (/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)

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 -n {} -g {}

Expected Behavior

Subscription I'm accessing has 4 AKS clusters in 3 different regions. The cluster I'm trying to get credentials for resides in a region (westus2) which only hosts a single AKS cluster.

The mentioned command worked with the prior 2.28.x version of azure-cli I had installed.

Environment Summary

macOS-11.6.1-x86_64-i386-64bit, Darwin 20.6.0
Python 3.10.0
Installer: HOMEBREW

azure-cli 2.30.0

Extensions:
aks-preview 0.5.11

Additional Context

Note: Final work around for now was to remocat ve my existing ~/.azure directory which worked. I first tried removing acccessTokens.json but error still persisted.

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Nov 15, 2021
@yonzhan yonzhan added the AKS az aks/acs/openshift label Nov 15, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Nov 15, 2021
@yonzhan yonzhan added Service Attention This issue is responsible by Azure service team. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 15, 2021
@ghost
Copy link

ghost commented Nov 15, 2021

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

Issue Details

This is autogenerated. Please review and update as needed.

Describe the bug

Used brew to update to the latest azure-cli 2.30.0 on MacOS 11.6.1 and while az logout, az account clear, az login and az set --subscription still work, I can't fetch AKS creds.

Command Name
az aks get-credentials

Errors:

The command failed with an unexpected error. Here is the traceback:
cannot import name 'Iterable' from 'collections' (/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 556, in execute
    self.commands_loader.load_arguments(command)
  File "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/azure/cli/core/__init__.py", line 517, in load_arguments
    self.command_table[command].load_arguments()  # this loads the arguments via reflection
  File "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 313, in load_arguments
    super(AzCliCommand, self).load_arguments()
  File "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/knack/commands.py", line 104, in load_arguments
    cmd_args = self.arguments_loader()
  File "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 125, in arguments_loader
    op = self.get_op_handler(self.op_path)
  File "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 59, in get_op_handler
    handler = import_module(mod_to_import)
  File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/dwoods/.azure/cliextensions/aks-preview/azext_aks_preview/custom.py", line 44, in <module>
    from tabulate import tabulate  # pylint: disable=import-error
  File "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/tabulate.py", line 16, in <module>
    from collections import Iterable
ImportError: cannot import name 'Iterable' from 'collections' (/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)

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 -n {} -g {}

Expected Behavior

Subscription I'm accessing has 4 AKS clusters in 3 different regions. The cluster I'm trying to get credentials for resides in a region (westus2) which only hosts a single AKS cluster.

The mentioned command worked with the prior 2.28.x version of azure-cli I had installed.

Environment Summary

macOS-11.6.1-x86_64-i386-64bit, Darwin 20.6.0
Python 3.10.0
Installer: HOMEBREW

azure-cli 2.30.0

Extensions:
aks-preview 0.5.11

Additional Context

Note: Final work around for now was to remocat ve my existing ~/.azure directory which worked. I first tried removing acccessTokens.json but error still persisted.

Author: drwoods
Assignees: -
Labels:

Service Attention, AKS, customer-reported

Milestone: -

@yonzhan
Copy link
Collaborator

yonzhan commented Nov 15, 2021

route to service team

@phealy
Copy link

phealy commented Nov 16, 2021

You have a fairly outdated aks-preview extension installed - current version is 0.5.42 and you're running 0.5.11. Could you please try updating your aks-preview extension via az extension update --name aks-preview and see if you can reproduce the issue?

@phealy phealy self-assigned this Nov 16, 2021
@phealy phealy added the needs-author-feedback More information is needed from author to address the issue. label Nov 16, 2021
@Xinyue-Wang
Copy link
Contributor

hi @phealy I got the same error but my aks-preview extension is already at 0.5.42

az extension list
[
{
"experimental": false,
"extensionType": "whl",
"name": "aks-preview",
"path": "/Users//.azure/cliextensions/aks-preview",
"preview": true,
"version": "0.5.42"
},
{
"experimental": false,
"extensionType": "whl",
"name": "azure-devops",
"path": "/Users/
/.azure/cliextensions/azure-devops",
"preview": false,
"version": "0.22.0"
}
]

@OliS76
Copy link

OliS76 commented Nov 17, 2021

Same here

>az --version
azure-cli                         2.30.0

core                              2.30.0
telemetry                          1.0.6

Extensions:
aks-preview                       0.5.42
interactive                        0.4.4
❯ az aks get-credentials --resource-group XXX --name XXX
The command failed with an unexpected error. Here is the traceback:
cannot import name 'Iterable' from 'collections'

@drwoods
Copy link
Author

drwoods commented Nov 17, 2021

Same issue with updated aks-preview unless I start with a clean .azure -

az --version
azure-cli                         2.30.0

core                              2.30.0
telemetry                          1.0.6

Extensions:
aks-preview                       0.5.42

@ghost ghost added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-author-feedback More information is needed from author to address the issue. labels Nov 17, 2021
@jiasli
Copy link
Member

jiasli commented Nov 18, 2021

Azure CLI has bumped tabulate to the latest version (#20195 (comment)) and the fix will be released in 2.31.0.

@FumingZhang
Copy link
Member

FumingZhang commented Nov 23, 2021

Sorry for the inconvenience. From the error message, the error is caused by the incompatibility between python3.10 and the current version of the installed site-package tabulate. You can check the installed version of tabulate by command pip show tabulate.

To mitigate this problem, please choose one of the options below
Option 1:
Update tabulate by pip install tabulate==0.8.9 -U.

Option 2:
Use python3.8 instead.

Please consider the following workaround, otherwise, please use cloudshell from portal or wait for the next release to fix this issue.

@drwoods
Copy link
Author

drwoods commented Nov 23, 2021

I used brew to install azure-cli 2.30.0_1 and the cask forces python 3.10 as a dependency.
To resolve the issue for now, I removed my ~/.azure and let it create a new one after the brew upgrade to azure-cli 2.30.0 and Python 3.10.

@jiasli
Copy link
Member

jiasli commented Nov 24, 2021

Duplicate of #20348

@jiasli jiasli marked this as a duplicate of #20348 Nov 24, 2021
@jiasli jiasli closed this as completed Nov 24, 2021
@jiasli
Copy link
Member

jiasli commented Nov 24, 2021

@drwoods, this won't fix this issue. ~/.azure is only the data folder and has nothing to do with Azure CLI's dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AKS az aks/acs/openshift customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

7 participants