Azure / azure-functions-python-worker

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

[BUG] Azure function python v2 not visible in Azure Portal after deployment #1338

Closed saikumaru closed 6 months ago

saikumaru commented 8 months ago

Follow the steps mentioned in the document to deploy the function. https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-python?pivots=python-mode-decorators

Investigative information

Please provide the following:

Repro steps

Provide the steps required to reproduce the problem:
  1. Follow steps as in above doc
  2. Create a blob trigger function
  3. add the below requirements.txt
  4. add the below to app.py
  5. test locally- runs perfectly!
  6. deploy to azure using VS code, right click "deploy to azure", once successful - DOESNT SHOW IN PORTAL.

-->

Expected behavior

Provide a description of the expected behavior.
  1. The function should be visible on portal
  2. The function should be executed once blob is uploaded into the blob-storage
  3. Expected to work as it behaves on local.

Actual behavior

Provide a description of the actual behavior observed.
  1. Cannot find the function
  2. The function doesnt execute when the endpoint is hit
  3. the local test works but the deployed function doesnt
  4. fails in consumption plan
  5. fails in app service plan

Known workarounds

Provide a description of any known workarounds.

No workarounds

Contents of the requirements.txt file:

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

Files at the end

Related information

Provide any related information
Source ```python import azure.functions as func import logging import os #qdrant from qdrant_client import QdrantClient from qdrant_client.models import Distance, VectorParams,PointStruct #encoder for vecotrizing embeddings from sentence_transformers import SentenceTransformer from langchain.document_loaders import PyPDFLoader from langchain.document_loaders import DirectoryLoader from langchain.text_splitter import RecursiveCharacterTextSplitter #https://stackoverflow.com/questions/75627362/azure-functions-python-error-no-job-functions app = func.FunctionApp() @app.blob_trigger(arg_name="myblob", path="mycontainer", connection="BlobStorageConnectionString") def blob_trigger(myblob: func.InputStream): logging.info(f"Python blob trigger function processed blob" f"Name: {myblob.name}" f"Blob Size: {myblob.length} bytes") ``` ```txt # DO NOT include azure-functions-worker in this file # The Python Worker is managed by Azure Functions platform # Manually managing azure-functions-worker may cause unexpected issues azure-functions -f https://download.pytorch.org/whl/torch_stable.html torch==1.13.1+cpu torchvision==0.14.1+cpu torchaudio==0.13.1 sentence_transformers==2.2.2 langchain==0.0.274 qdrant_client==1.2.0 pypdf==3.9.0 ```

Several customers reported this issue here, which was closed with no answer. https://github.com/Azure/azure-functions-python-worker/issues/1262 Please kindly look in and suggest.

Tagging you from the closed issue where the MS team hasn't been responding. @Otimkev @andrewmmm @jsm-NK @aadamsx @JarroVGIT @SiddheshDesai06

jsm-NK commented 8 months ago

If your function is working locally - and deploys successfully but no files or functions are visible after deployment - this is potentially the issue: https://github.com/Azure/azure-functions-python-worker/issues/1262#issuecomment-1784778748

saikumaru commented 8 months ago

Thank you @jsm-NK for your reply.

  1. Unfortunately we dont have a way to find out which library is causing that issue, if at all, in our case.
  2. If we provide a version number in requirements.txt, it is not supposed to download an "unexpected version from PyPI".
  3. The libraries in my requirements file dont seem to be part of a python base installation.
jsm-NK commented 8 months ago

Thank you @jsm-NK for your reply.

  1. Unfortunately we dont have a way to find out which library is causing that issue, if at all, in our case.
  2. If we provide a version number in requirements.txt, it is not supposed to download an "unexpected version from PyPI".
  3. The libraries in my requirements file dont seem to be part of a python base installation.

Quick follow up - After deploying, do you see any files if you go on "app files" instead of going to overview/code/test ?
image

Have you configured all your application/configuration settings in azure?

bhagyshricompany commented 8 months ago

Thanks for reporting will check and update.

charlesjankowski commented 8 months ago

Adding a comment to this ticket as well since this one is open. (https://github.com/Azure/azure-functions-python-worker/issues/1262 is closed)

All I had in my requirements.txt file was azure-functions and I still saw this.

JarroVGIT commented 8 months ago

Adding a comment to this ticket as well since this one is open. (#1262 is closed)

All I had in my requirements.txt file was azure-functions and I still saw this.

Saw what, exactly? The issue in #1262 can have many causes. Do you built locally and do a ZIP deployment? Do you perform a remote build? I have a special repo with reproducible steps for the issue of 'Functions not showing in Azure Portal', and they all have the same issue: there is an unhandled exception raised in the root of your script or imports. The reason may vary:

Etc. There are countless ways to induce this behavior and the only thing Microsoft has to do is to propagate the exception raised to Application Insight so we can actually see what is wrong.

If you have no idea what is wrong: pull everything in the scope of your function method. So, rather than doing this:

import azure.functions as func
import my_package
import os

myvar = os.environ("MYVAR")

app = func.FunctionApp()

@app.function_name(name="HttpExample")
@app.route(route="hello")
def test_function(req: func.HttpRequest) -> func.HttpResponse:
    return func.HttpResponse("HttpExample function processed a request!")

Try this:

import azure.functions as func

app = func.FunctionApp()

@app.function_name(name="HttpExample")
@app.route(route="hello")
def test_function(req: func.HttpRequest) -> func.HttpResponse:
    import my_package
    import os

    myvar = os.environ("MYVAR")
    return func.HttpResponse("HttpExample function processed a request!")

Now call your function and see what exception you get. If you don't get an exception, then at least you can move back the lines of code one by one to pinpoint which one is causing issues.

charlesjankowski commented 8 months ago

Thanks for you great feedback and insights on this problem!

My use case is pretty simple; I create an HttpTrigger, then I create another one in a new blueprint file, and do the import and register_functions in function_app.py. As such:

Right now, I'm thinking the only way out is to back off to V1, which seems to work fine.

Yes, I look forward to some logging that will pinpoint the source of the problem.

Thanks again!

JarroVGIT commented 8 months ago
  • The only relative import I have is importing the blueprint so I can register it. When I comment out the register_app but not the import, it works fine, i.e., I see the function on the portal. So presumably the import is fine.

@charlesjankowski you say register_app but did you mean register_functions? If so, please try register_blueprint on the imported blueprint. Otherwise, without code example, it's hard to point to a problem to be honest. Good luck!

pdthummar commented 8 months ago

@charlesjankowski: Could you please share the code and steps for replication, if available? Additionally, I'd like to know if you intend to deploy it to a Consumption or an EP app. Thanks

@saikumaru :- I'd like to know if you intend to deploy it to a Consumption or an EP app. Thanks

charlesjankowski commented 8 months ago

@JarroVGIT thanks for correcting my error, yes I meant register_functions() (since that's what was in the instructions in the newly created blueprint file). I replaced with register_blueprint() and get the same.

Here's my code https://github.com/Grapevine-Health/cj20231029a

Right now it's Consumption, which was the only one available for Python 3.10 US-East (unless I'm wrong on that).

pdthummar commented 8 months ago

@charlesjankowski I see what's potentially happening in your case. The issue arises because you have a variable named blueprint and a function with the same name in your blueprint.py. When you import blueprint using from blueprint import blueprint in your function_app.py file, Python gets confused because it tries to import both the variable and the function with the same name, leading to a naming conflict. To resolve this issue, you should consider renaming either the variable or the function to avoid the naming conflict.

In addition to, All available SKUs support both Python 3.10 and Python 3.11. Thanks

charlesjankowski commented 8 months ago

@pdthummar Thank you, that seems to work now!

I used the VSCode-created blueprint.py unmodified; perhaps it would be good for the auto-generated example to not cause such errors. It did ask for both the blueprint filename and the new function name, so that's arguably on me, but perhaps the sample could call the azure.functions.Blueprint object (and the decorator) FILE_bp or something like that just to minimize the chance of conflict.

In any case, indicating some kind of error during the deployment process would be great.

Also, both app.register_functions() and app.register_blueprint() seem to work; is there a different/preference?

Thanks again!

saikumaru commented 8 months ago

@charlesjankowski: Could you please share the code and steps for replication, if available? Additionally, I'd like to know if you intend to deploy it to a Consumption or an EP app. Thanks

@saikumaru :- I'd like to know if you intend to deploy it to a Consumption or an EP app. Thanks

Thank you for your reply. We need to deploy it to a Linux consumption plan. Rest of the steps followed to deploy it are as per the MS document quoted.

saikumaru commented 8 months ago

Thank you @jsm-NK for your reply.

  1. Unfortunately we dont have a way to find out which library is causing that issue, if at all, in our case.
  2. If we provide a version number in requirements.txt, it is not supposed to download an "unexpected version from PyPI".
  3. The libraries in my requirements file dont seem to be part of a python base installation.

Quick follow up - After deploying, do you see any files if you go on "app files" instead of going to overview/code/test ? image

Have you configured all your application/configuration settings in azure?

Yes, I can see the latest files under "app files"

The settings have been updated as per the documentation of MS, so yes they are all configured correctly.

pdthummar commented 8 months ago

@saikumaru I successfully deployed the function to the Azure Functions Consumption Plan using the provided source code. I used the following command to publish it: func azure functionapp publish . Could you please attempt to redeploy it and share additional details if you encounter any deployment issues?

saikumaru commented 8 months ago

Thank you! I will try that. But does the function show up on the portal though please?

I had successful deploys earlier too, but they didn't show up on portal.

pdthummar commented 8 months ago

@saikumaru Yes, Function is showing up in portal and works as expected.

saikumaru commented 8 months ago

@pdthummar no luck, sorry. Can you please retry deploying, with a few edits to the debug messages, just to be sure. image

Logs ```txt PS C:\Users\admin\Documents\azf\azf8> func azure functionapp publish dulongfunc10 Getting site publishing info... [2023-11-02T07:35:16.515Z] Starting the function app deployment... Removing WEBSITE_CONTENTAZUREFILECONNECTIONSTRING app setting. Removing WEBSITE_CONTENTSHARE app setting. Creating archive for current directory... Performing remote build for functions project. Uploading 17.93 KB [##############################################################################] Remote build in progress, please wait... Updating submodules. Preparing deployment for commit id '709b6e4c-8'. PreDeployment: context.CleanOutputPath False PreDeployment: context.OutputPath /home/site/wwwroot Repository path is /tmp/zipdeploy/extracted Running oryx build... Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.9.7 -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.20210120.1, Commit: 66c7820d7df527aaffabd2563a49ad57930999c9, ReleaseTagName: 20210120.1 Build Operation ID: |o/OW9nQh5NQ=.6a54e3d8_ Repository Commit : 709b6e4c-8d43-45b9-b0af-c01359f0def5 Detecting platforms... Detected following platforms: python: 3.9.7 Version '3.9.7' 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.9.7' to '/tmp/oryx/platforms/python/3.9.7'... Downloaded in 2 sec(s). Verifying checksum... Extracting contents... Done in 6 sec(s). Python Version: /tmp/oryx/platforms/python/3.9.7/bin/python3.9 Running pip install... [07:35:54+0000] Looking in links: https://download.pytorch.org/whl/torch_stable.html [07:35:57+0000] Collecting azure-functions [07:35:57+0000] Downloading azure_functions-1.17.0-py3-none-any.whl (165 kB) [07:35:59+0000] Collecting torch==1.13.1+cpu [07:35:59+0000] Downloading https://download.pytorch.org/whl/cpu/torch-1.13.1%2Bcpu-cp39-cp39-linux_x86_64.whl (199.1 MB) [07:36:06+0000] Collecting torchvision==0.14.1+cpu [07:36:06+0000] Downloading https://download.pytorch.org/whl/cpu/torchvision-0.14.1%2Bcpu-cp39-cp39-linux_x86_64.whl (16.8 MB) [07:36:08+0000] Collecting torchaudio==0.13.1 [07:36:08+0000] Downloading https://download.pytorch.org/whl/rocm5.2/torchaudio-0.13.1%2Brocm5.2-cp39-cp39-linux_x86_64.whl (3.9 MB) [07:36:09+0000] Collecting sentence_transformers==2.2.2 [07:36:09+0000] Downloading sentence-transformers-2.2.2.tar.gz (85 kB) [07:36:10+0000] Collecting langchain==0.0.274 [07:36:10+0000] Downloading langchain-0.0.274-py3-none-any.whl (1.6 MB) [07:36:12+0000] Collecting qdrant_client==1.2.0 [07:36:12+0000] Downloading qdrant_client-1.2.0-py3-none-any.whl (129 kB) [07:36:13+0000] Collecting pypdf==3.9.0 [07:36:13+0000] Downloading pypdf-3.9.0-py3-none-any.whl (249 kB) [07:36:14+0000] Collecting typing-extensions [07:36:14+0000] Downloading typing_extensions-4.8.0-py3-none-any.whl (31 kB) [07:36:16+0000] Collecting numpy [07:36:16+0000] Downloading numpy-1.26.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB) [07:36:18+0000] Collecting pillow!=8.3.*,>=5.3.0 [07:36:18+0000] Downloading Pillow-10.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB) [07:36:19+0000] Collecting requests [07:36:19+0000] Downloading requests-2.31.0-py3-none-any.whl (62 kB) [07:36:20+0000] Collecting transformers<5.0.0,>=4.6.0 [07:36:20+0000] Downloading transformers-4.34.1-py3-none-any.whl (7.7 MB) [07:36:22+0000] Collecting tqdm [07:36:22+0000] Downloading tqdm-4.66.1-py3-none-any.whl (78 kB) [07:36:24+0000] Collecting scikit-learn [07:36:24+0000] Downloading scikit_learn-1.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.9 MB) [07:36:25+0000] Collecting scipy [07:36:25+0000] Downloading scipy-1.11.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (36.6 MB) [07:36:28+0000] Collecting nltk [07:36:28+0000] Downloading nltk-3.8.1-py3-none-any.whl (1.5 MB) [07:36:28+0000] Collecting sentencepiece [07:36:28+0000] Downloading sentencepiece-0.1.99-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB) [07:36:29+0000] Collecting huggingface-hub>=0.4.0 [07:36:29+0000] Downloading huggingface_hub-0.18.0-py3-none-any.whl (301 kB) [07:36:29+0000] Collecting dataclasses-json<0.6.0,>=0.5.7 [07:36:29+0000] Downloading dataclasses_json-0.5.14-py3-none-any.whl (26 kB) [07:36:32+0000] Collecting aiohttp<4.0.0,>=3.8.3 [07:36:32+0000] Downloading aiohttp-3.8.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB) [07:36:33+0000] Collecting async-timeout<5.0.0,>=4.0.0; python_version < "3.11" [07:36:33+0000] Downloading async_timeout-4.0.3-py3-none-any.whl (5.7 kB) [07:36:34+0000] Collecting PyYAML>=5.3 [07:36:34+0000] Downloading PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (738 kB) [07:36:35+0000] Collecting numexpr<3.0.0,>=2.8.4 [07:36:35+0000] Downloading numexpr-2.8.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (383 kB) [07:36:36+0000] Collecting tenacity<9.0.0,>=8.1.0 [07:36:36+0000] Downloading tenacity-8.2.3-py3-none-any.whl (24 kB) [07:36:37+0000] Collecting pydantic<3,>=1 [07:36:37+0000] Downloading pydantic-2.4.2-py3-none-any.whl (395 kB) [07:36:39+0000] Collecting langsmith<0.1.0,>=0.0.21 [07:36:39+0000] Downloading langsmith-0.0.56-py3-none-any.whl (44 kB) [07:36:41+0000] Collecting SQLAlchemy<3,>=1.4 [07:36:41+0000] Downloading SQLAlchemy-2.0.22-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB) [07:36:42+0000] Collecting portalocker<3.0.0,>=2.7.0 [07:36:42+0000] Downloading portalocker-2.8.2-py3-none-any.whl (17 kB) [07:36:45+0000] Collecting grpcio>=1.41.0 [07:36:45+0000] Downloading grpcio-1.59.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.3 MB) [07:36:47+0000] Collecting httpx[http2]>=0.14.0 [07:36:47+0000] Downloading httpx-0.25.0-py3-none-any.whl (75 kB) [07:36:50+0000] Collecting grpcio-tools>=1.41.0 [07:36:50+0000] Downloading grpcio_tools-1.59.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.7 MB) [07:36:52+0000] Collecting urllib3<2.0.0,>=1.26.14 [07:36:52+0000] Downloading urllib3-1.26.18-py2.py3-none-any.whl (143 kB) [07:36:53+0000] Collecting charset-normalizer<4,>=2 [07:36:53+0000] Downloading charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142 kB) [07:36:54+0000] Collecting idna<4,>=2.5 [07:36:54+0000] Downloading idna-3.4-py3-none-any.whl (61 kB) [07:36:55+0000] Collecting certifi>=2017.4.17 [07:36:55+0000] Downloading certifi-2023.7.22-py3-none-any.whl (158 kB) [07:36:55+0000] Collecting packaging>=20.0 [07:36:55+0000] Downloading packaging-23.2-py3-none-any.whl (53 kB) [07:36:57+0000] Collecting tokenizers<0.15,>=0.14 [07:36:57+0000] Downloading tokenizers-0.14.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8 MB) [07:37:00+0000] Collecting regex!=2019.12.17 [07:37:00+0000] Downloading regex-2023.10.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (773 kB) [07:37:00+0000] Collecting filelock [07:37:00+0000] Downloading filelock-3.13.1-py3-none-any.whl (11 kB) [07:37:02+0000] Collecting safetensors>=0.3.1 [07:37:02+0000] Downloading safetensors-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB) [07:37:03+0000] Collecting threadpoolctl>=2.0.0 [07:37:03+0000] Downloading threadpoolctl-3.2.0-py3-none-any.whl (15 kB) [07:37:03+0000] Collecting joblib>=1.1.1 [07:37:03+0000] Downloading joblib-1.3.2-py3-none-any.whl (302 kB) [07:37:04+0000] Collecting click [07:37:04+0000] Downloading click-8.1.7-py3-none-any.whl (97 kB) [07:37:04+0000] Collecting fsspec>=2023.5.0 [07:37:04+0000] Downloading fsspec-2023.10.0-py3-none-any.whl (166 kB) [07:37:05+0000] Collecting typing-inspect<1,>=0.4.0 [07:37:05+0000] Downloading typing_inspect-0.9.0-py3-none-any.whl (8.8 kB) [07:37:06+0000] Collecting marshmallow<4.0.0,>=3.18.0 [07:37:06+0000] Downloading marshmallow-3.20.1-py3-none-any.whl (49 kB) [07:37:08+0000] Collecting yarl<2.0,>=1.0 [07:37:08+0000] Downloading yarl-1.9.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (269 kB) [07:37:09+0000] Collecting aiosignal>=1.1.2 [07:37:09+0000] Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB) [07:37:11+0000] Collecting multidict<7.0,>=4.5 [07:37:11+0000] Downloading multidict-6.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (114 kB) [07:37:12+0000] Collecting attrs>=17.3.0 [07:37:12+0000] Downloading attrs-23.1.0-py3-none-any.whl (61 kB) [07:37:13+0000] Collecting frozenlist>=1.1.1 [07:37:13+0000] Downloading frozenlist-1.4.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (228 kB) [07:37:13+0000] Collecting annotated-types>=0.4.0 [07:37:13+0000] Downloading annotated_types-0.6.0-py3-none-any.whl (12 kB) [07:37:17+0000] Collecting pydantic-core==2.10.1 [07:37:17+0000] Downloading pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB) [07:37:19+0000] Collecting greenlet!=0.4.17; platform_machine == "aarch64" or (platform_machine == "ppc64le" or (platform_machine == "x86_64" or (platform_machine == "amd64" or (platform_machine == "AMD64" or (platform_machine == "win32" or platform_machine == "WIN32"))))) [07:37:20+0000] Downloading greenlet-3.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (657 kB) [07:37:20+0000] Collecting httpcore<0.19.0,>=0.18.0 [07:37:20+0000] Downloading httpcore-0.18.0-py3-none-any.whl (76 kB) [07:37:21+0000] Collecting sniffio [07:37:21+0000] Downloading sniffio-1.3.0-py3-none-any.whl (10 kB) [07:37:22+0000] Collecting h2<5,>=3; extra == "http2" [07:37:22+0000] Downloading h2-4.1.0-py3-none-any.whl (57 kB) [07:37:24+0000] Collecting setuptools [07:37:24+0000] Downloading setuptools-68.2.2-py3-none-any.whl (807 kB) [07:37:26+0000] Collecting protobuf<5.0dev,>=4.21.6 [07:37:26+0000] Downloading protobuf-4.25.0-cp37-abi3-manylinux2014_x86_64.whl (294 kB) [07:37:27+0000] Collecting mypy-extensions>=0.3.0 [07:37:27+0000] Downloading mypy_extensions-1.0.0-py3-none-any.whl (4.7 kB) [07:37:28+0000] Collecting h11<0.15,>=0.13 [07:37:28+0000] Downloading h11-0.14.0-py3-none-any.whl (58 kB) [07:37:29+0000] Collecting anyio<5.0,>=3.0 [07:37:29+0000] Downloading anyio-4.0.0-py3-none-any.whl (83 kB) [07:37:29+0000] Collecting hyperframe<7,>=6.0 [07:37:29+0000] Downloading hyperframe-6.0.1-py3-none-any.whl (12 kB) [07:37:29+0000] Collecting hpack<5,>=4.0 [07:37:29+0000] Downloading hpack-4.0.0-py3-none-any.whl (32 kB) [07:37:30+0000] Collecting exceptiongroup>=1.0.2; python_version < "3.11" [07:37:30+0000] Downloading exceptiongroup-1.1.3-py3-none-any.whl (14 kB) [07:37:30+0000] Building wheels for collected packages: sentence-transformers [07:37:30+0000] Building wheel for sentence-transformers (setup.py): started [07:37:30+0000] Building wheel for sentence-transformers (setup.py): finished with status 'done' [07:37:30+0000] Created wheel for sentence-transformers: filename=sentence_transformers-2.2.2-py3-none-any.whl size=125925 sha256=9678a9464975de19c5402a051219737aafb7c11bd99ca8a060af2488ed1dd043 [07:37:30+0000] Stored in directory: /usr/local/share/pip-cache/wheels/71/67/06/162a3760c40d74dd40bc855d527008d26341c2b0ecf3e8e11f [07:37:30+0000] Successfully built sentence-transformers [07:37:33+0000] Installing collected packages: azure-functions, typing-extensions, torch, numpy, pillow, urllib3, charset-normalizer, idna, certifi, requests, torchvision, torchaudio, PyYAML, packaging, fsspec, tqdm, filelock, huggingface-hub, tokenizers, regex, safetensors, transformers, threadpoolctl, scipy, joblib, scikit-learn, click, nltk, sentencepiece, sentence-transformers, mypy-extensions, typing-inspect, marshmallow, dataclasses-json, multidict, yarl, frozenlist, aiosignal, async-timeout, attrs, aiohttp, numexpr, tenacity, annotated-types, pydantic-core, pydantic, langsmith, greenlet, SQLAlchemy, langchain, portalocker, grpcio, sniffio, h11, exceptiongroup, anyio, httpcore, hyperframe, hpack, h2, httpx, setuptools, protobuf, grpcio-tools, qdrant-client, pypdf ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts. [07:38:24+0000] Successfully installed PyYAML-6.0.1 SQLAlchemy-2.0.22 aiohttp-3.8.6 aiosignal-1.3.1 annotated-types-0.6.0 anyio-4.0.0 async-timeout-4.0.3 attrs-23.1.0 azure-functions-1.17.0 certifi-2023.7.22 charset-normalizer-3.3.2 click-8.1.7 dataclasses-json-0.5.14 exceptiongroup-1.1.3 filelock-3.13.1 frozenlist-1.4.0 fsspec-2023.10.0 greenlet-3.0.1 grpcio-1.59.2 grpcio-tools-1.59.2 h11-0.14.0 h2-4.1.0 hpack-4.0.0 httpcore-0.18.0 httpx-0.25.0 huggingface-hub-0.18.0 hyperframe-6.0.1 idna-3.4 joblib-1.3.2 langchain-0.0.274 langsmith-0.0.56 marshmallow-3.20.1 multidict-6.0.4 mypy-extensions-1.0.0 nltk-3.8.1 numexpr-2.8.7 numpy-1.26.1 packaging-23.2 pillow-10.1.0 portalocker-2.8.2 protobuf-4.25.0 pydantic-2.4.2 pydantic-core-2.10.1 pypdf-3.9.0 qdrant-client-1.2.0 regex-2023.10.3 requests-2.31.0 safetensors-0.4.0 scikit-learn-1.3.2 scipy-1.11.3 sentence-transformers-2.2.2 sentencepiece-0.1.99 setuptools-68.2.2 sniffio-1.3.0 tenacity-8.2.3 threadpoolctl-3.2.0 tokenizers-0.14.1 torch-1.13.1+cpu torchaudio-0.13.1+rocm5.2 torchvision-0.14.1+cpu tqdm-4.66.1 transformers-4.34.1 typing-extensions-4.8.0 typing-inspect-0.9.0 urllib3-1.26.18 yarl-1.9.2 We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default. tokenizers 0.14.1 requires huggingface_hub<0.18,>=0.16.4, but you'll have huggingface-hub 0.18.0 which is incompatible. qdrant-client 1.2.0 requires pydantic<2.0,>=1.8, but you'll have pydantic 2.4.2 which is incompatible. qdrant-client 1.2.0 requires typing-extensions<4.6.0,>=4.0.0, but you'll have typing-extensions 4.8.0 which is incompatible. WARNING: You are using pip version 20.2.3; however, version 23.3.1 is available. You should consider upgrading via the '/tmp/oryx/platforms/python/3.9.7/bin/python3.9 -m pip install --upgrade pip' command. Done in 151 sec(s). Preparing output... Copying files to destination directory '/home/site/wwwroot'... Done in 30 sec(s). Removing existing manifest file Creating a manifest file... Manifest file created. Done in 187 sec(s). Running post deployment command(s)... Generating summary of Oryx build Deployment Log file does not exist in /tmp/oryx-build.log The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build Triggering recycle (preview mode disabled). Linux Consumption plan has a 1.5 GB memory limit on a remote build container. To check our service limit, please visit https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale#service-limitsWriting the artifacts to a squashfs file Parallel mksquashfs: Using 1 processor Creating 4.0 filesystem on /home/site/artifacts/functionappartifact.squashfs, block size 131072. [=======- ] 4200/33071 12% [=========- ] 5400/33071 16% [============- ] 6900/33071 20% [===================\ ] 11100/33071 33% [=======================- ] 13100/33071 39% [=========================================/ ] 23000/33071 69% [=============================================| ] 25700/33071 77% [==============================================| ] 26300/33071 79% [====================================================- ] 29300/33071 88% [=====================================================/ ] 29900/33071 90% [=========================================================/ ] 32400/33071 97% [===========================================================\] 33071/33071 100% Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072 compressed data, compressed metadata, compressed fragments, compressed xattrs duplicates are removed Filesystem size 345872.74 Kbytes (337.77 Mbytes) 28.59% of uncompressed filesystem size (1209715.78 Kbytes) Inode table size 280005 bytes (273.44 Kbytes) 29.78% of uncompressed inode table size (940206 bytes) Directory table size 279378 bytes (272.83 Kbytes) 32.27% of uncompressed directory table size (865769 bytes) Number of duplicate files found 473 Number of inodes 28338 Number of files 25868 Number of fragments 2032 Number of symbolic links 0 Number of device nodes 0 Number of fifo nodes 0 Number of socket nodes 0 Number of directories 2470 Number of ids (unique uids + gids) 1 Number of uids 1 root (0) Number of gids 1 root (0) Creating placeholder blob for linux consumption function app... SCM_RUN_FROM_PACKAGE placeholder blob scm-latest-dulongfunc10.zip located Uploading built content /home/site/artifacts/functionappartifact.squashfs for linux consumption function app... Resetting all workers for dulongfunc10.azurewebsites.net Deployment successful. deployer = Push-Deployer deploymentPath = Functions App ZipDeploy. Extract zip. Remote build. Remote build succeeded! [2023-11-02T07:42:47.947Z] Syncing triggers... Functions in dulongfunc10: ``` ``` func --version 4.0.5441 ```

More importantly, is there a way for us to see what is going wrong once this is deployed please? Perhaps some app logs etc.

mk7exe commented 8 months ago

I'm experiencing exact same problem as @saikumaru. I'm deploying a durable function with a time trigger. Deployment finished successfully but functions cannot be listed at the end. They are also not visible in the portal. Starting to think it was not a good idea to jump on Programming Model V2!

func azure functionapp publish ehs-ds-huddlekpiupdater-dev-func
Getting site publishing info...
[2023-11-02T22:00:35.321Z] Starting the function app deployment...
Creating archive for current directory...
Performing remote build for functions project.
Deleting the old .python_packages directory
Uploading 20.68 KB [##############################################################################]
Remote build in progress, please wait...
Updating submodules.
Preparing deployment for commit id '454373a6-4'.
PreDeployment: context.CleanOutputPath False
PreDeployment: context.OutputPath /home/site/wwwroot
Repository path is /tmp/zipdeploy/extracted
Running oryx build...
Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.10.4 -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.20230210.1, Commit: a49c8f6b8abbe95b4356552c4c884dea7fd0d86e, ReleaseTagName: 20230210.1

Build Operation ID: 30daf5800188b699
Repository Commit : 454373a6-4601-45bc-b0df-e4ab98f24793
OS Type           : bullseye
Image Type        : githubactions

Detecting platforms...
Detected following platforms:
  python: 3.10.4
Version '3.10.4' 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.10.4' to '/tmp/oryx/platforms/python/3.10.4'...
Detected image debian flavor: bullseye.
Downloaded in 1 sec(s).
Verifying checksum...
Extracting contents...
performing sha512 checksum for: python...
Done in 6 sec(s).

image detector file exists, platform is python..
OS detector file exists, OS is bullseye..
Python Version: /tmp/oryx/platforms/python/3.10.4/bin/python3.10
Creating directory for command manifest file if it does not exist
Removing existing manifest file

Running pip install...
Done in 40 sec(s).
[22:00:55+0000] Collecting python-dateutil
[22:00:55+0000]   Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
[22:00:55+0000] Collecting azure-functions
[22:00:55+0000]   Downloading azure_functions-1.17.0-py3-none-any.whl (165 kB)
[22:00:55+0000] Collecting azure-functions-durable
[22:00:55+0000]   Downloading azure_functions_durable-1.2.6-py3-none-any.whl (241 kB)
[22:00:56+0000] Collecting azure-devops
[22:00:56+0000]   Downloading azure_devops-7.1.0b3-py3-none-any.whl (1.6 MB)
[22:00:56+0000] Collecting gspread
[22:00:56+0000]   Downloading gspread-5.12.0-py3-none-any.whl (48 kB)
[22:00:56+0000] Collecting oauth2client
[22:00:56+0000]   Downloading oauth2client-4.1.3-py2.py3-none-any.whl (98 kB)
[22:00:56+0000] Collecting PyOpenSSL
[22:00:56+0000]   Downloading pyOpenSSL-23.3.0-py3-none-any.whl (58 kB)
[22:00:57+0000] Collecting pandas
[22:00:57+0000]   Downloading pandas-2.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.3 MB)
[22:00:58+0000] Collecting six>=1.5
[22:00:58+0000]   Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
[22:01:00+0000] Collecting aiohttp>=3.6.2
[22:01:00+0000]   Downloading aiohttp-3.8.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB)
[22:01:00+0000] Collecting furl>=2.1.0
[22:01:00+0000]   Downloading furl-2.1.3-py2.py3-none-any.whl (20 kB)
[22:01:01+0000] Collecting requests==2.*
[22:01:01+0000]   Downloading requests-2.31.0-py3-none-any.whl (62 kB)
[22:01:01+0000] Collecting certifi>=2017.4.17
[22:01:01+0000]   Downloading certifi-2023.7.22-py3-none-any.whl (158 kB)
[22:01:01+0000] Collecting idna<4,>=2.5
[22:01:01+0000]   Downloading idna-3.4-py3-none-any.whl (61 kB)
[22:01:02+0000] Collecting charset-normalizer<4,>=2
[22:01:02+0000]   Downloading charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142 kB)
[22:01:02+0000] Collecting urllib3<3,>=1.21.1
[22:01:02+0000]   Downloading urllib3-2.0.7-py3-none-any.whl (124 kB)
[22:01:02+0000] Collecting msrest<0.8.0,>=0.7.1
[22:01:02+0000]   Downloading msrest-0.7.1-py3-none-any.whl (85 kB)
[22:01:02+0000] Collecting google-auth-oauthlib>=0.4.1
[22:01:02+0000]   Downloading google_auth_oauthlib-1.1.0-py2.py3-none-any.whl (19 kB)
[22:01:03+0000] Collecting google-auth>=1.12.0
[22:01:03+0000]   Downloading google_auth-2.23.4-py2.py3-none-any.whl (183 kB)
[22:01:03+0000] Collecting rsa>=3.1.4
[22:01:03+0000]   Downloading rsa-4.9-py3-none-any.whl (34 kB)
[22:01:04+0000] Collecting pyasn1-modules>=0.0.5
[22:01:04+0000]   Downloading pyasn1_modules-0.3.0-py2.py3-none-any.whl (181 kB)
[22:01:04+0000] Collecting httplib2>=0.9.1
[22:01:04+0000]   Downloading httplib2-0.22.0-py3-none-any.whl (96 kB)
[22:01:04+0000] Collecting pyasn1>=0.1.7
[22:01:04+0000]   Downloading pyasn1-0.5.0-py2.py3-none-any.whl (83 kB)
[22:01:05+0000] Collecting cryptography<42,>=41.0.5
[22:01:05+0000]   Downloading cryptography-41.0.5-cp37-abi3-manylinux_2_28_x86_64.whl (4.4 MB)
[22:01:06+0000] Collecting tzdata>=2022.1
[22:01:06+0000]   Downloading tzdata-2023.3-py2.py3-none-any.whl (341 kB)
[22:01:06+0000] Collecting pytz>=2020.1
[22:01:06+0000]   Downloading pytz-2023.3.post1-py2.py3-none-any.whl (502 kB)
[22:01:07+0000] Collecting numpy<2,>=1.22.4
[22:01:07+0000]   Downloading numpy-1.26.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)
[22:01:08+0000] Collecting attrs>=17.3.0
[22:01:08+0000]   Downloading attrs-23.1.0-py3-none-any.whl (61 kB)
[22:01:08+0000] Collecting frozenlist>=1.1.1
[22:01:08+0000]   Downloading frozenlist-1.4.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (225 kB)
[22:01:10+0000] Collecting multidict<7.0,>=4.5
[22:01:10+0000]   Downloading multidict-6.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (114 kB)
[22:01:10+0000] Collecting yarl<2.0,>=1.0
[22:01:10+0000]   Downloading yarl-1.9.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (268 kB)
[22:01:11+0000] Collecting async-timeout<5.0,>=4.0.0a3
[22:01:11+0000]   Downloading async_timeout-4.0.3-py3-none-any.whl (5.7 kB)
[22:01:11+0000] Collecting aiosignal>=1.1.2
[22:01:11+0000]   Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
[22:01:11+0000] Collecting cffi>=1.12
[22:01:11+0000]   Downloading cffi-1.16.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (443 kB)
[22:01:12+0000] Collecting pycparser
[22:01:12+0000]   Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
[22:01:12+0000] Collecting orderedmultidict>=1.0.1
[22:01:12+0000]   Downloading orderedmultidict-1.0.1-py2.py3-none-any.whl (11 kB)
[22:01:12+0000] Collecting cachetools<6.0,>=2.0.0
[22:01:12+0000]   Downloading cachetools-5.3.2-py3-none-any.whl (9.3 kB)
[22:01:12+0000] Collecting requests-oauthlib>=0.7.0
[22:01:12+0000]   Downloading requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
[22:01:12+0000] Collecting pyparsing!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3,<4,>=2.4.2
[22:01:12+0000]   Downloading pyparsing-3.1.1-py3-none-any.whl (103 kB)
[22:01:13+0000] Collecting azure-core>=1.24.0
[22:01:13+0000]   Downloading azure_core-1.29.5-py3-none-any.whl (192 kB)
[22:01:13+0000] Collecting isodate>=0.6.0
[22:01:13+0000]   Downloading isodate-0.6.1-py2.py3-none-any.whl (41 kB)
[22:01:13+0000] Collecting typing-extensions>=4.6.0
[22:01:13+0000]   Downloading typing_extensions-4.8.0-py3-none-any.whl (31 kB)
[22:01:13+0000] Collecting oauthlib>=3.0.0
[22:01:13+0000]   Downloading oauthlib-3.2.2-py3-none-any.whl (151 kB)
[22:01:14+0000] Installing collected packages: urllib3, pyasn1, idna, charset-normalizer, certifi, typing-extensions, six, rsa, requests, pycparser, pyasn1-modules, oauthlib, multidict, frozenlist, cachetools, yarl, requests-oauthlib, pyparsing, orderedmultidict, isodate, google-auth, cffi, azure-core, attrs, async-timeout, aiosignal, tzdata, pytz, python-dateutil, numpy, msrest, httplib2, google-auth-oauthlib, furl, cryptography, azure-functions, aiohttp, PyOpenSSL, pandas, oauth2client, gspread, azure-functions-durable, azure-devops
[22:01:34+0000] Successfully installed PyOpenSSL-23.3.0 aiohttp-3.8.6 aiosignal-1.3.1 async-timeout-4.0.3 attrs-23.1.0 azure-core-1.29.5 azure-devops-7.1.0b3 azure-functions-1.17.0 azure-functions-durable-1.2.6 cachetools-5.3.2 certifi-2023.7.22 cffi-1.16.0 charset-normalizer-3.3.2 cryptography-41.0.5 frozenlist-1.4.0 furl-2.1.3 google-auth-2.23.4 google-auth-oauthlib-1.1.0 gspread-5.12.0 httplib2-0.22.0 idna-3.4 isodate-0.6.1 msrest-0.7.1 multidict-6.0.4 numpy-1.26.1 oauth2client-4.1.3 oauthlib-3.2.2 orderedmultidict-1.0.1 pandas-2.1.2 pyasn1-0.5.0 pyasn1-modules-0.3.0 pycparser-2.21 pyparsing-3.1.1 python-dateutil-2.8.2 pytz-2023.3.post1 requests-2.31.0 requests-oauthlib-1.3.1 rsa-4.9 six-1.16.0 typing-extensions-4.8.0 tzdata-2023.3 urllib3-2.0.7 yarl-1.9.2
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
WARNING: You are using pip version 21.2.4; however, version 23.3.1 is available.
You should consider upgrading via the '/tmp/oryx/platforms/python/3.10.4/bin/python3.10 -m pip install --upgrade pip' command.
Not a vso image, so not writing build commands
Preparing output...

Copying files to destination directory '/home/site/wwwroot'...
Done in 3 sec(s).

Removing existing manifest file
Creating a manifest file...
Manifest file created.
Copying .ostype to manifest output directory.

Done in 49 sec(s).
Running post deployment command(s)...

Generating summary of Oryx build
Deployment Log file does not exist in /tmp/oryx-build.log
The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
Triggering recycle (preview mode disabled).
Linux Consumption plan has a 1.5 GB memory limit on a remote build container.
To check our service limit, please visit https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale#service-limits
Writing the artifacts to a squashfs file
Parallel mksquashfs: Using 1 processor
Creating 4.0 filesystem on /home/site/artifacts/functionappartifact.squashfs, block size 131072.

[=================\                                            ] 2600/9226  28%
[============================================================| ] 9200/9226  99%
[=============================================================|] 9226/9226 100%

Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072
        compressed data, compressed metadata, compressed fragments,
        compressed xattrs, compressed ids
        duplicates are removed
Filesystem size 52180.77 Kbytes (50.96 Mbytes)
        28.28% of uncompressed filesystem size (184514.28 Kbytes)
Inode table size 90035 bytes (87.92 Kbytes)
        28.56% of uncompressed inode table size (315238 bytes)
Directory table size 90543 bytes (88.42 Kbytes)
        34.99% of uncompressed directory table size (258734 bytes)
Number of duplicate files found 804
Number of inodes 9738
Number of files 8634
Number of fragments 721
Number of symbolic links  0
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 1104
Number of ids (unique uids + gids) 1
Number of uids 1
        root (0)
Number of gids 1
        root (0)
Creating placeholder blob for linux consumption function app...
SCM_RUN_FROM_PACKAGE placeholder blob scm-latest-ehs-ds-huddlekpiupdater-dev-func.zip located
Uploading built content /home/site/artifacts/functionappartifact.squashfs for linux consumption function app...
Resetting all workers for ehs-ds-huddlekpiupdater-dev-func.azurewebsites.net
Deployment successful. deployer = Push-Deployer deploymentPath = Functions App ZipDeploy. Extract zip. Remote build.
Remote build succeeded!
[2023-11-02T22:02:21.797Z] Syncing triggers...
Functions in ehs-ds-huddlekpiupdater-dev-func:

func --version 4.0.5441

vrdmr commented 8 months ago

@mk7exe - Checking the issue and why was this issue not surfaced. I see the exception in the backend, and it looks like an issue on our end. I'll get that fixed asap and release it in the latest version of the azure-python-functions-durable.

image

The issue with logs not showing up - I am investigating that on my end and checking how to surface this. Most likely the logs would be on AppInsights and not on the build system.

saikumaru commented 8 months ago

Thank you @vrdmr ! That would be really helpful to have that logs, please keep us updated. if you have access to look at the backend logs, here is the app

app ```text https://tomafunc1.azurewebsites.net ```
saikumaru commented 8 months ago

@saikumaru Yes, Function is showing up in portal and works as expected.

@pdthummar Hope you had a chance to check my reply. However Id like to reconfirm if you have used both my files as-is when you tested and deployed it(Py version=3.9.13)?

mk7exe commented 8 months ago

Thanks @vrdmr. I'm looking forward for your updates

pdthummar commented 8 months ago

@saikumaru I tested with python3.10 earlier and worked without any issues. but i have tried to test it with python3.9 and experienced same issue. It appears to be a qdrant-client 1.2.0 conflicting libraries issue. In your remote build log, I've observed a below warning message that is potentially causing the issue. qdrant-client 1.2.0 requires pydantic<2.0,>=1.8, but you'll have pydantic 2.4.2 which is incompatible. qdrant-client 1.2.0 requires typing-extensions<4.6.0,>=4.0.0, but you'll have typing-extensions 4.8.0 which is incompatible.

As a result of this compatibility issue, the worker is failing to index functions with below error, due to this, functions aren't visible in the portal.

Error

Worker failed to index functions Result: Failure Exception: ImportError: cannot import name 'ENCODERS_BY_TYPE' from 'pydantic.json' (/home/site/wwwroot/.python_packages/lib/site-packages/pydantic/json.py). Troubleshooting Guide: https://aka.ms/functions-modulenotfound Stack: File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py', line 345, in _handle__functions_metadata_request fx_metadata_results = self.index_functions(function_path) File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py', line 617, in index_functions indexed_functions = loader.index_function_app(function_path) 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 214, in index_function_app imported_module = importlib.import_module(module_name) File '/usr/local/lib/python3.9/importlib/init.py', line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File '', line 1030, in _gcd_import File '', line 1007, in _find_and_load File '', line 986, in _find_and_load_unlocked File '', line 680, in _load_unlocked File '', line 850, in exec_module File '', line 228, in _call_with_frames_removed File '/home/site/wwwroot/function_app.py', line 6, in from qdrant_client import QdrantClient File '/home/site/wwwroot/.python_packages/lib/site-packages/qdrant_client/__init__.py', line 1, in from .qdrant_client import QdrantClient as QdrantClient File '/home/site/wwwroot/.python_packages/lib/site-packages/qdrant_client/qdrant_client.py', line 4, in from qdrant_client.client_base import QdrantBase File '/home/site/wwwroot/.python_packages/lib/site-packages/qdrant_client/client_base.py', line 3, in from qdrant_client.conversions import common_types as types File '/home/site/wwwroot/.python_packages/lib/site-packages/qdrant_client/conversions/common_types.py', line 13, in from qdrant_client.http import models as rest File '/home/site/wwwroot/.python_packages/lib/site-packages/qdrant_client/http/__init__.py', line 4, in from qdrant_client.http.api_client import ( # noqa F401 File '/home/site/wwwroot/.python_packages/lib/site-packages/qdrant_client/http/api_client.py', line 7, in from qdrant_client.http.api.cluster_api import AsyncClusterApi, SyncClusterApi File '/home/site/wwwroot/.python_packages/lib/site-packages/qdrant_client/http/api/cluster_api.py', line 7, in from pydantic.json import ENCODERS_BY_TYPE

To address the issue, I attempted to utilize qdrant_client without specifying a specific version in requirements.txt (i.e., not using qdrant_client==1.2.0). After redeploying, I observed that the function is now accessible through the portal. (Using Python3.9)

I would suggest retrying deployment with above mitigation. Thanks

saikumaru commented 8 months ago

@pdthummar thank you very much for persistently looking into this. I will give it a try and hopefully this should be it. Can you confirm if this error was on your local or remote please, and if it's remote where exactly can these be viewed?

But I wish I could have seen these logs on remote as well, or the portal say at least something about why the function dint show up. In v1 we were able to view logs but v2 doesn't show these reasons.

saikumaru commented 7 months ago

@pdthummar that has worked, thank you!

As a result of this compatibility issue, the worker is failing to index functions with below error, due to this, functions aren't visible in the portal.

Please can you advise how and where we can look up that failures?

saikumaru commented 7 months ago

The issue with logs not showing up - I am investigating that on my end and checking how to surface this. Most likely the logs would be on AppInsights and not on the build system.

@vrdmr would you have an update on this please, so that we can debug similar errors.

jmandivarapu commented 7 months ago

I am having similar issues where ....

  1. I deployed the python functions using VS code (It works and all the functions show up including all the files)
  2. Deploying using the Azure Devops - App files got updated but NO FUNCTIONS

Tried all possible plans but none of seams to work. I am currently using Python 3.10 and V2 function. All logs in deployment center doesn't show any error.

My requirement function is : azure-functions

openai[datalib]==0.28
azure-search-documents ==11.4.0b9
azure-storage-blob==12.14.1
cffi
markdown
pymongo
python-jose
six
tiktoken
msal
pdthummar commented 6 months ago

@saikumaru We are actively addressing this matter to offer users more clarification on such issues. We will provide an update once we make progress on this. I am closing this issue for now. Thanks

@jmandivarapu If you are still facing the issue, please open new issue. Thanks

tomasfernandez1212 commented 5 months ago

Plus one.

It is very frustrating to debug issues that occur outside of the function definition.

For example, import errors, missing dependencies, or issues with the binding and trigger definitions.

We are essentially flying blind when trying to debug these problems.

Azure Functions should provide more access to logging that can lend a light to these issues.

erfannariman commented 4 months ago

@saikumaru We are actively addressing this matter to offer users more clarification on such issues. We will provide an update once we make progress on this. I am closing this issue for now. Thanks

@jmandivarapu If you are still facing the issue, please open new issue. Thanks

Why was this issue closed while this clearly is an ongoing issue? Is there an other topic where we can follow the progress on this issue?

BDParwez commented 4 months ago

In case that it is not visible means that there is either missing an dependency (why pip freeze resolves the issue) or an dependency cannot be installed on the serverless instance. I had an issue with the psycopg2 package.

mk7exe commented 4 months ago

@BDParwez I’m pretty sure that is not the case. I deployed the same function with the same dependencies in V1 and everything works fine. Same function in V2 has the issue of functions not being visible in the portal and not being callable.

stock-ds commented 4 months ago

I had the same issue and found the actual error by opening MyAzureFunction/Monitoring/Log Stream/Filesystem Logs and deploying the function.

I saw an error that imports were broken even though VS code said deployment was "successful" and function did not appear. Fixed this error and now function appears.

EDIT:

Added more code and it no longer shows any other errors in that log stream and function does not appear...

I found the actual actual error by setting up WSL in VS code and running the function there. It immediately threw the error which azure eats up. It was a keras model which works in windows but doesn't work in linux, I just re-saved this model using WSL, tested locally, and now functions appear in Azure.

Azure should just throw these errors instead of silencing them and saying that the deployment is successful...

TLDR: Use WSL to test your function locally

harsh098 commented 3 months ago

Experiencing a similar issue here too...

JanKrl commented 2 months ago

The same issue using Python V2. Deploying from vscode worked. Deploying a zip did not work even though the code was visible in Azure Portal. Switching to Python V1 solved the problem.

TheBestMomo commented 2 months ago

Microsoft recently updated their documentation, and the solution is to add the following code to the pipeline YAML file:

Here are the Microsoft documentations that describe the error and solution https://learn.microsoft.com/en-us/azure/azure-functions/recover-python-functions?tabs=vscode%2Cbash&pivots=python-mode-decorators#functions-not-found-after-deployment

https://learn.microsoft.com/en-us/azure/azure-functions/functions-how-to-azure-devops?tabs=python&pivots=v2

pk556 commented 1 month ago

Hi all,

I was running into the same issues mentioned above. I was using the Deployment Center in the Azure Function App to connect it to my GitHub, and no matter which packages I installed inside my requirements.txt file—even something as common as requests—the function trigger would not show up in the portal when deployed because it couldn't find the packages.

The solution I found was to zip up the library packages during the GitHub build instead of letting Oryx do the remote build. Here are the changes I made to the GitHub workflow file to achieve this:

  1. Inside the "Install dependencies" step of the build job, change the pip install command pip install --target=".python_packages/lib/site-packages" -r requirements.txt
  2. Inside the "Zip artifact for deployment" step of the build job, change the zip command so it includes the python_packages zip release.zip .python_packages ./* -r
  3. Inside the "Deploy to Azure Functions" step of the deploy job, change these values so it doesn't do a remote build scm-do-build-during-deployment: false enable-oryx-build: false

This way you can still use the V2 programming model and can use Github Actions instead of VSCode to deploy to the Azure Function.

nopg commented 1 month ago

Thanks so much pk556 (and others). I was running into this as well and pulling my hair out. My python func deployed fine when using basic auth/github cicd, but this issue manifested when I tried to instead use User Managed Identity/Federated and sync CICD to github.

The steps pk556 outlined finally and immediately resolved the missing functions issue for me.