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 network public-ip update crashes with --ip-tags #29911

Closed
gregsmi opened this issue Sep 14, 2024 · 1 comment · Fixed by #30174
Closed

az network public-ip update crashes with --ip-tags #29911

gregsmi opened this issue Sep 14, 2024 · 1 comment · Fixed by #30174
Assignees
Labels
Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. Network az network vnet/lb/nic/dns/etc... question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone

Comments

@gregsmi
Copy link

gregsmi commented Sep 14, 2024

Describe the bug

Attempting to update the ipTags property on an existing public IP object crashes the CLI

Related command

az network public-ip update

Errors

The command failed with an unexpected error. Here is the traceback:
'bool' object has no attribute 'items'
Traceback (most recent call last):
  File "/opt/az/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 666, in execute
    raise ex
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 733, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 714, in _run_job
    result = LongRunningOperation(cmd_copy.cli_ctx, 'Starting {}'.format(cmd_copy.name))(result)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 1062, in __call__
    result = poller.result()
             ^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/aaz/_poller.py", line 108, in result
    self.wait(timeout)
  File "/opt/az/lib/python3.11/site-packages/azure/core/tracing/decorator.py", line 76, in wrapper_use_tracer
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/aaz/_poller.py", line 130, in wait
    raise self._exception
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/aaz/_poller.py", line 83, in _start
    for polling_method in self._polling_generator:
  File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/network/aaz/latest/network/public_ip/_update.py", line 513, in _execute_operations
    self.pre_operations()
  File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/network/custom.py", line 5253, in pre_operations
    args.ip_tags_list = [{"ip_tag_type": k, "tag": v} for k, v in ip_tags.items()]
                                                                  ^^^^^^^^^^^^^
AttributeError: 'bool' object has no attribute 'items'

Issue script & Debug output

az network public-ip update -g ip-test-rg -n ip-test-ip --ip-tags "FirstPartyUsage=Test"

cli.knack.cli: Command arguments: ['network', 'public-ip', 'update', '-g', 'ip-test-rg', '-n', 'ip-test-ip', '--ip-tags', 'FirstPartyUsage=Test', '--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 0x7f42c312ff60>, <function OutputProducer.on_global_arguments at 0x7f42c30da160>, <function CLIQuery.on_global_arguments at 0x7f42c2eefc40>]
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', 'azext_nsp']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name                  Load Time    Groups  Commands
cli.azure.cli.core: network                   1.464       117       356
cli.azure.cli.core: privatedns                0.038        14        60
cli.azure.cli.core: Total (2)                 1.502       131       416
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name                  Load Time    Groups  Commands  Directory
cli.azure.cli.core: nsp                       0.015         2         1  /<..>/.azure/cliextensions/nsp
cli.azure.cli.core: Total (1)                 0.015         2         1
cli.azure.cli.core: Loaded 131 groups, 417 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command  : network public-ip update
cli.azure.cli.core: Command table: network public-ip update
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f42c2529d00>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '<..>/.azure/commands/2024-09-14.11-12-02.network_public-ip_update.23504.log'.
az_command_data_logger: command args: network public-ip update -g {} -n {} --ip-tags {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x7f42c25644a0>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x7f42c257a480>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x7f42c257a5c0>, <function register_upcoming_breaking_change_info.<locals>.update_breaking_change_info at 0x7f42c257a660>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7f42c30da200>, <function CLIQuery.handle_query_parameter at 0x7f42c2eefce0>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x7f42c257a520>]
cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "/opt/az/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 666, in execute
    raise ex
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 733, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 714, in _run_job
    result = LongRunningOperation(cmd_copy.cli_ctx, 'Starting {}'.format(cmd_copy.name))(result)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 1062, in __call__
    result = poller.result()
             ^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/aaz/_poller.py", line 108, in result
    self.wait(timeout)
  File "/opt/az/lib/python3.11/site-packages/azure/core/tracing/decorator.py", line 76, in wrapper_use_tracer
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/aaz/_poller.py", line 130, in wait
    raise self._exception
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/aaz/_poller.py", line 83, in _start
    for polling_method in self._polling_generator:
  File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/network/aaz/latest/network/public_ip/_update.py", line 513, in _execute_operations
    self.pre_operations()
  File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/network/custom.py", line 5253, in pre_operations
    args.ip_tags_list = [{"ip_tag_type": k, "tag": v} for k, v in ip_tags.items()]
                                                                  ^^^^^^^^^^^^^
AttributeError: 'bool' object has no attribute 'items'

Expected behavior

No crash, properties.ipTags array should be successfully updated

Environment Summary

azure-cli                         2.64.0

core                              2.64.0
telemetry                          1.1.0

Extensions:
account                            0.2.5
aks-preview                      9.0.0b2
devcenter                          6.0.1
nsp                              1.0.0b2

Dependencies:
msal                              1.30.0
azure-mgmt-resource               23.1.1

Python location '/opt/az/bin/python3'
Extensions directory '/home/gregsmi/.azure/cliextensions'

Python (Linux) 3.11.8 (main, Aug 28 2024, 05:45:28) [GCC 9.4.0]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

Additional context

No response

@gregsmi gregsmi added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Sep 14, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Sep 14, 2024

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Network az network vnet/lb/nic/dns/etc... labels Sep 14, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Sep 14, 2024
@yonzhan yonzhan added this to the Backlog milestone Sep 14, 2024
@yonzhan yonzhan removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. Network az network vnet/lb/nic/dns/etc... question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
3 participants