Skip to content

az network private-dns zone list fails with KeyError: 'name' #27988

Description

@samzehnder

Describe the bug

az network private-dns zone list fails with an unexpected error and shows a traceback.

Related command

az network private-dns zone list

Errors

The command failed with an unexpected error. Here is the traceback:
'name'
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 663, in execute
raise ex
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 710, in _run_job
result = list(result)
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_paging.py", line 87, in next
return next(self._page_iterator)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_paging.py", line 43, in next
self._executor(self._next_link)
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_command.py", line 250, in executor_wrapper
executor()
File "/usr/local/lib/python3.11/site-packages/azure/cli/command_modules/privatedns/aaz/latest/network/private_dns/zone/_list.py", line 59, in _execute_operations
self.PrivateZonesList(ctx=self.ctx)()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_operation.py", line 42, in init
self.client = ctx.get_http_client(self.CLIENT_TYPE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_command_ctx.py", line 73, in get_http_client
credential = self.get_login_credential()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_command_ctx.py", line 58, in get_login_credential
credential, _, _ = self._profile.get_login_credentials(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/_profile.py", line 314, in get_login_credentials
account = self.get_subscription(subscription_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/_profile.py", line 548, in get_subscription
result = [x for x in subscriptions if (
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/_profile.py", line 550, in
subscription and subscription.lower() in [x[_SUBSCRIPTION_ID].lower(), x[
^^
KeyError: 'name'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Issue script & Debug output

cli.knack.cli: Command arguments: ['network', 'private-dns', 'zone', 'list', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7ff0af48c0e0>, <function OutputProducer.on_global_arguments at 0x7ff0af3a2340>, <function CLIQuery.on_global_arguments at 0x7ff0af3dbe20>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'network': ['azure.cli.command_modules.network', 'azure.cli.command_modules.privatedns']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: network 0.691 114 354
cli.azure.cli.core: privatedns 0.020 14 63
cli.azure.cli.core: Total (2) 0.710 128 417
cli.azure.cli.core: Loaded 127 groups, 417 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : network private-dns zone list
cli.azure.cli.core: Command table: network private-dns zone list
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7ff0ad71bb00>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/root/.azure/commands/2023-12-08.10-34-13.network_private-dns_zone_list.86.log'.
az_command_data_logger: command args: network private-dns zone list --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7ff0ad760c20>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x7ff0ad763ec0>, <function register_cache_arguments..add_cache_arguments at 0x7ff0ad790040>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7ff0af3a23e0>, <function CLIQuery.handle_query_parameter at 0x7ff0af3dbec0>, <function register_ids_argument..parse_ids_arguments at 0x7ff0ad763f60>]
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 663, in execute
raise ex
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 710, in _run_job
result = list(result)
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_paging.py", line 87, in next
return next(self._page_iterator)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_paging.py", line 43, in next
self._executor(self._next_link)
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_command.py", line 250, in executor_wrapper
executor()
File "/usr/local/lib/python3.11/site-packages/azure/cli/command_modules/privatedns/aaz/latest/network/private_dns/zone/_list.py", line 59, in _execute_operations
self.PrivateZonesList(ctx=self.ctx)()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_operation.py", line 42, in init
self.client = ctx.get_http_client(self.CLIENT_TYPE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_command_ctx.py", line 73, in get_http_client
credential = self.get_login_credential()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_command_ctx.py", line 58, in get_login_credential
credential, _, _ = self._profile.get_login_credentials(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/_profile.py", line 314, in get_login_credentials
account = self.get_subscription(subscription_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/_profile.py", line 548, in get_subscription
result = [x for x in subscriptions if (
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/_profile.py", line 550, in
subscription and subscription.lower() in [x[_SUBSCRIPTION_ID].lower(), x[
^^
KeyError: 'name'

cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback:
az_command_data_logger: The command failed with an unexpected error. Here is the traceback:
cli.azure.cli.core.azclierror: 'name'
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 663, in execute
raise ex
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 710, in _run_job
result = list(result)
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_paging.py", line 87, in next
return next(self._page_iterator)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_paging.py", line 43, in next
self._executor(self._next_link)
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_command.py", line 250, in executor_wrapper
executor()
File "/usr/local/lib/python3.11/site-packages/azure/cli/command_modules/privatedns/aaz/latest/network/private_dns/zone/_list.py", line 59, in _execute_operations
self.PrivateZonesList(ctx=self.ctx)()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_operation.py", line 42, in init
self.client = ctx.get_http_client(self.CLIENT_TYPE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_command_ctx.py", line 73, in get_http_client
credential = self.get_login_credential()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_command_ctx.py", line 58, in get_login_credential
credential, _, _ = self._profile.get_login_credentials(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/_profile.py", line 314, in get_login_credentials
account = self.get_subscription(subscription_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/_profile.py", line 548, in get_subscription
result = [x for x in subscriptions if (
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/_profile.py", line 550, in
subscription and subscription.lower() in [x[_SUBSCRIPTION_ID].lower(), x[
^^
KeyError: 'name'
az_command_data_logger: 'name'
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 663, in execute
raise ex
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 710, in _run_job
result = list(result)
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_paging.py", line 87, in next
return next(self._page_iterator)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_paging.py", line 43, in next
self._executor(self._next_link)
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_command.py", line 250, in executor_wrapper
executor()
File "/usr/local/lib/python3.11/site-packages/azure/cli/command_modules/privatedns/aaz/latest/network/private_dns/zone/_list.py", line 59, in _execute_operations
self.PrivateZonesList(ctx=self.ctx)()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_operation.py", line 42, in init
self.client = ctx.get_http_client(self.CLIENT_TYPE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_command_ctx.py", line 73, in get_http_client
credential = self.get_login_credential()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/aaz/_command_ctx.py", line 58, in get_login_credential
credential, _, _ = self._profile.get_login_credentials(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/_profile.py", line 314, in get_login_credentials
account = self.get_subscription(subscription_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/_profile.py", line 548, in get_subscription
result = [x for x in subscriptions if (
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/_profile.py", line 550, in
subscription and subscription.lower() in [x[_SUBSCRIPTION_ID].lower(), x[
^^
KeyError: 'name'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7ff0ad71bd80>]
az_command_data_logger: exit code: 1
cli.main: Command ran in 1.111 seconds (init: 0.351, invoke: 0.760)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 7033 in cache
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/usr/local/bin/python /usr/local/lib/python3.11/site-packages/azure/cli/telemetry/init.py /root/.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.

Expected behavior

Command should work as in older versions (e.g. 2.49.0)

Environment Summary

{
"azure-cli": "2.55.0",
"azure-cli-core": "2.55.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {}
}

Additional context

No response

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botNetworkaz network vnet/lb/nic/dns/etc...Service AttentionThis issue is responsible by Azure service team.act-quality-productivity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions