Azure-Samples / azure-search-openai-demo

A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure AI Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.
https://azure.microsoft.com/products/search
MIT License
6.32k stars 4.23k forks source link

app command line miss match #1830

Closed cforce closed 4 months ago

cforce commented 4 months ago

The azure web application is not starting up / errors with

6gwercguaeuhq.scm.azurewebsites.net/api/vfs/LogFiles/2024_07_17_lw1sdlwk0000ZJ_default_docker.log)
2024-07-17T23:17:06.604588362Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-17T23:17:06.604591862Z   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
2024-07-17T23:17:06.604613262Z   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
2024-07-17T23:17:06.604617062Z   File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
2024-07-17T23:17:06.604620962Z ModuleNotFoundError: No module named 'main'
2024-07-17T23:17:06.607552268Z [2024-07-17 23:17:06 +0000] [67] [INFO] Worker exiting (pid: 67)
2024-07-17T23:17:07.259553990Z [2024-07-17 23:17:07 +0000] [62] [ERROR] Worker (pid:67) exited with code 3
2024-07-17T23:17:07.268840809Z [2024-07-17 23:17:07 +0000] [62] [ERROR] Shutting down: Master
2024-07-17T23:17:07.285444443Z [2024-07-17 23:17:07 +0000] [62] [ERROR] Reason: Worker failed to boot./home/LogFiles/2024_07_17_lw1sdlwk0000ZJ_default_scm_docker.log  (https://app-backend-6gwercguaeuhq.scm.azurewebsites.net/api/vfs/LogFiles/2024_07_17_lw1sdlwk0000ZJ_default_scm_docker.log)
2024-07-17T15:30:10.6406269Z Wed Jul 17 15:30:10 UTC 2024 running .net core
2024-07-17T15:30:15.3463564Z Startup : 03.30.15.242558
2024-07-17T15:30:15.5617329Z Configure Services : 03.30.15.560726
2024-07-17T15:30:17.3290924Z Configure : 03.30.17.313987
2024-07-17T15:30:18.7879275Z Setting Up Routes : 03.30.18.787621
2024-07-17T15:30:20.6814800Z Exiting Configure : 03.30.20.674603
2024-07-17T15:30:21.6960998Z Hosting environment: Production
2024-07-17T15:30:21.6969482Z Content root path: /opt/Kudu
2024-07-17T15:30:21.6978900Z Now listening on: http://0.0.0.0:8181
2024-07-17T15:30:21.7149183Z Application started. Press Ctrl+C to shut down./home/LogFiles/2024_07_17_lw1sdlwk0000ZJ_docker.log  (https://app-backend-6gwercguaeuhq.scm.azurewebsites.net/api/vfs/LogFiles/2024_07_17_lw1sdlwk0000ZJ_docker.log)

There is a python webapp runtime missmatch between bicep main.bicep

runtimeName: 'python'
runtimeVersion: '3.11'
appCommandLine: 'python3 -m gunicorn main:app'

and the one used in app/frontend/start.sh which starts fine without erros Python@3.11.9 , npm@10.8.2, node@v18.20.3

cd ../backend
port=50505
host=localhost
python -m quart --app main:app run --port "$port" --host "$host" --reload

Using latest version /main /17.07.2024

pamelafox commented 4 months ago

The commands are expected to be different. We use gunicorn in production, since it can handle multiple processes.

If you are getting that error, it usually means there was an issue with the deploy or that the App Service server is still starting up. See this guide to debugging App Service deployments: https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/docs/appservice.md

pamelafox commented 4 months ago

Closing this issue, but please open a new one if you believe there's an error after going through the App Service deployment guide.

cforce commented 3 months ago

see https://github.com/Azure-Samples/azure-search-openai-demo/issues/1864