microsoft / sample-app-aoai-chatGPT

Sample code for a simple web chat experience through Azure OpenAI, including Azure OpenAI On Your Data.
MIT License
1.65k stars 2.61k forks source link

KeyError: 'PROVIDE_AUTOMATIC_OPTIONS' (Quart update) #1176

Open DeepikashreePrakash opened 10 hours ago

DeepikashreePrakash commented 10 hours ago

Describe the bug Couldn't start the Quart App service after default manual deployment. I ran the deployment from the Visual studio Code:

Image

To Reproduce Steps to reproduce the behavior:

  1. Open the source folder in VS Code
  2. Login into Azure from VS Code
  3. Click on the resource group required
  4. Choose the web app to deployed and click on "Deploy to Web app"
  5. Click on "Deploy"
  6. Once the code is deployed
  7. Restart the web app
  8. While accessing the deployed web app, I am encountering the following application error:

Image

Notice KeyError: 'PROVIDE_AUTOMATIC_OPTIONS' (trying to access missing key from dict).

Expected behavior The web app has to be up and running after restarting the web app post deployment.

Screenshots Image

Configuration: Please provide the following

 cd src
 python3 -m uvicorn app:app --host 0.0.0.0

Framework: Python - Quart App Environment: Azure Component: Azure Web app

Logs

2024-11-15T10:35:15.300328144Z File "/tmp/8dd0550d24f0c31/antenv/lib/python3.11/site-packages/quart/app.py", line 336, in init 2024-11-15T10:35:15.300333705Z self.add_url_rule( 2024-11-15T10:35:15.300339104Z File "/tmp/8dd0550d24f0c31/antenv/lib/python3.11/site-packages/flask/sansio/scaffold.py", line 47, in wrapper_func 2024-11-15T10:35:15.300345416Z return f(self, *args, **kwargs) 2024-11-15T10:35:15.300351538Z ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-11-15T10:35:15.300357850Z File "/tmp/8dd0550d24f0c31/antenv/lib/python3.11/site-packages/flask/sansio/app.py", line 641, in add_url_rule 2024-11-15T10:35:15.300364111Z if "OPTIONS" not in methods and self.config["PROVIDE_AUTOMATIC_OPTIONS"]: 2024-11-15T10:35:15.300370223Z ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-11-15T10:35:15.300375713Z KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'/home/LogFiles/2024_11_15_lm1sdlwk000033_docker.log (https://chatbotcao-go-dev-queryrespapi02.scm.azurewebsites.net/api/vfs/LogFiles/2024_11_15_lm1sdlwk000033_docker.log) 2024-11-15T10:35:03.262Z INFO - Pull Image successful, Time taken: 0 Seconds 2024-11-15T10:35:03.303Z INFO - Starting container for site 2024-11-15T10:35:03.315Z INFO - docker run -d --expose=8181 --name chatbotcao-go-dev-queryrespapi02_1_90d0374b_middleware -e WEBSITE_CORS_ALLOWED_ORIGINS=https://chatbotcao-go-dev-chatbotui01.azurewebsites.net,http://localhost:4200,https://spo-global.kpmg.com,https://chatbotcao-go-dev-chatbotui02.azurewebsites.net,https://chatbotcao-go-dev-chatbotui.caochatbot.goappsdevcloud.kpmg.com,https://orionsystems1.sharepoint.com,https://aicompanion.dev.kpmg.com,https://chatbotcao-go-qa-chatbotui01.azurewebsites.net -e WEBSITE_CORS_SUPPORT_CREDENTIALS=True -e WEBSITE_SITE_NAME=chatbotcao-go-dev-queryrespapi02 -e WEBSITE_AUTH_ENABLED=False -e PORT=8181 -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=chatbotcao-go-dev-queryrespapi02.azurewebsites.net -e WEBSITE_INSTANCE_ID=b31470e154f58967677a7d0b11791d9cc82d654c8509c89040c3a8df24c5a255 mcr.microsoft.com/appsvc/middleware:stage3 REDACTED 2024-11-15T10:35:03.315Z INFO - Logging is not enabled for this container.Please use https://aka.ms/linux-diagnostics t2024-11-15T10:35:04.033Z INFO - Initiating warmup request to container chatbotcao-go-dev-queryrespapi02_1_90d0374b for site chatbotcao-go-dev-queryrespapi02 2024-11-15T10:35:19.331Z ERROR - Container chatbotcao-go-dev-queryrespapi02_1_90d0374b for site chatbotcao-go-dev-queryrespapi02 has exited, failing site start 2024-11-15T10:35:19.331Z INFO - Initiating warmup request to container chatbotcao-go-dev-queryrespapi02_1_90d0374b_middleware for site chatbotcao-go-dev-queryrespapi02 2024-11-15T10:35:19.552Z INFO - Container chatbotcao-go-dev-queryrespapi02_1_90d0374b_middleware for site chatbotcao-go-dev-queryrespapi02 initialized successfully and is ready to serve requests. 2024-11-15T10:35:19.560Z ERROR - Container chatbotcao-go-dev-queryrespapi02_1_90d0374b didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging. 2024-11-15T10:35:19.567Z INFO - Stopping site chatbotcao-go-dev-queryrespapi02 because it failed during startup./home/LogFiles/AppServiceAppLogs_Feature_Installer/startup_0.log (https://chatbotcao-go-dev-queryrespapi02.scm.azurewebsites.net/api/vfs/LogFiles/AppServiceAppLogs_Feature_Installer/startup_0.log)

reminegrier commented 10 hours ago

Hello, had the same issue and fixed with the following : https://github.com/microsoft/sample-app-aoai-chatGPT/pull/1174