Azure / azure-functions-python-worker

Python worker for Azure Functions.
http://aka.ms/azurefunctions
MIT License
333 stars 103 forks source link

azure fucntion app in azure portal when i ran the code + test getting HTTP response code 500 Internal Server Error and in logs its showing the error([Error] Executed 'Functions.Embedding' (Failed, Id=c218cdb3-cea2-42f6-b007-048222b9f5ff, Duration=2ms)) what is the solution of the issue, could you please help me out ASAP please #1236

Closed Umamahesh888 closed 8 months ago

Umamahesh888 commented 1 year ago

Investigative information

Please provide the following:

Repro steps

Provide the steps required to reproduce the problem:

Expected behavior

Provide a description of the expected behavior.

Actual behavior

Provide a description of the actual behavior observed.

Known workarounds

Provide a description of any known workarounds.

Contents of the requirements.txt file:

Provide the requirements.txt file to help us find out module related issues.

Related information

Provide any related information
Umamahesh888 commented 1 year ago
http 500 error
vrdmr commented 1 year ago

I see the following stacktrace. Investigating the cause of the error, but it would help if you could redeploy and share the logs of the deployment?

Microsoft.Azure.WebJobs.Host.FunctionInvocationException : Exception while executing function: Functions.Embedding ---> Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcException : 
Result: Failure Exception: ModuleNotFoundError: No module named 'requests'. Please check the requirements.txt file for the missing module. For more info, please refer the troubleshooting guide: https://aka.ms/functions-modulenotfound 
Stack:
    File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py', line 374, in _handle__function_load_request     func = loader.load_function(
    File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/utils/wrappers.py', line 48, in call     raise extend_exception_message(e, message)
    File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/utils/wrappers.py', line 44, in call     return func(*args, **kwargs)
    File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/loader.py', line 132, in load_function     mod = importlib.import_module(fullmodname)
    File '/usr/local/lib/python3.9/importlib/__init__.py', line 127, in import_module     return _bootstrap._gcd_import(name[level:], package, level)
    File '/home/site/wwwroot/Embedding/__init__.py', line 2, in <module>     from .OpenAIEmbedding import *
    File '/home/site/wwwroot/Embedding/OpenAIEmbedding.py', line 10, in <module>     import requests 
Umamahesh888 commented 1 year ago

Hi Vrdmr, we are using the python 3.9, build and release successfully deployed in azure portalm but when i could access the code+test getting the HTTP 500, and request module not found error, as per some github docs added the install dependicies task r pip install --target="$(workingDirectory)/.python_packages/lib/site-packages" -r requirements.txt, and deployed but still getting the same error my requirements.txt file: aiohttp==3.8.4 aiosignal==1.3.1 apeye==1.3.0 apeye-core==1.1.2 async-timeout==4.0.2 attrs==23.1.0 azure-functions==1.14.0 beautifulsoup4==4.12.2 certifi==2023.5.7 charset-normalizer==3.1.0 colorama==0.4.6 contourpy==1.0.7 cycler==0.11.0 dnspython==2.3.0 domdf-python-tools==3.6.1 et-xmlfile==1.1.0 fonttools==4.39.4 frozenlist==1.3.3 grpcio==1.54.0 grpcio-tools==1.54.0 idna==3.4 joblib==1.2.0 kiwisolver==1.4.4 loguru==0.7.0 matplotlib==3.7.1 multidict==6.0.4 natsort==8.3.1 numpy==1.24.3 openai==0.27.6 openpyxl==3.1.2 packaging==23.1 pandas==2.0.1 Pillow==9.5.0 pinecone-client==2.2.1 platformdirs==3.5.1 plotly==5.14.1 protobuf==4.23.0 pyparsing==3.0.9 pypi-json==0.3.0 python-dateutil==2.8.2 pytz==2023.3 PyYAML==6.0 regex==2023.5.5 requests==2.30.0 scikit-learn==1.2.2 scipy==1.10.1 six==1.16.0 soupsieve==2.4.1 tenacity==8.2.2 threadpoolctl==3.1.0 tiktoken==0.4.0 tqdm==4.65.0 typing_extensions==4.5.0 tzdata==2023.3 urllib3==2.0.2 win32-setctime==1.1.0 yarl==1.9.2 could you please help me out quickly, because i dont know how to resolve, quick replay is lots of help to me and thanks

module not found
Umamahesh888 commented 1 year ago

locally developers using the python 3.10 , but in azure pipeline build using the 3.9 version is there any issue causing this ?

pdthummar commented 8 months ago

It appears to be a code-related problem. We hope that it has been resolved by now. If you are still experiencing issues, please create a new issue.