3

Introduction and Explaination

i am trying deploy my code to azure function app (linux based , python code ) through CI.CD pipelines. at first it worked fine but after few deployments, i am import error , library not found . and when i check the artifacts, required files of libraries are missing. i didnt changed anything in azure-pipelines.yml file .In azure-pipelines.yml i have added script for python to install libraries from requirements.txt. does anyone have any idea about it

What I have tried

i have also added those bash commands in yml file but same issue.

 bash: |
cd sub_folder
python3.6 -m venv worker_venv
source worker_venv/bin/activate
pip3.6 install setuptools
pip3.6 install -r requirements.txt
displayName: 'Install application dependencies'.

Issue

one more issue i am seeing is ,

Result: Failure Exception: ImportError: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /home/site/wwwroot/worker_venv/lib/python3.6/site-packages/pyodbc.cpython-36m-x86_64-linux-gnu.so). Troubleshooting Guide: https://aka.ms/functions-modulenotfound Stack: File "/azure-functions-host/workers/python/3.6/LINUX/X64/azure_functions_worker/dispatcher.py", line 275, in _handle__function_load_request func_request.metadata.entry_point) File "/azure-functions-host/workers/python/3.6/LINUX/X64/azure_functions_worker/utils/wrappers.py", line 34, in call raise extend_exception_message(e, message) File "/azure-functions-host/workers/python/3.6/LINUX/X64/azure_functions_worker/utils/wrappers.py", line 32, in call return func(*args, **kwargs) File "/azure-functions-host/workers/python/3.6/LINUX/X64/azure_functions_worker/loader.py", line 76, in load_function mod = importlib.import_module(fullmodname) File "/usr/local/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 941, in _find_and_load_unlocked File "", line 219, in _call_with_frames_removed File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 665, in _load_unlocked File "", line 678, in exec_module File "", line 219, in _call_with_frames_removed File "/home/site/wwwroot/JFG_MATCHMERGE/init.py", line 7, in import pyodbc
Leonardo Scotti
  • 905
  • 3
  • 20

1 Answers1

0

You could set variable system.debug to true in pipeline and then queue a new build to get debug logs. Reviewing the logs to check which directory that installing libraries from requirements.txt, and if this directory is included when you publishing the artifacts using the Publish Build Artifacts task. See: Review logs to diagnose pipeline issues for guidance.

wallezzi
  • 244
  • 6
  • After checking the logs , i have added path to the install command. "pip install --target="./.python_packages/lib/python3.6/site-packages" -r ./requirements.txt" but i am still facing the issue. – murali mallikarjuna Feb 12 '21 at 10:28
  • Do you use private Linux agent: https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-linux?view=azure-devops? If so, it should work fine as the build run on your local machine. – wallezzi Feb 15 '21 at 08:46
  • i am not using any private agent . I am using vs code to run in local . i dont know about agents. – murali mallikarjuna Feb 15 '21 at 09:44
  • If you don't use agents, so how do you deploy my code to azure function app (linux based , python code ) through CI.CD pipelines? To build your code or deploy your software using [Azure Pipelines](https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/agents?view=azure-devops&tabs=browser), you need at least one agent. Are you tagging this issue with unrelated tag: ```azure-devops```? – wallezzi Feb 16 '21 at 07:15