Skip to content

az iot hub monitor-events and uamqp #31236

@kspeeckaert

Description

@kspeeckaert

Describe the bug

The az iot hub monitor-events docs state that:

This command relies on and may install dependent Cython package (uamqp) upon first execution. https://github.com/Azure/azure-uamqp-python

Navigating to that repo reads:

This repo is no longer in active maintenance and we plan on deprecating it sometime in the first quarter of 2025.

Trying to install it on macOS 15.4 with Python 3.13.2 fails, and when using the container image (docker run -it mcr.microsoft.com/azure-cli:cbl-mariner2.0), the result is very much the same.

To be clear: this bug report details the errors received using the container version.

Related command

az iot hub monitor-events --hub-name HUB_NAME --resource-group RG_NAME --device-id DEVICE_ID

Errors

Preview version of extension is disabled by default for extension installation, enabled for modules without stable versions.
Please run 'az config set extension.dynamic_install_allow_preview=true or false' to config it specifically.
The command requires the extension azure-iot. Do you want to install it now? The command will continue to run after the extension is installed. (Y/n):
Run 'az config set extension.use_dynamic_install=yes_without_prompt' to allow installing extensions without prompt.
Dependency update (uamqp 1.2) required for IoT extension version: 0.25.0.
Continue? (y/n) -> y
Updating required dependency...
Failure updating uamqp. Aborting...
Collecting uamqp~=1.2
  Downloading uamqp-1.6.11.tar.gz (4.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.6/4.6 MB 33.1 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting certifi>=2017.4.17 (from uamqp~=1.2)
  Downloading certifi-2025.1.31-py3-none-any.whl.metadata (2.5 kB)
Downloading certifi-2025.1.31-py3-none-any.whl (166 kB)
Building wheels for collected packages: uamqp
  Building wheel for uamqp (pyproject.toml): started
  Building wheel for uamqp (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error

  × Building wheel for uamqp (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [123 lines of output]
      /tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!

              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:

              License :: OSI Approved :: MIT License

              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************

      !!
        self._finalize_license_expression()
      running bdist_wheel
      running build
      running build_py
      creating build/lib.linux-aarch64-cpython-39/uamqp
      copying uamqp/__init__.py -> build/lib.linux-aarch64-cpython-39/uamqp
      copying uamqp/address.py -> build/lib.linux-aarch64-cpython-39/uamqp
      copying uamqp/client.py -> build/lib.linux-aarch64-cpython-39/uamqp
      copying uamqp/compat.py -> build/lib.linux-aarch64-cpython-39/uamqp
      copying uamqp/connection.py -> build/lib.linux-aarch64-cpython-39/uamqp
      copying uamqp/constants.py -> build/lib.linux-aarch64-cpython-39/uamqp
      copying uamqp/errors.py -> build/lib.linux-aarch64-cpython-39/uamqp
      copying uamqp/message.py -> build/lib.linux-aarch64-cpython-39/uamqp
      copying uamqp/mgmt_operation.py -> build/lib.linux-aarch64-cpython-39/uamqp
      copying uamqp/receiver.py -> build/lib.linux-aarch64-cpython-39/uamqp
      copying uamqp/sender.py -> build/lib.linux-aarch64-cpython-39/uamqp
      copying uamqp/session.py -> build/lib.linux-aarch64-cpython-39/uamqp
      copying uamqp/types.py -> build/lib.linux-aarch64-cpython-39/uamqp
      copying uamqp/utils.py -> build/lib.linux-aarch64-cpython-39/uamqp
      creating build/lib.linux-aarch64-cpython-39/uamqp/async_ops
      copying uamqp/async_ops/__init__.py -> build/lib.linux-aarch64-cpython-39/uamqp/async_ops
      copying uamqp/async_ops/client_async.py -> build/lib.linux-aarch64-cpython-39/uamqp/async_ops
      copying uamqp/async_ops/connection_async.py -> build/lib.linux-aarch64-cpython-39/uamqp/async_ops
      copying uamqp/async_ops/mgmt_operation_async.py -> build/lib.linux-aarch64-cpython-39/uamqp/async_ops
      copying uamqp/async_ops/receiver_async.py -> build/lib.linux-aarch64-cpython-39/uamqp/async_ops
      copying uamqp/async_ops/sender_async.py -> build/lib.linux-aarch64-cpython-39/uamqp/async_ops
      copying uamqp/async_ops/session_async.py -> build/lib.linux-aarch64-cpython-39/uamqp/async_ops
      copying uamqp/async_ops/utils.py -> build/lib.linux-aarch64-cpython-39/uamqp/async_ops
      creating build/lib.linux-aarch64-cpython-39/uamqp/authentication
      copying uamqp/authentication/__init__.py -> build/lib.linux-aarch64-cpython-39/uamqp/authentication
      copying uamqp/authentication/cbs_auth.py -> build/lib.linux-aarch64-cpython-39/uamqp/authentication
      copying uamqp/authentication/cbs_auth_async.py -> build/lib.linux-aarch64-cpython-39/uamqp/authentication
      copying uamqp/authentication/common.py -> build/lib.linux-aarch64-cpython-39/uamqp/authentication
      running egg_info
      writing uamqp.egg-info/PKG-INFO
      writing dependency_links to uamqp.egg-info/dependency_links.txt
      writing requirements to uamqp.egg-info/requires.txt
      writing top-level names to uamqp.egg-info/top_level.txt
      reading manifest file 'uamqp.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file 'uamqp.egg-info/SOURCES.txt'
      copying uamqp/c_uamqp.c -> build/lib.linux-aarch64-cpython-39/uamqp
      running build_ext
      will build uamqp in build/temp.linux-aarch64-cpython-39/cmake
      Building with generator flags: -G "Unix Makefiles"
      calling cmake /tmp/pip-install-uvgy9n6w/uamqp_548c6b46ae1b437ba4fa083e496c99ee/src/vendor/azure-uamqp-c/ -G "Unix Makefiles" -Duse_openssl:bool=ON -Duse_default_uuid:bool=ON  -Duse_builtin_httpapi:bool=ON  -Dskip_samples:bool=ON -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release
      CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required):
        Compatibility with CMake < 3.10 will be removed from a future version of
        CMake.

        Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
        to tell CMake that the project requires at least <min> but has been updated
        to work with policies introduced by <max> or earlier.


      CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
      CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
      CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
      -- Configuring incomplete, errors occurred!
      Traceback (most recent call last):
        File "/usr/lib64/az/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
        File "/usr/lib64/az/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
        File "/usr/lib64/az/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel
          return _build_backend().build_wheel(
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 438, in build_wheel
          return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 426, in _build
          return self._build_with_temp_dir(
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
        File "<string>", line 260, in <module>
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 186, in setup
          return run_commands(dist)
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1104, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/command/bdist_wheel.py", line 370, in run
          self.run_command("build")
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1104, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 135, in run
          self.run_command(cmd_name)
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1104, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-1cb0oj0u/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
          cmd_obj.run()
        File "<string>", line 134, in run
        File "<string>", line 183, in build_cmake
        File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command 'cmake /tmp/pip-install-uvgy9n6w/uamqp_548c6b46ae1b437ba4fa083e496c99ee/src/vendor/azure-uamqp-c/ -G "Unix Makefiles" -Duse_openssl:bool=ON -Duse_default_uuid:bool=ON  -Duse_builtin_httpapi:bool=ON  -Dskip_samples:bool=ON -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for uamqp
Failed to build uamqp
ERROR: Failed to build installable wheels for some pyproject.toml based projects (uamqp)

Image

Issue script & Debug output

azdebug.txt

Expected behavior

uamqp being installed and the command connecting to the IoT Hub.

Environment Summary

azure-cli                         2.71.0

core                              2.71.0
telemetry                          1.1.0

Extensions:
azure-iot                         0.25.0

Dependencies:
msal                            1.31.2b1
azure-mgmt-resource               23.1.1

Python location '/usr/bin/python3.9'
Config directory '/root/.azure'
Extensions directory '/root/.azure/cliextensions'

Python (Linux) 3.9.19 (main, Mar  4 2025, 01:26:48)
[GCC 11.2.0]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botIoTIoT/CLIPossible-SolutionService AttentionThis issue is responsible by Azure service team.Similar-IssuebugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions