Azure / azure-iot-cli-extension

Azure IoT extension for Azure CLI
Other
83 stars 65 forks source link

unable to run `az iot hub monitor-events` on M1 macbook #527

Closed danielschickmunit closed 2 years ago

danielschickmunit commented 2 years ago

This is autogenerated. Please review and update as needed.

Describe the bug

Hi, I'm was testing to run az iot hub monitor-events command and it crashed on me with that error i've installed azure-cli via homebrew running the newest version of azure-cli with python 3.10

$ az --version
azure-cli                         2.37.0

core                              2.37.0
telemetry                          1.0.6

Extensions:
azure-iot                         0.14.1

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

Python location '/opt/homebrew/Cellar/azure-cli/2.37.0/libexec/bin/python' Extensions directory '/Users/daniel/.azure/cliextensions'

Python (Darwin) 3.10.4 (main, Apr 26 2022, 19:36:29) [Clang 13.1.6 (clang-1316.0.21.2)]

image

Hardware-Übersicht:

Modellname: MacBook Pro Modell-Identifizierung: MacBookPro17,1 Chip: Apple M1 Gesamtanzahl der Kerne: 8 (4 Leistung und 4 Effizienz) Speicher: 16 GB Systemfirmwareversion: 7459.101.3 OS-Ladeprogrammversion: 7459.101.3 Seriennummer (System): FVFH86A4Q05N Hardware-UUID: 46F3D6C4-9E6F-5804-8826-CD7A25095A2D Bereitstellungs-UDID: 00008103-0014719A0E53001E Status der Aktivierungssperre: Aktiviert

I've tested it successfully on a X86_64 Linux machine running Ubuntu 20.04.3 LTS running the following versions


$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:    20.04
Codename:   focal

$ az --version

azure-cli                         2.32.0 *

core                              2.32.0 *
telemetry                          1.0.6

Extensions:
azure-iot                         0.14.1

Dependencies:
msal                              1.16.0
azure-mgmt-resource               20.0.0

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

Errors:

The command failed with an unexpected error. Here is the traceback:
dlopen(/Users/daniel/.azure/cliextensions/azure-iot/uamqp/c_uamqp.cpython-310-darwin.so, 0x0002): tried: '/Users/daniel/.azure/cliextensions/azure-iot/uamqp/c_uamqp.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.36.0/libexec/lib/python3.10/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/homebrew/Cellar/azure-cli/2.36.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 658, in execute
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.36.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 "/opt/homebrew/Cellar/azure-cli/2.36.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 692, in _run_job
    result = cmd_copy(params)
  File "/opt/homebrew/Cellar/azure-cli/2.36.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/homebrew/Cellar/azure-cli/2.36.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/Users/daniel/.azure/cliextensions/azure-iot/azext_iot/operations/hub.py", line 2958, in iot_hub_monitor_events
    _iot_hub_monitor_events(
  File "/Users/daniel/.azure/cliextensions/azure-iot/azext_iot/operations/hub.py", line 3071, in _iot_hub_monitor_events
    from azext_iot.monitor.builders import hub_target_builder
  File "/Users/daniel/.azure/cliextensions/azure-iot/azext_iot/monitor/builders/hub_target_builder.py", line 8, in <module>
    import uamqp
  File "/Users/daniel/.azure/cliextensions/azure-iot/uamqp/__init__.py", line 12, in <module>
    from uamqp import c_uamqp  # pylint: disable=import-self
ImportError: dlopen(/Users/daniel/.azure/cliextensions/azure-iot/uamqp/c_uamqp.cpython-310-darwin.so, 0x0002): tried: '/Users/daniel/.azure/cliextensions/azure-iot/uamqp/c_uamqp.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

To Reproduce:

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

Expected Behavior

Starting event monitor, filtering on device: <DEVICE>, use ctrl-c to stop...

Environment Summary

macOS-12.3.1-arm64-arm-64bit, Darwin 21.4.0
Python 3.10.4
Installer: HOMEBREW

azure-cli 2.36.0 *

Extensions:
azure-iot 0.14.1

Dependencies:
msal 1.17.0
azure-mgmt-resource 20.0.0

Additional Context

danielschickmunit commented 2 years ago

just found that it's a duplicate of #512 and #468

closing this issue