Azure/azure-iot-cli-extension

Cannot execute `az iot hub monitor-events`

aYukiYoshida opened this issue · 2 comments

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name
az iot hub monitor-events Extension Name: azure-iot. Version: 0.11.0.

Errors:

The command failed with an unexpected error. Here is the traceback:
cannot import name 'c_uamqp' from partially initialized module 'uamqp' (most likely due to a circular import) (/Users/yyoshida/.azure/cliextensions/azure-iot/uamqp/__init__.py)
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.33.0/libexec/lib/python3.10/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/Cellar/azure-cli/2.33.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 658, in execute
    raise ex
  File "/usr/local/Cellar/azure-cli/2.33.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/usr/local/Cellar/azure-cli/2.33.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 692, in _run_job
    result = cmd_copy(params)
  File "/usr/local/Cellar/azure-cli/2.33.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/Cellar/azure-cli/2.33.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/Users/yyoshida/.azure/cliextensions/azure-iot/azext_iot/operations/hub.py", line 2942, in iot_hub_monitor_events
    _iot_hub_monitor_events(
  File "/Users/yyoshida/.azure/cliextensions/azure-iot/azext_iot/operations/hub.py", line 3055, in _iot_hub_monitor_events
    from azext_iot.monitor.builders import hub_target_builder
  File "/Users/yyoshida/.azure/cliextensions/azure-iot/azext_iot/monitor/builders/hub_target_builder.py", line 8, in <module>
    import uamqp
  File "/Users/yyoshida/.azure/cliextensions/azure-iot/uamqp/__init__.py", line 12, in <module>
    from uamqp import c_uamqp  # pylint: disable=import-self
ImportError: cannot import name 'c_uamqp' from partially initialized module 'uamqp' (most likely due to a circular import) (/Users/yyoshida/.azure/cliextensions/azure-iot/uamqp/__init__.py)

To Reproduce:

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

  • Put any pre-requisite steps here...
  • az iot hub monitor-events --hub-name {} --properties {} -d {}

Expected Behavior

Environment Summary

macOS-10.15.7-x86_64-i386-64bit, Darwin 19.6.0
Python 3.10.2
Installer: HOMEBREW

azure-cli 2.33.0

Extensions:
azure-iot 0.11.0

Dependencies:
msal 1.16.0
azure-mgmt-resource 20.0.0

Additional Context

Sorry, I fixed this problem with updating extension by following command.

% az extension update --name azure-iot

Thank you for reporting back on the fix.