sample-app-aoai-chatGPT
sample-app-aoai-chatGPT copied to clipboard
"No module named gunicorn" still shows up
Describe the bug "No module named gunicorn" showed up and I failed to start the webapp.
To Reproduce 1.Make some changes to the code(just to the frontend) and build the app code with start.cmd 2.Deploy the app with the Azure CLI https://github.com/microsoft/sample-app-aoai-chatGPT?tab=readme-ov-file#deploy-with-the-azure-cli 3.Try to start the app. 4.An error occurred.":( Application Error If you are the application administrator, you can access the diagnostic resources."
Expected behavior The Web app should be started successfully.
Screenshots
Configuration
- Azure OpenAI model name and version : gpt-4 0613
- Is chat history enabled? : No
- Are you using data? If so, what data source? (e.g. Azure AI Search, Azure CosmosDB Mongo vCore, etc): No
Additional context What I have tried 1.Deploy with the latest code(the problem "no module named gunicorn" should has been fixed by adding gunicorn to the requirements.txt file) https://github.com/microsoft/sample-app-aoai-chatGPT/issues/600
2.Make some changes to the gunicorn.conf.py and WebApp.DockerFile https://github.com/microsoft/sample-app-aoai-chatGPT/issues/600
3.Set the startup command "python3 -m gunicorn app:app" https://github.com/microsoft/sample-app-aoai-chatGPT/issues/578
4.Add the environment variable "WEBSITES_PORT=8000"
App Service Log Stream 2024-03-21T07:59:52.284529213Z A P P S E R V I C E O N L I N U X 2024-03-21T07:59:52.284533213Z 2024-03-21T07:59:52.284537114Z Documentation: http://aka.ms/webapp-linux 2024-03-21T07:59:52.284541214Z Python 3.11.7 2024-03-21T07:59:52.284545114Z Note: Any data outside '/home' is not persisted 2024-03-21T08:00:10.355872681Z Starting OpenBSD Secure Shell server: sshd. 2024-03-21T08:00:11.714511413Z Site's appCommandLine: python3 -m gunicorn app:app 2024-03-21T08:00:11.782133591Z Launching oryx with: create-script -appPath /home/site/wwwroot -output /opt/startup/startup.sh -virtualEnvName antenv -defaultApp /opt/defaultsite -userStartupCommand 'python3 -m gunicorn app:app' 2024-03-21T08:00:12.507301389Z Found build manifest file at '/home/site/wwwroot/oryx-manifest.toml'. Deserializing it... 2024-03-21T08:00:12.518582469Z Build Operation ID: 71f84425d7bc56df 2024-03-21T08:00:12.526280360Z Oryx Version: 0.2.20240127.1, Commit: 4b7f2dffcc69c214f9806d67a85ec8926e2393e1, ReleaseTagName: 20240127.1 2024-03-21T08:00:12.575072371Z Output is compressed. Extracting it... 2024-03-21T08:00:12.575108972Z Extracting '/home/site/wwwroot/output.tar.gz' to directory '/tmp/8dc4976a9651c79'... 2024-03-21T08:00:37.071489713Z App path is set to '/tmp/8dc4976a9651c79' 2024-03-21T08:00:43.135453051Z Writing output script to '/opt/startup/startup.sh' 2024-03-21T08:00:45.075816580Z Using packages from virtual environment antenv located at /tmp/8dc4976a9651c79/antenv. 2024-03-21T08:00:45.075854381Z Updated PYTHONPATH to '/opt/startup/app_logs:/tmp/8dc4976a9651c79/antenv/lib/python3.11/site-packages' 2024-03-21T08:00:45.334222700Z /tmp/8dc4976a9651c79/antenv/bin/python3: No module named gunicorn s-openaiwebapp2__33a4 2024-03-21T08:00:34.010Z INFO - Waiting for response to warmup request for container csk-azops-openaiwebapp2__33a4_0_e0064a1c. Elapsed time = 17.0226611 sec 2024-03-21T08:00:45.778Z ERROR - Container csk-azops-openaiwebapp2__33a4_0_e0064a1c for site csk-azops-openaiwebapp2__33a4 has exited, failing site start 2024-03-21T08:00:45.779Z INFO - Initiating warmup request to container csk-azops-openaiwebapp2__33a4_0_e0064a1c_middleware for site csk-azops-openaiwebapp2__33a4 2024-03-21T08:00:46.891Z INFO - Container csk-azops-openaiwebapp2__33a4_0_e0064a1c_middleware for site csk-azops-openaiwebapp2__33a4 initialized successfully and is ready to serve requests. 2024-03-21T08:00:46.912Z ERROR - Container csk-azops-openaiwebapp2__33a4_0_e0064a1c didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging. 2024-03-21T08:00:46.950Z INFO - Stopping site csk-azops-openaiwebapp2__33a4 because it failed during startup.
I am facing the same issue, any recommendations?
Hi @rochaktarika123 @chindaku9531 you need to set the startup command on the app. And make sure the port you set matches in the env variable and gunicorn.conf.py
az webapp config set --startup-file "python3 -m gunicorn app:app" --name <new-app-name>
Hi @sarah-widder Thank you for your reply. Actually I have set the startup command and tried making changes to gunicorn.conf.py like this: bind = "0.0.0.80", but this error still shows up.
Hi @rochaktarika123 How about your situation?
Hi @chindaku9531,
My problem is resolved just by using python 3.11 in azure webapp :)
Hi @chindaku9531 - I tried multiple things but finally what worked was modifying the statup command as below. Hope it works for you as well
python3 -m gunicorn -k uvicorn.workers.UvicornWorker app:app
I am facing same issue
2024-04-16T13:35:29 Welcome, you are now connected to log-streaming service.Starting Log Tail -n 10 of existing logs ----/home/LogFiles/__lastCheckTime.txt (https://qatarbotshell.scm.azurewebsites.net/api/vfs/LogFiles/__lastCheckTime.txt)04/16/2024 13:34:09
/home/LogFiles/kudu/trace/01e4b68d2ef844fea5194542007a89c5-dbbadcee-b89a-4a94-bd47-62979135bf7b.txt (https://qatarbotshell.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/01e4b68d2ef844fea5194542007a89c5-dbbadcee-b89a-4a94-bd47-62979135bf7b.txt)
2024-04-16T13:23:32 Startup Request, url: /api/zipdeploy?isAsync=true, method: POST, type: request, pid: 86,1,7, ScmType: None/home/LogFiles/kudu/trace/94af43c0f2fa4c0995d5140091fa213c-0894961d-5ff4-469b-a18b-093ca8a0bc7f.txt (https://qatarbotshell.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/94af43c0f2fa4c0995d5140091fa213c-0894961d-5ff4-469b-a18b-093ca8a0bc7f.txt)
2024-04-16T13:11:48 Startup Request, url: /api/deployments/?$orderby=ReceivedTime%20desc&$top=20&api-version=2022-03-01, method: GET, type: request, pid: 87,1,7, ScmType: None/home/LogFiles/kudu/trace/c44312df76654affba89fc8047793caa-e6ae8b1a-7f3c-4848-9b98-c5a77c9306db.txt (https://qatarbotshell.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/c44312df76654affba89fc8047793caa-e6ae8b1a-7f3c-4848-9b98-c5a77c9306db.txt)
2024-04-16T13:07:03 Startup Request, url: /api/deployments/?$orderby=ReceivedTime%20desc&$top=20&api-version=2022-03-01, method: GET, type: request, pid: 86,1,5, ScmType: None/home/LogFiles/kudu/trace/de0cda65bb40-d949e7e3-12a7-4043-a21d-bdc5cf5b1956.txt (https://qatarbotshell.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/de0cda65bb40-d949e7e3-12a7-4043-a21d-bdc5cf5b1956.txt)
2024-04-16T13:34:03 Startup Request, url: /api/deployments/?%24orderby=ReceivedTime%20desc&%24top=20&api-version=2022-03-01, method: GET, type: request, pid: 86,1,7, ScmType: None/home/LogFiles/2024_04_16_lw1sdlwk0001VG_default_docker.log (https://qatarbotshell.scm.azurewebsites.net/api/vfs/LogFiles/2024_04_16_lw1sdlwk0001VG_default_docker.log)
2024-04-16T13:34:16.453722213Z File "
I added this python3 -m gunicorn -k uvicorn.workers.UvicornWorker app:app but it still didn't work.
I had the same issue. After deleting everything from kudu (rm -rf using bash) and redeploying using VScode with remote build configured it worked. I could not find the actual cause though.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.