Microsoft App Service Error: 'version `GLIBC_2.29' not found' while importing pyodbc for a Flask App

Sampat, Varun 231 Reputation points
2021-01-19T18:27:44.607+00:00

Hello,

I had an existing (and fully functioning) App Service (AS) running a Flask App until one day the web app service randomly broke. When I opened the logs for the AS, this is what I found:

58140-screenshot-2021-01-19-at-12214-pm.png

Here's the error message:

ImportError: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /home/site/wwwroot/antenv/lib/python3.7/site-packages/pyodbc.cpython-37m-x86_64-linux-gnu.so)

A few important things:

  • The app runs locally without any errors
  • I have not made any changes to the configuration for the AS.
  • The app had been running just fine for almost 6 months (I had pyodbc in my requirements.txt)
  • I saw a few similar questions on Azure QnA but they were either too old or running a Windows VM or confusing.

I really hope to get some clarity on this topic ASAP. Please let me know if any more details are required!

Thank you in advance!

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,919 questions
{count} votes

Accepted answer
  1. Sampat, Varun 231 Reputation points
    2021-01-25T15:16:00.48+00:00

    So I figured it out.

    All you have to do is add the following application setting to the app service:

    • SCM_DO_BUILD_DURING_DEPLOYMENT with value=true

    It was rather simple, but I still don't understand why/how it worked.

    1 person found this answer helpful.

4 additional answers

Sort by: Most helpful
  1. Erfan Nariman 436 Reputation points
    2021-02-25T11:24:22.573+00:00

    For those who use GitHub actions for their deployment, setting ubuntu version to 18.04 solved it for me:

    jobs:
      build-and-deploy-to-Azure:
        runs-on: ubuntu-18.04
    
    2 people found this answer helpful.

  2. Alexander Kammerer 121 Reputation points
    2021-02-02T14:23:14.367+00:00

    I am deploying my functionapp using the run as a package method. Therefore, I need to build the dependencies before. Make sure to build your dependencies on the appropriate Debian version (for v2 stretch, for v3 buster). This fixed it for me.

    0 comments No comments

  3. Aniket Karajgikar 1 Reputation point
    2021-10-20T18:20:50.283+00:00

    I faced similar error while running python azure function app which was deployed using CI/CD.
    I added below line in ci pipeline yaml pipeline:
    pip install wheel

    and then function app started running fine.

    Maybe this answer is out of context here, but I spent whole day to figure this out.


  4. Axel Van ´t Westeinde 1 Reputation point
    2021-11-30T09:02:47.973+00:00

    The solutions listed above aren't working for me unfortunately...

    Current configuration:

    • linuxFxVersion is PYTHON|3.9
    • pythonVersion is null
    • App service plan is Consumption

    Does anyone have any suggestions as to how to fix this problem? (Why don't the Azure Functions Linux instances have version 2.29 of GLIBC?)

    0 comments No comments