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

ModuleNotFoundError in 'az acr'

Open HansZimmer5000 opened this issue 5 years ago • 5 comments

TLDR; seems like a module is missing: ModuleNotFoundError: No module named 'azure.cli.command_modules.acr._docker_utils'

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az acr login Same happens with 'az acr --help' + I retried after 'az login'.

Errors:

The command failed with an unexpected error. Here is the traceback:
No module named 'azure.cli.command_modules.acr._docker_utils'
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/[email protected]/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 "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/azure/cli/command_modules/acr/custom.py", line 20, in <module>
    from ._docker_utils import get_login_credentials, EMPTY_GUID
ModuleNotFoundError: No module named 'azure.cli.command_modules.acr._docker_utils'

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 acr login

Expected Behavior

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:
ssh 0.1.8
connectedmachine 0.4.1

Additional Context

HansZimmer5000 avatar Nov 17 '21 12:11 HansZimmer5000

Hotfix:

brew remove azure-cli
brew install azure-cli

HansZimmer5000 avatar Nov 17 '21 13:11 HansZimmer5000

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @toddysm, @luisdlp, @northtyphoon.

Issue Details

TLDR; seems like a module is missing: ModuleNotFoundError: No module named 'azure.cli.command_modules.acr._docker_utils'

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az acr login Same happens with 'az acr --help' + I retried after 'az login'.

Errors:

The command failed with an unexpected error. Here is the traceback:
No module named 'azure.cli.command_modules.acr._docker_utils'
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/[email protected]/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 "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/azure/cli/command_modules/acr/custom.py", line 20, in <module>
    from ._docker_utils import get_login_credentials, EMPTY_GUID
ModuleNotFoundError: No module named 'azure.cli.command_modules.acr._docker_utils'

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 acr login

Expected Behavior

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:
ssh 0.1.8
connectedmachine 0.4.1

Additional Context

Author: HansZimmer5000
Assignees: -
Labels:

Service Attention, Container Registry, customer-reported

Milestone: -

ghost avatar Nov 17 '21 14:11 ghost

route to service team

yonzhan avatar Nov 17 '21 14:11 yonzhan

Esteban from ACR here. I tried reproducing the issue above using the same azure version cli and brew (I tried it on linux however) and did not encounter the issue. In addition from the hotfix provided it sounds like there is no package issue itself but rather a transient issue pertaining to the particular installation presented here (for any number of reasons most likely not related to the cli release itself). Since the issue was transient and does not seem to reproduce I think we can probably close this.

estebanreyl avatar Nov 18 '21 00:11 estebanreyl

Fine with me!

HansZimmer5000 avatar Nov 19 '21 14:11 HansZimmer5000