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

Deserialization error with az guestconfig guest-configuration-assignment create #30528

Open
Dieff opened this issue Dec 16, 2024 · 2 comments
Open
Labels
Auto-Resolve Auto resolve by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.

Comments

@Dieff
Copy link

Dieff commented Dec 16, 2024

Describe the bug

Attempting to create a new azure machine configuration guest configuration assignment will fail immediately with a deserialization error. This occurs even when using the example create command from the azure docs.

Related command

az guestconfig guest-configuration-assignment create

Errors

The command failed with an unexpected error. Here is the traceback:
('Unable to build a model: ("Unable to deserialize response data. Data: {}, [AssignmentReportResource], DeserializationError: Cannot deserialize as [AssignmentReportResource] an object of type <class \'str\'>", DeserializationError("Cannot deserialize as [AssignmentReportResource] an object of type <class \'str\'>")), DeserializationError: ("Unable to deserialize response data. Data: {}, [AssignmentReportResource], DeserializationError: Cannot deserialize as [AssignmentReportResource] an object of type <class \'str\'>", DeserializationError("Cannot deserialize as [AssignmentReportResource] an object of type <class \'str\'>"))', DeserializationError("Unable to deserialize response data. Data: {}, [AssignmentReportResource], DeserializationError: Cannot deserialize as [AssignmentReportResource] an object of type <class 'str'>", DeserializationError("Cannot deserialize as [AssignmentReportResource] an object of type <class 'str'>")))
Traceback (most recent call last):
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 1626, in deserialize_data
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 1653, in deserialize_iter
azure.core.exceptions.DeserializationError: Cannot deserialize as [AssignmentReportResource] an object of type <class 'str'>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 622, in body
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 1406, in _deserialize
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 1415, in _deserialize
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 1637, in deserialize_data
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/exceptions.py", line 51, in raise_with_traceback
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 1626, in deserialize_data
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 1653, in deserialize_iter
azure.core.exceptions.DeserializationError: ("Unable to deserialize response data. Data: {}, [AssignmentReportResource], DeserializationError: Cannot deserialize as [AssignmentReportResource] an object of type <class 'str'>", DeserializationError("Cannot deserialize as [AssignmentReportResource] an object of type <class 'str'>"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 666, in execute
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 733, in _run_jobs_serially
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 703, in _run_job
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 336, in __call__
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
  File "C:\Users\dieffenbache2\.azure\cliextensions\guestconfig\azext_guestconfig\generated\custom.py", line 47, in guestconfig_guest_configuration_assignment_create
    return sdk_no_wait(no_wait,
           ^^^^^^^^^^^^^^^^^^^^
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/util.py", line 708, in sdk_no_wait
  File "C:\Users\dieffenbache2\.azure\cliextensions\guestconfig\azext_guestconfig\vendored_sdks\guestconfig\operations\_guest_configuration_assignment_operations.py", line 185, in begin_create_or_update
    raw_result = self._create_or_update_initial(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dieffenbache2\.azure\cliextensions\guestconfig\azext_guestconfig\vendored_sdks\guestconfig\operations\_guest_configuration_assignment_operations.py", line 97, in _create_or_update_initial
    body_content = self._serialize.body(_parameters, 'GuestConfigurationAssignment')
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 624, in body
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/exceptions.py", line 51, in raise_with_traceback
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 622, in body
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 1406, in _deserialize
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 1415, in _deserialize
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 1637, in deserialize_data
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/exceptions.py", line 51, in raise_with_traceback
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 1626, in deserialize_data
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 1653, in deserialize_iter
azure.core.exceptions.SerializationError: ('Unable to build a model: ("Unable to deserialize response data. Data: {}, [AssignmentReportResource], DeserializationError: Cannot deserialize as [AssignmentReportResource] an object of type <class \'str\'>", DeserializationError("Cannot deserialize as [AssignmentReportResource] an object of type <class \'str\'>")), DeserializationError: ("Unable to deserialize response data. Data: {}, [AssignmentReportResource], DeserializationError: Cannot deserialize as [AssignmentReportResource] an object of type <class \'str\'>", DeserializationError("Cannot deserialize as [AssignmentReportResource] an object of type <class \'str\'>"))', DeserializationError("Unable to deserialize response data. Data: {}, [AssignmentReportResource], DeserializationError: Cannot deserialize as [AssignmentReportResource] an object of type <class 'str'>", DeserializationError("Cannot deserialize as [AssignmentReportResource] an object of type <class 'str'>")))
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Issue script & Debug output

az guestconfig guest-configuration-assignment create --guest-configuration-assignment-name "WhitelistedApplication" --guest-configuration-name "WhitelistedApplication" --location "westcentralus" --context "Azure policy" --guest-configuration-name "WhitelistedApplication" --guest-configuration-configuration-parameter name="[InstalledApplication]bwhitelistedapp;Name" value="NotePad,sql" --guest-configuration-configuration-setting action-after-reboot="ContinueConfiguration" configuration-mode="MonitorOnly" configuration-mode-frequency-mins=15 reboot-if-needed="False" --guest-configuration-version "1.*" --resource-group "myResourceGroupName" --vm-name "myVMName"

Expected behavior

Even if the wrong parameters are given, the error message should explain the problem with the argument. It should not be a Python stack trace.

Environment Summary

❯ az --version
azure-cli 2.66.0 *

core 2.66.0 *
telemetry 1.1.0

Extensions:
account 0.2.5
bastion 1.0.1
guestconfig 0.1.1
log-analytics-solution 1.0.0
monitor-control-service 1.1.0
storage-preview 1.0.0b4

Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1

Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\dieffenbache2.azure\cliextensions'

Python (Windows) 3.12.7 (tags/v3.12.7:0b05ead, Oct 1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]

Legal docs and information: aka.ms/AzureCliLegal

Additional context

No response

@Dieff Dieff added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Dec 16, 2024
Copy link

Hi @Dieff,

2.66.0 is not the latest Azure CLI(2.67.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

@azure-client-tools-bot-prd azure-client-tools-bot-prd bot added the Auto-Resolve Auto resolve by bot label Dec 16, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Dec 16, 2024

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

@microsoft-github-policy-service microsoft-github-policy-service bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Dec 16, 2024
@yonzhan yonzhan added the Service Attention This issue is responsible by Azure service team. label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Resolve Auto resolve by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

2 participants