Azure / azure-cli

Azure Command-Line Interface
MIT License
3.92k stars 2.88k forks source link

az servicebus georecovery-alias list fails if there are no aliases avaliable. #25458

Open vilit1 opened 1 year ago

vilit1 commented 1 year ago

This is autogenerated. Please review and update as needed.

Describe the bug

This occurs with az servicebus georecovery-alias list if there are no aliases avaliable. For example, if you run this command with a standard or basic servicebus namespace.

Command Name az servicebus georecovery-alias list

Errors:

The command failed with an unexpected error. Here is the traceback:
'NoneType' object is not iterable
Traceback (most recent call last):
  File "C:\repo\venv38\lib\site-packages\knack\cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "c:\repo\azure-cli\src\azure-cli-core\azure\cli\core\commands\__init__.py", line 658, in execute
    raise ex
  File "c:\repo\azure-cli\src\azure-cli-core\azure\cli\core\commands\__init__.py", line 721, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "c:\repo\azure-cli\src\azure-cli-core\azure\cli\core\commands\__init__.py", line 705, in _run_job
    result = list(result)
  File "C:\repo\extensions\azure-iot\azure\core\paging.py", line 132, in __next__
    return next(self._page_iterator)
  File "C:\repo\extensions\azure-iot\azure\core\paging.py", line 84, in __next__
    self.continuation_token, self._current_page = self._extract_data(self._response)
  File "C:\repo\venv38\lib\site-packages\azure\mgmt\servicebus\operations\_disaster_recovery_configs_operations.py", line 172, in extract_data
    return deserialized.next_link or None, iter(list_of_elem)
TypeError: 'NoneType' object is not iterable

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

Expected Behavior

Environment Summary

Windows-10-10.0.22621-SP0
Python 3.8.3
Installer: PIP

azure-cli 2.32.0 *

Extensions:
azure-iot 255.255.1.2

Dependencies:
msal 1.21.0
azure-mgmt-resource 20.0.0

Additional Context

vilit1 commented 1 year ago

This is most likely the same paging issue as here https://github.com/Azure/azure-cli/issues/18866

yonzhan commented 1 year ago

route to CXP team

navba-MSFT commented 1 year ago

@vilit1 Apologies for the late reply. Thanks for reaching out to us and reporting this issue. We are looking into this issue and we will provide an update.

navba-MSFT commented 1 year ago

@vilit1 Could you please run the below command and test ?

az rest --url "https://management.azure.com/subscriptions/{subID}/resourceGroups/{RG}/providers/Microsoft.ServiceBus/namespaces/{SBNamespace}/disasterRecoveryConfigs?api-version=2022-01-01-preview"

PS: Update your Subscription ID, RG Name and SB namespace in the placeholder.

vilit1 commented 1 year ago

First call is to a servicebus that has a disaster recovery config and the second is to one that does not

image
navba-MSFT commented 1 year ago

@vilit1 We had a discussion over teams internally. You have confirmed that the az rest and az resource show command does help. However, your ask is particularly regarding the az servicebus georecovery-alias list CLI command.

The failure is occurring in this function: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_disaster_recovery_configs_operations.py#L511

Since this is Code is generated by AutoRest Code Generator. I am adding the Service team to look into this further.

ghost commented 1 year ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Saglodha.

Issue Details
### **This is autogenerated. Please review and update as needed.** ## Describe the bug This occurs with `az servicebus georecovery-alias list` if there are no aliases avaliable. For example, if you run this command with a standard or basic servicebus namespace. **Command Name** `az servicebus georecovery-alias list` **Errors:** ``` The command failed with an unexpected error. Here is the traceback: 'NoneType' object is not iterable Traceback (most recent call last): File "C:\repo\venv38\lib\site-packages\knack\cli.py", line 231, in invoke cmd_result = self.invocation.execute(args) File "c:\repo\azure-cli\src\azure-cli-core\azure\cli\core\commands\__init__.py", line 658, in execute raise ex File "c:\repo\azure-cli\src\azure-cli-core\azure\cli\core\commands\__init__.py", line 721, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) File "c:\repo\azure-cli\src\azure-cli-core\azure\cli\core\commands\__init__.py", line 705, in _run_job result = list(result) File "C:\repo\extensions\azure-iot\azure\core\paging.py", line 132, in __next__ return next(self._page_iterator) File "C:\repo\extensions\azure-iot\azure\core\paging.py", line 84, in __next__ self.continuation_token, self._current_page = self._extract_data(self._response) File "C:\repo\venv38\lib\site-packages\azure\mgmt\servicebus\operations\_disaster_recovery_configs_operations.py", line 172, in extract_data return deserialized.next_link or None, iter(list_of_elem) TypeError: 'NoneType' object is not iterable ``` ## To Reproduce: Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information. - Create a Standard servicebus namespace - `az servicebus georecovery-alias list --namespace-name {} -g {}` ## Expected Behavior ## Environment Summary ``` Windows-10-10.0.22621-SP0 Python 3.8.3 Installer: PIP azure-cli 2.32.0 * Extensions: azure-iot 255.255.1.2 Dependencies: msal 1.21.0 azure-mgmt-resource 20.0.0 ``` ## Additional Context
Author: vilit1
Assignees: -
Labels: `bug`, `Service Attention`, `Service Bus`, `needs-team-attention`, `Auto-Assign`
Milestone: -
Saglodha commented 1 year ago

Hi @vilit1 , we are working on the issue and having internal investigation. I would come back soon with fresh updates. Thanks for your co-operation.

schaudhari6254888 commented 3 months ago

Hey @vilit1 , this bug is fixed now. you can try the command now. when list is empty it will through a empty array. image