Skip to content

Error loading command modules 'containerapp' and 'cdn' due to msrest import deadlock under Python 3.14 (pipx install) #32980

Description

Describe the bug

When running any az command (e.g. az login), two errors are printed to stderr on startup:

Error loading command module 'containerapp': 'msrest'
Error loading command module 'cdn': deadlock detected by _ModuleLock('msrest.http_logger') at <address>

Despite these errors, the affected commands (az containerapp, az cdn) still appear to load successfully and are usable. The errors are non-fatal but appear on every invocation.

Environment

azure-cli version 2.84.0
Python version 3.14.3
Installation method pipx
OS macOS 15.7.4 (Sequoia), arm64

Steps to reproduce

  1. Install azure-cli via pipx on macOS arm64 with Python 3.14:
    pipx install azure-cli
    
  2. Run any az command:
    az login
    

Expected behavior

No errors printed to stderr on startup. Command modules load silently.

Actual behavior

Two errors appear every invocation (address will vary):

Error loading command module 'containerapp': 'msrest'
Error loading command module 'cdn': deadlock detected by _ModuleLock('msrest.http_logger') at 4711984592

Root cause analysis

This appears to be a recurrence of the Python import-lock race condition fixed in PR #26287 (which addressed requests.models deadlocks in Python 3.10.10). The same multi-threaded command module loading in azure.cli.core triggers a _ModuleLock deadlock on msrest.http_logger when running under Python 3.14, and a KeyError: 'msrest' in the containerapp module (likely due to msrest being only partially initialized in one thread when another accesses it).

msrest is present and importable in the venv — single-threaded imports of both modules succeed without error. The failures are specific to the concurrent loading path.

References

Activity

  1. yonzhan commented on Mar 17, 2026

    @yonzhan
    Collaborator

    Thank you for opening this issue, we will look into it.

  2. added
    Azure CLI TeamThe command of the issue is owned by Azure CLI team
    questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
    Networkaz network vnet/lb/nic/dns/etc...
    Service AttentionThis issue is responsible by Azure service team.
    on Mar 17, 2026
  3. isra-fel commented on Mar 24, 2026

    @isra-fel
    Member

    Hi Bob Vincent (@pillarsdotnet) Python 3.14 is not yet supported - please use 3.13 if possible. At the meantime, you can track the progress in #32869

  4. yonzhan commented on Mar 24, 2026

    @yonzhan
    Collaborator

    Installing Azure CLI via pip or pipx relies on the user’s local Python version and may pick up newer Python releases (such as 3.14) that are not yet supported. Azure CLI does not guarantee compatibility with unreleased or newly released Python versions until they are explicitly validated and supported.

  5. jiasli commented on Mar 24, 2026

    @jiasli
    Contributor

    Multi-thread import was introduced by #32730.

    Python 3.14 support is tracked by #32869.

    Installing from pip is not supported either (#20476).

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions