-
Notifications
You must be signed in to change notification settings - Fork 107
Description
Expected Behavior
Azure Functions Python 3.13 container should successfully start and load functions when using packages that depend on grpcio, such as google-cloud-aiplatform. The dependency isolation feature should handle version conflicts between the runtime's internal dependencies and application dependencies without causing crashes.
Actual Behavior
The Azure Functions runtime fails to start with exit code 139 when importing packages that depend on grpcio (specifically google-cloud-aiplatform). The Python worker crashes during the dependency loading phase, causing the entire Functions host to shut down and restart repeatedly until it exceeds the retry limit. The issue is specific to the Python 3.13 container image tag: 4-python3.13 and does not occur with Python 3.12 containers or local development.
Steps to Reproduce
- Clone the repository:
git clone https://github.com/RodriGoncaDeeployer/dummy_func.git - Switch to the failing branch:
git checkout fail - Build the Docker image:
docker compose build - Run the Docker container:
docker compose up --force-recreate - Wait approximately 2 minutes for the error to manifest
- Observe the Python worker crash with exit code 139
The crash is triggered by the import statement from google.api_core.exceptions import NotFound in
function_app.py.
Commenting out this import allows the function to start successfully.
Relevant code being tried
import json
import sys
import azure.functions as func
# Fails when using Python 3.13 docker image and when deployed to Azure Functions using docker container deployment.
# It does not fail when running locally with Python 3.13
from google.api_core.exceptions import NotFound
# ------------------------------------------------------------
func.HttpResponse.mimetype = "application/json"
func.HttpResponse.charset = "utf-8"
app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)
@app.function_name(name="endpoint")
@app.route(route="endpoint", methods=["GET"])
def main(req: func.HttpRequest) -> str:
response: dict[str, str] = {"python": sys.version}
return func.HttpResponse(json.dumps(response), status_code=200)Relevant log output
...
dummy-func | dbug: Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcFunctionInvocationDispatcher[0]
dummy-func | Handling WorkerErrorEvent for runtime:python, workerId:python. Failed with: Microsoft.Azure.WebJobs.Script.Workers.WorkerProcessExitException: python exited with code 139 (0x8B)
dummy-func | ---> System.Exception
dummy-func | --- End of inner exception stack trace ---
dummy-func | dbug: Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcFunctionInvocationDispatcher[0]
dummy-func | Attempting to dispose webhost or jobhost channel for workerId: '98b7cf7b-502d-49c1-8739-195b21895722', runtime: 'python'
dummy-func | dbug: Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcFunctionInvocationDispatcher[0]
dummy-func | No initialized worker channels for runtime 'python'. Delaying future invocations
dummy-func | dbug: Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcFunctionInvocationDispatcher[0]
dummy-func | Restarting worker channel for runtime: 'python'
dummy-func | fail: Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcFunctionInvocationDispatcher[0]
dummy-func | Exceeded language worker restart retry count for runtime:python. Shutting down and proactively recycling the Functions Host to recover
...
dummy-func | warn: Host.Startup[0]
dummy-func | No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).requirements.txt file
azure-functions==1.24.0
google-cloud-aiplatform==1.121.0Where are you facing this problem?
Local - Core Tools
Function app name
https://github.com/RodriGoncaDeeployer/dummy_func
Additional Information
See README.md for detailed instructions on how to reproduce the bug.