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

[bug] Azure IoT Hub Monitor on M1 Mac returns "INCOMPATIBLE ARCHITECTURE" error #512

Open
codehampster opened this issue Apr 27, 2022 · 3 comments

Comments

@codehampster
Copy link

codehampster commented Apr 27, 2022

Describe the bug

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

Errors:

The command failed with an unexpected error. Here is the traceback:
dlopen(/Users/XXXX/.azure/cliextensions/azure-iot/uamqp/c_uamqp.cpython-310-darwin.so, 0x0002): tried: '/Users/XXXX/.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/XXXX/.azure/cliextensions/azure-iot/azext_iot/operations/hub.py", line 2958, in iot_hub_monitor_events
    _iot_hub_monitor_events(
  File "/Users/XXXX/.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/XXXX/.azure/cliextensions/azure-iot/azext_iot/monitor/builders/hub_target_builder.py", line 8, in <module>
    import uamqp
  File "/Users/XXXX/.azure/cliextensions/azure-iot/uamqp/__init__.py", line 12, in <module>
    from uamqp import c_uamqp  # pylint: disable=import-self
ImportError: dlopen(/Users/XXXX/.azure/cliextensions/azure-iot/uamqp/c_uamqp.cpython-310-darwin.so, 0x0002): tried: '/Users/XXXX/.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.

az iot hub monitor-events -n XXXX --login 'HostName= XXXX.azure-devices.net;SharedAccessKeyName= XXXX;SharedAccessKey=XXXX'

  • Put any pre-requisite steps here...
  • az iot hub monitor-events -n {} --login {}

Expected Behavior

Environment Summary

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

azure-cli 2.36.0

Extensions:
azure-iot 0.14.0

Dependencies:
msal 1.17.0
azure-mgmt-resource 20.0.0

Additional Context

@codehampster codehampster changed the title Azure IoT Hub Monitor on M1 Mac returns this error Azure IoT Hub Monitor on M1 Mac returns "INCOMPATIBLE ARCHITECTURE" error Apr 27, 2022
@codehampster codehampster changed the title Azure IoT Hub Monitor on M1 Mac returns "INCOMPATIBLE ARCHITECTURE" error [bug] Azure IoT Hub Monitor on M1 Mac returns "INCOMPATIBLE ARCHITECTURE" error Apr 27, 2022
@vilit1
Copy link
Contributor

vilit1 commented Jun 14, 2022

Can you try running the command with repair:
az iot hub monitor-events --hub-name {} --device-id {} -r

The uamqp package has issues with certain versions and the repair command will reinstall uamqp with the correct version (that has no issues)

If these issues still persist, please let me know!

@lavenderddliu
Copy link

Can you try running the command with repair: az iot hub monitor-events --hub-name {} --device-id {} -r

The uamqp package has issues with certain versions and the repair command will reinstall uamqp with the correct version (that has no issues)

If these issues still persist, please let me know!

Same issue. Tired -r flag, it doesn't work~

@lavenderddliu
Copy link

solved in this way #468

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants