成功使用OSError部署后,Azure功能失败:[Errno 107] [英] Azure function failing after successfull deployment with OSError: [Errno 107]

查看:108
本文介绍了成功使用OSError部署后,Azure功能失败:[Errno 107]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该功能在上次部署之前有效.它用于NLC,我们正在为两种不同的语言运行两个函数.对于新部署,我们删除了一些仅用于一种语言的代码,并将其镜像为与另一种语言相同.Azure CLI告诉我们:

The function was working before the last deployment. It is used for NLC and we are running two functions for two different languages. For the new deployment we removed some code which was only used for one language and mirrored the code to be equal to the other language. Azure CLI tells us:

Upload completed successfully.
Deployment completed successfully. 

但是随后尝试调用该函数时,它要么返回没有主体的500,要么返回带有以下内容的404:

But when trying to invoke the function afterwards it either returns 500 without a body or it returns 404 with:

<html>
<head>
    <title>404 Not Found</title>
</head>
<body bgcolor="white">
    <center>
        <h1>404 Not Found</h1>
    </center>
    <hr>
    <center>nginx</center>
</body>
</html>



The stacktrace we can see in the monitoring is the following:
Exception while executing function: Functions.classify Result: Failure
Exception: OSError: [Errno 107] Transport endpoint is not connected: '/home/site/wwwroot/.python_packages/lib/site-packages'
Stack: File "/azure-functions-host/workers/python/3.8/LINUX/X64/azure_functions_worker/dispatcher.py", line 271, in _handle__function_load_request
func = loader.load_function(
File "/azure-functions-host/workers/python/3.8/LINUX/X64/azure_functions_worker/utils/wrappers.py", line 32, in call
return func(*args, **kwargs)
File "/azure-functions-host/workers/python/3.8/LINUX/X64/azure_functions_worker/loader.py", line 76, in load_function
mod = importlib.import_module(fullmodname)
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/site/wwwroot/classify/__init__.py", line 4, in <module>
File "/home/site/wwwroot/classify/predict.py", line 1, in <module>
File "/home/site/wwwroot/.python_packages/lib/site-packages/fastai/text/all.py", line 1, in <module>
File "/home/site/wwwroot/.python_packages/lib/site-packages/fastai/basics.py", line 1, in <module>
File "/home/site/wwwroot/.python_packages/lib/site-packages/fastai/data/all.py", line 1, in <module>
File "/home/site/wwwroot/.python_packages/lib/site-packages/fastai/torch_basics.py", line 1, in <module>
File "/home/site/wwwroot/.python_packages/lib/site-packages/torch/__init__.py", line 482, in <module>
File "/home/site/wwwroot/.python_packages/lib/site-packages/torch/serialization.py", line 8, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 971, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 914, in _find_spec
File "<frozen importlib._bootstrap_external>", line 1342, in find_spec
File "<frozen importlib._bootstrap_external>", line 1314, in _get_spec
File "<frozen importlib._bootstrap_external>", line 1443, in find_spec
File "<frozen importlib._bootstrap_external>", line 1483, in _fill_cache

用于部署的命令如下,以前曾工作过:

Commands used for deployment were the following, which worked before:

pip3 install  --target="./.python_packages/lib/site-packages" -r requirements.txt 
func azure functionapp publish [functionapp name] --no-build

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆