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 vm list crash: 'Namespace' object has no attribute '_cmd' #20311

Closed
jakobbg opened this issue Nov 12, 2021 · 3 comments
Closed

az vm list crash: 'Namespace' object has no attribute '_cmd' #20311

jakobbg opened this issue Nov 12, 2021 · 3 comments
Assignees
Labels
Compute az vm/vmss/image/disk/snapshot customer-reported Issues that are reported by GitHub users external to the Azure organization.
Milestone

Comments

@jakobbg
Copy link

jakobbg commented Nov 12, 2021

Command Name
az vm list

Errors:

The command failed with an unexpected error. Here is the traceback:
'Namespace' object has no attribute '_cmd'
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.30.0/libexec/lib/python3.9/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/homebrew/Cellar/azure-cli/2.30.0/libexec/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 582, in execute
    parsed_args = self.parser.parse_args(args)
  File "/opt/homebrew/Cellar/azure-cli/2.30.0/libexec/lib/python3.9/site-packages/knack/parser.py", line 260, in parse_args
    return super().parse_args(args)
  File "/opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/argparse.py", line 1822, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/opt/homebrew/Cellar/azure-cli/2.30.0/libexec/lib/python3.9/site-packages/azure/cli/core/parser.py", line 284, in parse_known_args
    self._namespace, self._raw_arguments = super().parse_known_args(args=args, namespace=namespace)
  File "/opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/argparse.py", line 1850, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/argparse.py", line 2046, in _parse_known_args
    positionals_end_index = consume_positionals(start_index)
  File "/opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/argparse.py", line 2023, in consume_positionals
    take_action(action, args)
  File "/opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/argparse.py", line 1932, in take_action
    action(self, namespace, argument_values, option_string)
  File "/opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/argparse.py", line 1210, in __call__
    subnamespace, arg_strings = parser.parse_known_args(arg_strings, None)
  File "/opt/homebrew/Cellar/azure-cli/2.30.0/libexec/lib/python3.9/site-packages/azure/cli/core/parser.py", line 284, in parse_known_args
    self._namespace, self._raw_arguments = super().parse_known_args(args=args, namespace=namespace)
  File "/opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/argparse.py", line 1850, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/argparse.py", line 2046, in _parse_known_args
    positionals_end_index = consume_positionals(start_index)
  File "/opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/argparse.py", line 2023, in consume_positionals
    take_action(action, args)
  File "/opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/argparse.py", line 1932, in take_action
    action(self, namespace, argument_values, option_string)
  File "/opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/argparse.py", line 1210, in __call__
    subnamespace, arg_strings = parser.parse_known_args(arg_strings, None)
  File "/opt/homebrew/Cellar/azure-cli/2.30.0/libexec/lib/python3.9/site-packages/azure/cli/core/parser.py", line 284, in parse_known_args
    self._namespace, self._raw_arguments = super().parse_known_args(args=args, namespace=namespace)
  File "/opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/argparse.py", line 1850, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/argparse.py", line 2064, in _parse_known_args
    start_index = consume_optional(start_index)
  File "/opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/argparse.py", line 2004, in consume_optional
    take_action(action, args, option_string)
  File "/opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/argparse.py", line 1932, in take_action
    action(self, namespace, argument_values, option_string)
  File "/opt/homebrew/Cellar/azure-cli/2.30.0/libexec/lib/python3.9/site-packages/azure/cli/core/commands/arm.py", line 357, in __call__
    profile = Profile(cli_ctx=namespace._cmd.cli_ctx)  # pylint: disable=protected-access
AttributeError: 'Namespace' object has no attribute '_cmd'

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 vm list -g {} --subscription={}

Expected Behavior

Environment Summary

macOS-12.0.1-arm64-arm-64bit, Darwin 21.1.0
Python 3.9.8
Installer: HOMEBREW

azure-cli 2.30.0

Additional Context

@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 12, 2021
@yonzhan yonzhan added the Compute az vm/vmss/image/disk/snapshot label Nov 12, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Nov 12, 2021
@yonzhan yonzhan removed the question The issue doesn't require a change to the product in order to be resolved. Most issues start as that label Nov 12, 2021
@yonzhan yonzhan added this to the Backlog milestone Nov 12, 2021
@yonzhan
Copy link
Collaborator

yonzhan commented Nov 12, 2021

Compute

@jiasli
Copy link
Member

jiasli commented Nov 15, 2021

This issue is caused by a regression in Python 3.9.8. Let's work on #20269.

@jiasli jiasli closed this as completed Nov 15, 2021
@jakobbg
Copy link
Author

jakobbg commented Nov 15, 2021

Confirmed to be resolved in homebrew-version 2.30.0_1.

~ brew info azure-cli
azure-cli: stable 2.30.0 (bottled), HEAD
Microsoft Azure CLI 2.0
https://docs.microsoft.com/cli/azure/overview
/opt/homebrew/Cellar/azure-cli/2.30.0_1 (21,310 files, 462.3MB) *
  Poured from bottle on 2021-11-15 at 22:33:21
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/azure-cli.rb
License: MIT
==> Dependencies
Required: openssl@1.1 ✔, python@3.10 ✔
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 55,467 (30 days), 146,824 (90 days), 467,626 (365 days)
install-on-request: 55,315 (30 days), 146,402 (90 days), 465,609 (365 days)
build-error: 123 (30 days)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compute az vm/vmss/image/disk/snapshot customer-reported Issues that are reported by GitHub users external to the Azure organization.
Projects
None yet
Development

No branches or pull requests

4 participants