Skip to content

Cryptography module 44.0.0 causing error "ImportError //lib/x86_64-linux-gnu/libc.so.6 /version `GLIBC_2.33' not found" #1651

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

Open
gavin-aguiar opened this issue Mar 12, 2025 · 7 comments

Comments

@gavin-aguiar
Copy link
Contributor

gavin-aguiar commented Mar 12, 2025

Background:

Azure python functions apps running python versions 3.11 and below using cryptography module 44.0.0 fail with error

Exception:
Full Exception : Exception while executing function /Functions.api ---> Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcException /Result /Failure Exception /ImportError //lib/x86_64-linux-gnu/libc.so.6 /version `GLIBC_2.33' not found (required by /home/site/wwwroot/.python_packages/lib/site-packages/cryptography/hazmat/bindings/_rust.abi3.so). Cannot find module. Please check the requirements.txt file for the missing module. For more info, please refer the troubleshooting guide /https://aka.ms/functions-modulenotfound.........................continued

Root Cause:

Any Python function app, using azure-identity or any cryptography dependent module, built on the newest version of debian based system brings in a requirement of using GLIB_C version >= 2.33. Azure functions for python 3.11 and below are built on Bullseye with GLIB_C 2.31 is installed, and this causes a library-not-found issue.

Mitigation:

Multiple approaches to mitigate:

Recommendation / Long-term Solution:

The official recommendation is to migrate to Python 3.12, which is currently in preview. The Python 3.12 image is built on Bookworm, and it brings in a later version of GLIB_C. Thus, the latest versions of cryptography are supported when using Python 3.12.

The ETA for 3.12 GA is the end of March 2025.

@laurens1984
Copy link

For information, option 2 using Azure Pipelines isn't going to be available from April 1st 2025. See https://devblogs.microsoft.com/devops/upcoming-updates-for-azure-pipelines-agents-images/#ubuntu for details.

@gitFire001
Copy link

gitFire001 commented Mar 19, 2025

Is there an ETA for this? We are already in production with the second mitigation you proposed: using an older action image for Azure Pipelines.

But with Ubuntu-20 expiring on April 1st, we need a resolution soon. Any updates?

@hallvictoria
Copy link
Contributor

Hi @gitFire001, our recommendation is to migrate to Python 3.12. The latest versions of cryptography are compatible when using Python 3.12, and our GA target is end of this month.

@gitFire001
Copy link

gitFire001 commented Mar 20, 2025

@hallvictoria,
Could you please confirm if the fix is currently unavailable in Python 3.12 and whether it will be available exclusively in Python 3.12 by March 31st, or if it will also be available in other versions?

@hallvictoria
Copy link
Contributor

The fix is already available in Python 3.12. Support for python 3.12 is still in preview though, with the GA target for end of this month.

For all other python versions, apps will need to use one of the other mitigation options listed in this issue.

@geekzter
Copy link
Member

geekzter commented Mar 21, 2025

update: the sample YAML now uses a container image that is guaranteed to use Debian 11 (bullseye)

@laurens1984 @gitFire001 If you want to stick to 3.11 on Debian 11 (bullseye) in Azure Pipelines you can use the mcr.microsoft.com/devcontainers/python:3.11-bullseye container image with a container job

e.g.

  - job: devContainer
    container: mcr.microsoft.com/devcontainers/python:3.11-bullseye
    displayName: Use mcr.microsoft.com/devcontainers/python:3.11-bullseye container image
    pool:
      name: 'Azure Pipelines'
      vmImage: 'ubuntu-latest'
    steps:
    - task: FuncToolsInstaller@0
      displayName: 'Install Azure Functions Core Tools'
      inputs:
        version: 'latest'
    - bash: |
        lsb_release -a
        echo Azure Function Core Tools $(func --version)
        python --version
      displayName: 'Use Azure Functions Core Tools'

This provides the ability to use a container image of choice in Azure Pipelines. You may need to break up your jobs in YAML.

@miguelaguirrebwps
Copy link

Solved installing in requirements.txt:

cryptography==43.0.3

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

6 participants