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 ppg create failing with any tags included in version 2.39.0 #23540

Closed
JamesAlexHeller opened this issue Aug 16, 2022 · 2 comments · Fixed by #23543
Closed

az ppg create failing with any tags included in version 2.39.0 #23540

JamesAlexHeller opened this issue Aug 16, 2022 · 2 comments · Fixed by #23543
Assignees
Labels
Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team bug This issue requires a change to an existing behavior in the product in order to be resolved. Compute - PPG az ppg Compute az vm/vmss/image/disk/snapshot customer-reported Issues that are reported by GitHub users external to the Azure organization.
Milestone

Comments

@JamesAlexHeller
Copy link

Related command
az ppg create

Describe the bug
Current version of azure-cli (2.39.0) introduced bug where any tag included seems to results in the returned error:
Parameter 'tags' must be of type 'dict[str, str]'

To Reproduce
Run the command: ppg create --resource-group <resource_group> --location <region> --name <ppg_name> --tags testtag=test using version version 2.39.0 of azure-cli. If the version is downgraded to any earlier version it works as intended.

Environment summary
Ubuntu 20.04.4 LTS, Python 3.8.13, pip 21.2.4, azure-cli 2.39.0

Additional context
including --debug flag produces the following output (some parts obscured)

cli.knack.cli: Command arguments: ['ppg', 'create', '--resource-group', '*****', '--location', '*****', '--name', '*****', '--type', 'Standard', '--tags', '*****=*****', '--output', 'none', '--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 0x7feaf86108b0>, <function OutputProducer.on_global_arguments at 0x7feaf852fca0>, <function CLIQuery.on_global_arguments at 0x7feaf85561f0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'ppg': ['azure.cli.command_modules.vm']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name                  Load Time    Groups  Commands
cli.azure.cli.core: vm                        0.043        56       292
cli.azure.cli.core: Total (1)                 0.043        56       292
cli.azure.cli.core: Loaded 56 groups, 292 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command  : ppg create
cli.azure.cli.core: Command table: ppg create
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7feaf7c9e040>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/root/.azure/commands/2022-08-16.03-22-37.ppg_create.165169.log'.
az_command_data_logger: command args: ppg create --resource-group {} --location {} --name {} --type {} --tags {} --output {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x7feaf7685670>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x7feaf7685700>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x7feaf7685820>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7feaf852fd30>, <function CLIQuery.handle_query_parameter at 0x7feaf8556280>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x7feaf7685790>]
cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ComputeManagementClient
cli.azure.cli.core.auth.persistence: build_persistence: location='/root/.azure/msal_token_cache.json', encrypt=****&
cli.azure.cli.core.auth.binary_cache: load: /root/.azure/msal_http_cache.bin
urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
msal.authority: openid_config = {'token_endpoint': '*****', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': '*****', 'response_modes_supported': ['query', 'fragment', 'form_post'], 'subject_types_supported': ['pairwise'], 'id_token_signing_alg_values_supported': ['RS256'], 'response_types_supported': ['code', 'id_token', 'code id_token', 'id_token token'], 'scopes_supported': ['openid', 'profile', 'email', 'offline_access'], 'issuer': '*****', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': '*****', 'device_authorization_endpoint': '*****', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': '*****', 'claims_supported': ['sub', 'iss', 'cloud_instance_name', 'cloud_instance_host_name', 'cloud_graph_host_name', 'msgraph_host', 'aud', 'exp', 'iat', 'auth_time', 'acr', 'nonce', 'preferred_username', 'name', 'tid', 'ver', 'at_hash', 'c_hash', 'email'], 'kerberos_endpoint': '*****', 'tenant_region_scope': 'NA', 'cloud_instance_name': 'microsoftonline.com', 'cloud_graph_host_name': 'graph.windows.net', 'msgraph_host': 'graph.microsoft.com', 'rbac_url': 'https://pas.windows.net'}
msrest.serialization: Readonly attribute name will be ignored in class <class 'azure.mgmt.compute.v2022_03_01.models._models_py3.ProximityPlacementGroup'>
msrest.exceptions: Parameter 'tags' must be of type 'dict[str, str]'
cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception:
cli.azure.cli.core.util: Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/conda/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/conda/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/conda/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/opt/conda/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/conda/lib/python3.8/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/conda/lib/python3.8/site-packages/azure/cli/command_modules/vm/custom.py", line 4547, in create_proximity_placement_group
    return client.create_or_update(resource_group_name=resource_group_name,
  File "/opt/conda/lib/python3.8/site-packages/azure/core/tracing/decorator.py", line 78, in wrapper_use_tracer
    return func(*args, **kwargs)
  File "/opt/conda/lib/python3.8/site-packages/azure/mgmt/compute/v2022_03_01/operations/_proximity_placement_groups_operations.py", line 311, in create_or_update
    _json = self._serialize.body(parameters, 'ProximityPlacementGroup')
  File "/opt/conda/lib/python3.8/site-packages/msrest/serialization.py", line 628, in body
    errors = _recursive_validate(data_type, data_type, data)
  File "/opt/conda/lib/python3.8/site-packages/msrest/serialization.py", line 160, in _recursive_validate
    return data.validate()
  File "/opt/conda/lib/python3.8/site-packages/msrest/serialization.py", line 254, in validate
    validation_result += _recursive_validate(attr_name, attr_type, value)
  File "/opt/conda/lib/python3.8/site-packages/msrest/serialization.py", line 156, in _recursive_validate
    raise ValidationError("type", attr_name, attr_type)
msrest.exceptions.ValidationError: Parameter 'tags' must be of type 'dict[str, str]'

cli.azure.cli.core.azclierror: Parameter 'tags' must be of type 'dict[str, str]'
az_command_data_logger: Parameter 'tags' must be of type 'dict[str, str]'
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7feaf7c9e280>]
az_command_data_logger: exit code: 1
cli.__main__: Command ran in 0.552 seconds (init: 0.288, invoke: 0.264)
telemetry.save: Save telemetry record of length 3131 in cache
telemetry.check: Negative: The /root/.azure/telemetry.txt was modified at 2022-08-16 03:16:12.042237, which in less than 600.000000 s
@ghost ghost added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot Graph az ad labels Aug 16, 2022
@ghost ghost assigned jiasli Aug 16, 2022
@ghost ghost added this to the Backlog milestone Aug 16, 2022
@yonzhan yonzhan added Compute - PPG az ppg Compute az vm/vmss/image/disk/snapshot labels Aug 16, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Aug 16, 2022

ppg

@zhoxing-ms
Copy link
Contributor

zhoxing-ms commented Aug 16, 2022

This problem was introduced by PR #23167, which is similar to problem #23194, and can be solved by referring to PR #23393. @yanzhudd Please help take a look

@yonzhan yonzhan added Azure CLI Team The command of the issue is owned by Azure CLI team bug This issue requires a change to an existing behavior in the product in order to be resolved. and removed Graph az ad labels Aug 16, 2022
pull bot pushed a commit to blackzilla2126/azure-cli that referenced this issue Aug 16, 2022
…ust be of type dict` error when `--tags` parameter is passed as `key=value` pairs (Azure#23543)

* fix

* style check
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 bug This issue requires a change to an existing behavior in the product in order to be resolved. Compute - PPG az ppg Compute az vm/vmss/image/disk/snapshot customer-reported Issues that are reported by GitHub users external to the Azure organization.
Projects
None yet
4 participants