Azure / Azure/azure-cli-extensions

[load] 'NoneType' object has no attribute 'get' using az load test update

Open
#10,009 2 comments 1 reaction 2 assignees Claimed by @a0x1ab View on GitHub
Service Attention
Dominant language
Python
Stars
454
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
64

Description

Source: https://github.com/Azure/azure-cli/issues/32748 (by @JljHook)
Affected extension: `load` (`src/load/`)

---

<<>>
# Issue #32748 (by @JljHook)
## Title
'NoneType' object has no attribute 'get' using az load test update

## Body
### Describe the bug

az cli version: 2.83.0
Trying to update load test. Command fails.
Command:
az load test update --test-id xxxx --display-name "Load Test - Invoice Creation Deletion" --description "JMeter load test for Invoice Creation and Deletion for Core and Public" --load-test-resource yyyyyy --resource-group xxxx --load-test-config-file jmeter-loadtest.config.yaml

### Related command

az load test update --test-id xxxx --display-name "Load Test - Invoice Creation Deletion" --description "JMeter load test for Invoice Creation and Deletion for Core and Public" --load-test-resource yyyyyy --resource-group xxxx --load-test-config-file jmeter-loadtest.config.yaml

### Errors

Error:
The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'get'
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 669, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 737, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 706, in _run_job
result = cmd_copy(params)
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 336, in __call__
return self.handler(*args, **kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler
return op(**command_args)

### Issue script & Debug output

cli.azext_load.data_plane.load_test.custom: Uploading files to test load-test-invoice-creation-deletion
urllib3.connectionpool: https://fb1e0d61-0501-44af-9e65-e3e2cf4c1663.northeurope.cnt-prod.loadtesting.azure.com:443 "GET /tests/load-test-invoice-creation-deletion/files?api-version=2025-03-01-preview HTTP/1.1" 200 12
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 669, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 737, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 706, in _run_job
result = cmd_copy(params)
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 336, in __call__
return self.handler(*args, **kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler
return op(**command_args)
File "/Users/user.user/.azure/cliextensions/load/azext_load/data_plane/load_test/custom.py", line 277, in update_test
upload_files_helper(
~~~~~~~~~~~~~~~~~~~^
client, test_id, yaml, test_plan, load_test_config_file, not custom_no_wait, body.get("kind")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/Users/user.user/.azure/cliextensions/load/azext_load/data_plane/utils/utils.py", line 962, in upload_files_helper
upload_properties_file_helper(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
client=client,
^^^^^^^^^^^^^^
test_id=test_id, yaml_data=yaml_data,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
load_test_config_file=load_test_config_file, existing_test_files=files, wait=wait)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/user.user/.azure/cliextensions/load/azext_load/data_plane/utils/utils.py", line 854, in upload_properties_file_helper
if yaml_data and yaml_data.get("properties", {}).get("userPropertyFile") is not None:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

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: 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 669, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 737, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 706, in _run_job
result = cmd_copy(params)
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 336, in __call__
return self.handler(*args, **kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler
return op(**command_args)
File "/Users/user.user/.azure/cliextensions/load/azext_load/data_plane/load_test/custom.py", line 277, in update_test
upload_files_helper(
~~~~~~~~~~~~~~~~~~~^
client, test_id, yaml, test_plan, load_test_config_file, not custom_no_wait, body.get("kind")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/Users/user.user/.azure/cliextensions/load/azext_load/data_plane/utils/utils.py", line 962, in upload_files_helper
upload_properties_file_helper(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
client=client,
^^^^^^^^^^^^^^
test_id=test_id, yaml_data=yaml_data,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
load_test_config_file=load_test_config_file, existing_test_files=files, wait=wait)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/user.user/.azure/cliextensions/load/azext_load/data_plane/utils/utils.py", line 854, in upload_properties_file_helper
if yaml_data and yaml_data.get("properties", {}).get("userPropertyFile") is not None:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
az_command_data_logger: 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/homebrew/Cellar/azure-cli/2.83.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 669, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.8
... [truncated, original was 11600 chars]

## Comments
### Comment by @yonzhan

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.