microsoft / vscode-azurefunctions

Azure Functions extension for VS Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions
MIT License
291 stars 132 forks source link

Deployment of Azure functions fail without any error message #2648

Closed chaozy closed 3 years ago

chaozy commented 3 years ago

Hi there, I am trying to deploy my azure function to azure. The function has been tested successfully when deploying on localhost. The deployment to Azure failed without throwing any error message.

ENV

Requirement.txt

azure-functions
farm-haystack

where farm-haystack is an open source python module

Below is the ouput:

Getting site publishing info...
Creating archive for current directory...
Performing remote build for functions project.
Uploading 3.47 MB [###############################################################################]
Remote build in progress, please wait...
Updating submodules.
Preparing deployment for commit id 'de17149afa'.
Repository path is /tmp/zipdeploy/extracted
Running oryx build...
Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.8 -p packagedir=.python_packages/lib/site-packages
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues

Oryx Version: 0.2.20201015.1, Commit: 1a35fbce482b20b71290f3a837a3469803ce4b44, ReleaseTagName: 20201015.1

Build Operation ID: |Gq7oessUXVo=.3f6a2a90_
Repository Commit : de17149afa4c46f7b0f2f3a4facacb56

Detecting platforms...
Detected following platforms:
  python: 3.8.6
Version '3.8.6' of platform 'python' is not installed. Generating script to install it...

Source directory     : /tmp/zipdeploy/extracted
Destination directory: /home/site/wwwroot

Downloading and extracting 'python' version '3.8.6' to '/tmp/oryx/platforms/python/3.8.6'...
Downloaded in 4 sec(s).
Verifying checksum...
Extracting contents...
Done in 17 sec(s).

Python Version: /tmp/oryx/platforms/python/3.8.6/bin/python3.8

Running pip install...
[02:08:14+0000] Collecting azure-functions
[02:08:14+0000]   Downloading azure_functions-1.6.0-py3-none-any.whl (126 kB)
[02:08:14+0000] Collecting farm-haystack
[02:08:14+0000]   Downloading farm_haystack-0.7.0-py3-none-any.whl (114 kB)
[02:08:15+0000] Collecting python-multipart
[02:08:15+0000]   Downloading python_multipart-0.0.4-py3-none-any.whl (31 kB)
[02:08:15+0000] Collecting sqlalchemy-utils
[02:08:15+0000]   Downloading SQLAlchemy-Utils-0.36.8.tar.gz (138 kB)
[02:08:16+0000] Collecting psycopg2-binary; sys_platform != "win32" and sys_platform != "cygwin"
[02:08:16+0000]   Downloading psycopg2_binary-2.8.6-cp38-cp38-manylinux1_x86_64.whl (3.0 MB)
[02:08:17+0000] Collecting tox
[02:08:17+0000]   Downloading tox-3.21.2-py2.py3-none-any.whl (84 kB)
[02:08:17+0000] Collecting tika
[02:08:18+0000]   Downloading tika-1.24.tar.gz (28 kB)
[02:08:19+0000] Collecting gunicorn
[02:08:19+0000]   Downloading gunicorn-20.0.4-py2.py3-none-any.whl (77 kB)
[02:08:19+0000] Collecting farm==0.6.2
[02:08:19+0000]   Downloading farm-0.6.2-py3-none-any.whl (207 kB)
[02:08:20+0000] Collecting pandas
[02:08:20+0000]   Downloading pandas-1.2.1-cp38-cp38-manylinux1_x86_64.whl (9.7 MB)
[02:08:21+0000] Collecting elasticsearch<=7.10,>=7.7
[02:08:21+0000]   Downloading elasticsearch-7.10.0-py2.py3-none-any.whl (321 kB)
[02:08:22+0000] Collecting python-docx
[02:08:22+0000]   Downloading python-docx-0.8.10.tar.gz (5.5 MB)
[02:08:24+0000] Collecting networkx
[02:08:24+0000]   Downloading networkx-2.5-py3-none-any.whl (1.6 MB)
[02:08:24+0000] Collecting uvloop; sys_platform != "win32" and sys_platform != "cygwin"
[02:08:24+0000]   Downloading uvloop-0.14.0-cp38-cp38-manylinux2010_x86_64.whl (4.7 MB)
[02:08:25+0000] Collecting more-itertools
[02:08:25+0000]   Downloading more_itertools-8.6.0-py3-none-any.whl (45 kB)
[02:08:26+0000] Collecting coverage
[02:08:26+0000]   Downloading coverage-5.4-cp38-cp38-manylinux2010_x86_64.whl (245 kB)
[02:08:26+0000] Collecting uvicorn
[02:08:26+0000]   Downloading uvicorn-0.13.3-py3-none-any.whl (45 kB)
[02:08:26+0000] Collecting faiss-cpu==1.6.3; sys_platform != "win32" and sys_platform != "cygwin"
[02:08:26+0000]   Downloading faiss_cpu-1.6.3-cp38-cp38-manylinux2010_x86_64.whl (7.2 MB)
[02:08:27+0000] Collecting sklearn
[02:08:27+0000]   Downloading sklearn-0.0.tar.gz (1.1 kB)
[02:08:28+0000] Collecting httptools
[02:08:28+0000]   Downloading httptools-0.1.1-cp38-cp38-manylinux1_x86_64.whl (227 kB)
[02:08:28+0000] Collecting langdetect
[02:08:28+0000]   Downloading langdetect-1.0.8.tar.gz (981 kB)
[02:08:29+0000] Collecting nltk
[02:08:29+0000]   Downloading nltk-3.5.zip (1.4 MB)
[02:08:31+0000] Collecting fastapi
[02:08:31+0000]   Downloading fastapi-0.63.0-py3-none-any.whl (50 kB)
[02:08:31+0000] Collecting elastic-apm
[02:08:31+0000]   Downloading elastic_apm-5.10.1-cp38-cp38-manylinux2010_x86_64.whl (324 kB)
[02:08:31+0000] Collecting six>=1.4.0
[02:08:31+0000]   Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
[02:08:32+0000] Collecting SQLAlchemy>=1.0
[02:08:32+0000]   Downloading SQLAlchemy-1.3.22-cp38-cp38-manylinux2010_x86_64.whl (1.3 MB)
[02:08:33+0000] Collecting pluggy>=0.12.0
[02:08:33+0000]   Downloading pluggy-0.13.1-py2.py3-none-any.whl (18 kB)
[02:08:33+0000] Collecting filelock>=3.0.0
[02:08:33+0000]   Downloading filelock-3.0.12-py3-none-any.whl (7.6 kB)
[02:08:33+0000] Collecting packaging>=14
[02:08:33+0000]   Downloading packaging-20.8-py2.py3-none-any.whl (39 kB)
[02:08:34+0000] Collecting toml>=0.9.4
[02:08:34+0000]   Downloading toml-0.10.2-py2.py3-none-any.whl (16 kB)
[02:08:34+0000] Collecting virtualenv!=20.0.0,!=20.0.1,!=20.0.2,!=20.0.3,!=20.0.4,!=20.0.5,!=20.0.6,!=20.0.7,>=16.0.0
[02:08:34+0000]   Downloading virtualenv-20.4.0-py2.py3-none-any.whl (5.7 MB)
[02:08:35+0000] Collecting py>=1.4.17
[02:08:35+0000]   Downloading py-1.10.0-py2.py3-none-any.whl (97 kB)
[02:08:36+0000] Collecting setuptools
[02:08:36+0000]   Downloading setuptools-52.0.0-py3-none-any.whl (784 kB)
[02:08:37+0000] Collecting requests
[02:08:37+0000]   Downloading requests-2.25.1-py2.py3-none-any.whl (61 kB)
[02:08:37+0000] Collecting dotmap
[02:08:37+0000]   Downloading dotmap-1.3.23-py3-none-any.whl (10 kB)
[02:08:37+0000] Collecting mlflow<=1.13.1
[02:08:37+0000]   Downloading mlflow-1.13.1-py3-none-any.whl (14.1 MB)
[02:08:40+0000] Collecting flask-restplus
[02:08:40+0000]   Downloading flask_restplus-0.13.0-py2.py3-none-any.whl (2.5 MB)
[02:08:41+0000] Collecting sentencepiece
[02:08:41+0000]   Downloading sentencepiece-0.1.95-cp38-cp38-manylinux2014_x86_64.whl (1.2 MB)
[02:08:41+0000] Collecting tqdm
[02:08:41+0000]   Downloading tqdm-4.56.0-py2.py3-none-any.whl (72 kB)
[02:08:41+0000] Collecting Werkzeug==0.16.1
[02:08:41+0000]   Downloading Werkzeug-0.16.1-py2.py3-none-any.whl (327 kB)
[02:08:42+0000] Collecting seqeval
[02:08:42+0000]   Downloading seqeval-0.0.10-py3-none-any.whl (7.5 kB)
[02:08:42+0000] Collecting transformers==4.1.1
[02:08:42+0000]   Downloading transformers-4.1.1-py3-none-any.whl (1.5 MB)
[02:08:42+0000] Collecting torch<1.8,>1.5
[02:08:42+0000]   Downloading torch-1.7.1-cp38-cp38-manylinux1_x86_64.whl (776.8 MB)
Done in 88 sec(s).
\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.8 -p packagedir=.python_packages/lib/site-packages
Deployment failed.

I also tried to deploy it using Azure CLI but it also failed.

I know the information might be too vague to locate the bug, so please tell me if there is a way to get a detailed log about the deployment. As for now I can't do nothing with this bug if no further message is given.

nturinski commented 3 years ago

Are there any more detailed logs under the "Logs" node of your function app? Sometimes the deployment logs can be found here. You might be able to connect to a log stream as well and try to ping your app and see if it returns any error back to you.

image

chaozy commented 3 years ago

@nturinski Many thanks to your suggestions. I checked the Logs node of my function app and found nothing useful there.

image

I also tried to ping my function app via live metrics, and it returns runtime error NoModuleFound. I guess the reason is that I have deployed an empty azure functions before so it remains with that function.

I found that the problem is caused by the module torch. Please try with this dependency in the requirments.txt:

# --find-links=https://download.pytorch.org/whl/torch_stable.html
# torch>1.5,<1.8

It fails when installing torch.

When I removed it from my requirments.txt the function can be deployed.