Azure / azure-cli

Azure Command-Line Interface
MIT License
4k stars 2.98k forks source link

az iot central diagnostic validate-messages "unexpected error" #23075

Closed TheRealDeomax closed 2 years ago

TheRealDeomax commented 2 years ago

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name ``az iot central diagnostic validate-messages

Errors:

 az iot central diagnostics validate-messages --app-id "6429cdff-b777-4af8-8d29-ee3bdf264e00" --device-id "room-device-01" --style scroll
Command group 'iot central diagnostics' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
The command failed with an unexpected error. Here is the traceback:
gather() got an unexpected keyword argument 'loop'
Traceback (most recent call last):
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 663, in execute
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 697, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 333, in __call__
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
sages
    provider.start_validate_messages(telemetry_args)
  File "C:\Users\pn07502\.azure\cliextensions\azure-iot\azext_iot\central\providers\monitor_provider.py", line 67, in start_validate_messages
    telemetry.start_multiple_monitors(
  File "C:\Users\pn07502\.azure\cliextensions\azure-iot\azext_iot\monitor\telemetry.py", line 67, in start_multiple_monitors
    future = asyncio.gather(*coroutines, loop=loop, return_exceptions=True)
TypeError: gather() got an unexpected keyword argument 'loop'

To Reproduce:

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

I added a new device.

I ran this code filling in the deviceid, primary key, and idscope. https://github.com/JurgenOnAzure/microsoft-azure-iot-developer-manage-iot-devices-azure-iot-central

all the other commands worked like "az iot central diagnostics monitor-properties , "az iot central diagnostics registration-summary --app-id

validate-message errored out

Expected Behavior

I was expect iot messages on the console.

Environment Summary

Windows-10-10.0.19042-SP0
Python 3.10.4
Installer: MSI

azure-cli 2.37.0

Extensions:
account 0.2.1
azure-iot 0.10.10
interactive 0.4.4
storage-preview 0.8.0

Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1

Additional Context

yonzhan commented 2 years ago

route to CXP team

navba-MSFT commented 2 years ago

@TheRealDeomax 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 2 years ago

@TheRealDeomax I see that you are using an older version of azure-iotextension. Could you please update your azure-iotextension using the below command and test your CLI command again ?

az extension update -n azure-iot

Awaiting your reply.

TheRealDeomax commented 2 years ago

It works! PS C:> az iot central diagnostics validate-messages --app-id "2a92d412-7f6a-40e1-82d8-a307b3abc549" Command group 'iot central diagnostics' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus Validating telemetry. Exiting after 300 second(s), or 10 message(s) have been parsed (whichever happens first). Processed 5 messages... Processed 10 messages... Successfully parsed 10 message(s). No errors detected after parsing 10 message(s). Stopping event monitor... PS C:>

-Thank you!

TheRealDeomax commented 2 years ago

Thanks again!