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

2019678, CS 26 Reputation points
2021-03-31T15:26:18.91+00:00

Hello, I have a problem in connecting to my Azure SQL db with pyobcd driver, I'm aware of this issue being sorted in a previous post, How ever in my case it doesn't work.
83315-screenshot-2021-03-31-204327.png

I'm new to azure and I'm not sure whether do this is helping me solve the issue as in a previous post microsoft-web-app-service-error-39version-glibc-22.html
Can you guide me how would this solution will work after i set the app setting as "SCM_DO_BUILD_DURING_DEPLOYMENT" ,I save the app setting and refreshed the server and it doesn't work for me, can you guide me on this solution.
83310-screenshot-2021-03-31-204358.png This is the way i have done the setting.

Azure SQL Database
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,966 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2021-04-01T00:15:10.233+00:00

    Hi @2019678, CS ,

    The pyodb library you're using may have a dependency on GLIB 2.29. I'm not 100% certain but the base linux image you're using may be based on 18.04. If that indeed is the case, GLIB 2.29 may not be compatible with Ubuntu 18.04. I would recommend checking the deployment logs and backing down the pyodbc version to an earlier version and see if you get the same results.

    If you do, next step I would is confirm that pip install -r requirements.txt for any errors or missing packages (I didn't see this portion of your log). If you don't see these logs, see https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs#enable-application-logging-linuxcontainer for how to enable thing. You can also source antenv at the bash prompt in the http://<yourappname>.scm.azurewebsites.net/debug/console and rerun pip install pyodbc and check for any errors.

    Regards,
    Ryan


1 additional answer

Sort by: Most helpful
  1. Jason Freeberg 166 Reputation points
    2021-04-01T19:19:55.817+00:00

    Can you guide me how would this solution will work after i set the app setting as "SCM_DO_BUILD_DURING_DEPLOYMENT" ,I save the app setting and refreshed the server and it doesn't work for me

    @2019678, CS -- You need to re-deploy your app after setting that setting. (Note how it says build during deployment, if it re-built your app every time your site restarted that would be some awful cold start!). The core problem you're running into is that virtual environments are not portable between machines. Based on your YAML screen shots, I'm guessing you're using Azure DevOps (or a similar CI/CD service). If you're building a virtual environment on that build VM, do not deploy it to the runtime server (App Service, a VM, anything). Python makes deep links to libraries (like GLIBC) when packages are installed, so if the lib is in a different location or version on the runtime, then you see this failure.

    More information: https://azure.github.io/AppService/2020/12/11/cicd-for-python-apps.html

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.