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.44k stars 2.15k forks source link

Can't run the basic repo on main branch #786

Open kagoolastha23 opened 2 months ago

kagoolastha23 commented 2 months ago

Describe the bug Getting application error after deploying the code on App service

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Azure CLI on Azure Cloud shell'
  2. Git clone the repo
  3. run the repo
  4. See error

Expected behavior The default contoso webpage should open

Screenshots

sampleissue1 sampleissue2

Configuration: Please provide the following

Additional context This code was running last week when I deployed on App service in Azure

kagoolastha23 commented 2 months ago

This is the error on logs

sampleissue1

Please guide on how to resolve it.

abhahn commented 2 months ago

Hi @kagoolastha23 , thanks for sharing the details! I just wanted to ask a clarifying question about how you're running the app from the cloud shell. Are you running the start.sh file to start the project, or are you running a deployment using the az CLI? Any specific details about that will be helpful.

abhahn commented 2 months ago

Another thing that might help is if you could show the output of the following command:

az webapp log tail --name <your app name> --resource-group <your rg>

kagoolastha23 commented 2 months ago

Hi @kagoolastha23 , thanks for sharing the details! I just wanted to ask a clarifying question about how you're running the app from the cloud shell. Are you running the start.sh file to start the project, or are you running a deployment using the az CLI? Any specific details about that will be helpful.

I am running the using 'az' CLI.

kagoolastha23 commented 2 months ago

Another thing that might help is if you could show the output of the following command:

az webapp log tail --name <your app name> --resource-group <your rg>

/home/LogFiles/lastCheckTime.txt (https://qahrshellbot.scm.azurewebsites.net/api/vfs/LogFiles/lastCheckTime.txt)

04/17/2024 07:03:29

/home/LogFiles/kudu/trace/3b3f5a8e8ee94cafb6e7682639f45fcc-b9c60c26-6d1f-4c3c-9dd3-10160eae2d70.txt (https://qahrshellbot.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/3b3f5a8e8ee94cafb6e7682639f45fcc-b9c60c26-6d1f-4c3c-9dd3-10160eae2d70.txt)

2024-04-17T06:45:27 Startup Request, url: /api/deployments/?$orderby=ReceivedTime%20desc&$top=20&api-version=2022-03-01, method: GET, type: request, pid: 92,1,15, ScmType: None /home/LogFiles/kudu/trace/965573b0f910468d94b2b4e69929ae2a-bd22cd84-f7d6-4117-a325-437a921cdda3.txt (https://qahrshellbot.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/965573b0f910468d94b2b4e69929ae2a-bd22cd84-f7d6-4117-a325-437a921cdda3.txt) 2024-04-17T06:43:26 Startup Request, url: /api/deployments/?%24orderby=ReceivedTime%20desc&%24top=20&api-version=2022-03-01, method: GET, type: request, pid: 87,1,7, ScmType: None /home/LogFiles/kudu/trace/98ec4c5e73db-808e59dc-47ff-48b8-b7c9-01d14f08ef2f.txt (https://qahrshellbot.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/98ec4c5e73db-808e59dc-47ff-48b8-b7c9-01d14f08ef2f.txt) 2024-04-17T06:56:41 Startup Request, url: /api/zipdeploy?isAsync=true, method: POST, type: request, pid: 86,1,7, ScmType: None, SCM_DO_BUILD_DURING_DEPLOYMENT: true /home/LogFiles/2024_04_17_lw1sdlwk0000O0_default_docker.log (https://qahrshellbot.scm.azurewebsites.net/api/vfs/LogFiles/2024_04_17_lw1sdlwk0000O0_default_docker.log) 2024-04-17T06:59:19.840967378Z return _bootstrap._gcd_import(name[level:], package, level) 2024-04-17T06:59:19.840971879Z File "", line 1050, in _gcd_import 2024-04-17T06:59:19.840977079Z File "", line 1027, in _find_and_load 2024-04-17T06:59:19.840981479Z File "", line 1004, in _find_and_load_unlocked 2024-04-17T06:59:19.840985979Z ModuleNotFoundError: No module named 'app' 2024-04-17T06:59:19.840990280Z [2024-04-17 06:59:19 +0000] [59] [INFO] Worker exiting (pid: 59) 2024-04-17T06:59:20.364920583Z [2024-04-17 06:59:20 +0000] [47] [ERROR] Worker (pid:59) exited with code 3 2024-04-17T06:59:20.399407703Z [2024-04-17 06:59:20 +0000] [47] [ERROR] Shutting down: Master 2024-04-17T06:59:20.399438105Z [2024-04-17 06:59:20 +0000] [47] [ERROR] Reason: Worker failed to boot. /home/LogFiles/2024_04_17_lw1sdlwk0000O0_docker.log (https://qahrshellbot.scm.azurewebsites.net/api/vfs/LogFiles/2024_04_17_lw1sdlwk0000O0_docker.log) 2024-04-17T07:03:31.995Z INFO - Digest: sha256:304127d40f59f3fde1a079fe55610abb72964a9c7769e18cbcea4c9482bf929c 2024-04-17T07:03:32.006Z INFO - Status: Downloaded newer image for 10.1.0.4:13209/appsvc/python:3.10_20240207.3.tuxprod 2024-04-17T07:03:32.026Z INFO - Pull Image successful, Time taken: 0 Seconds 2024-04-17T07:03:32.739Z INFO - Starting container for site 2024-04-17T07:03:32.742Z INFO - docker run -d --expose=8000 --name qahrshellbot_0_efe31bb7 -e WEBSITE_USE_DIAGNOSTIC_SERVER=false -e WEBSITE_SITE_NAME=qahrshellbot -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=qahrshellbot.azurewebsites.net -e WEBSITE_INSTANCE_ID=a822bcb6dd314caab4bd83084cc7a3991e4965ec4f97b7ce99c0ca46861dc419 appsvc/python:3.10_20240207.3.tuxprod python3 -m gunicorn app:app 2024-04-17T07:03:32.743Z INFO - Logging is not enabled for this container. Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here. 2024-04-17T07:03:35.978Z INFO - Initiating warmup request to container qahrshellbot_0_efe31bb7 for site qahrshellbot 2024-04-17T07:04:08.931Z INFO - Waiting for response to warmup request for container qahrshellbot_0_efe31bb7. Elapsed time = 32.9525835 sec 2024-04-17T07:04:35.219Z INFO - Container qahrshellbot_0_efe31bb7 for site qahrshellbot initialized successfully and is ready to serve requests. /home/LogFiles/AppServiceAppLogs_Feature_Installer/startup_864.log (https://qahrshellbot.scm.azurewebsites.net/api/vfs/LogFiles/AppServiceAppLogs_Feature_Installer/startup_864.log) 2024-04-17 06:41:35,903 [MainThread] [DEBUG] : Initializating AppServiceAppLogging

2024-04-17 06:41:35,909 [MainThread] [DEBUG] : Initialized AppServiceAppLogging

2024-04-17 06:41:35,921 [Thread-1 (] [DEBUG] : Did not find any previously bound socket 2024-04-17 06:41:36,299 [Thread-3 (] [DEBUG] : Waiting for the logs flag to be set 2024-04-17 06:43:53,775 [MainThread] [DEBUG] : Initializating AppServiceAppLogging 2024-04-17 06:43:53,777 [Thread-1 (] [DEBUG] : Did not find any previously bound socket 2024-04-17 06:43:53,778 [MainThread] [DEBUG] : Initialized AppServiceAppLogging 2024-04-17 06:43:55,451 [Thread-3 (] [DEBUG] : Waiting for the logs flag to be set /home/LogFiles/CodeProfiler/a822bc_debug.log (https://qahrshellbot.scm.azurewebsites.net/api/vfs/LogFiles/CodeProfiler/a822bc_debug.log) [2024_04_17_06_43_55] [appsvc_profiler.installer] [INFO] Code Profiler Installer is starting up [2024_04_17_06_43_55] [appsvc_profiler.installer] [INFO] Cleaning up any existing status file which indicated signal handlers initialized status [2024_04_17_06_43_55] [appsvc_profiler.installer] [INFO] Attempting to delete the signal_handler status file for instance id a822bcb6dd314caab4bd83084cc7a3991e4965ec4f97b7ce99c0ca46861dc419 [2024_04_17_06_43_55] [appsvc_profiler.installer] [INFO] successfully deleted the status file [2024_04_17_06_43_55] [appsvc_profiler.installer] [DEBUG] APPSETTING_WEBSITE_ENABLE_DEFAULT_CODE_PROFILER : None [2024_04_17_06_43_56] [appsvc_profiler.installer] [INFO] Attempting to install the default code profiler. [2024_04_17_06_43_56] [appsvc_profiler.installer] [DEBUG] viztracer would save traces to /tmp/a822bc_profiler_trace.json [2024_04_17_06_43_56] [appsvc_profiler.installer] [INFO] Successfully installed code profiler. [2024_04_17_06_43_56] [appsvc_profiler.installer] [INFO] Signal Handlers SIGUSR for needed code-profiler have been initialized for gunicorn process on instance a822bcb6dd314caab4bd83084cc7a3991e4965ec4f97b7ce99c0ca46861dc419 [2024_04_17_06_43_56] [appsvc_profiler.installer] [DEBUG] Code Profiler Installer is exiting as installation is completed Ending Log Tail of existing logs --- Starting Live Log Stream --- 2024-04-17T07:03:31.993Z INFO - 3.10_20240207.3.tuxprod Pulling from appsvc/python 2024-04-17T07:03:31.995Z INFO - Digest: sha256:304127d40f59f3fde1a079fe55610abb72964a9c7769e18cbcea4c9482bf929c 2024-04-17T07:03:32.006Z INFO - Status: Downloaded newer image for 10.1.0.4:13209/appsvc/python:3.10_20240207.3.tuxprod 2024-04-17T07:03:32.026Z INFO - Pull Image successful, Time taken: 0 Seconds 2024-04-17T07:03:32.739Z INFO - Starting container for site 2024-04-17T07:03:32.742Z INFO - docker run -d --expose=8000 --name qahrshellbot_0_efe31bb7 -e WEBSITE_USE_DIAGNOSTIC_SERVER=false -e WEBSITE_SITE_NAME=qahrshellbot -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=qahrshellbot.azurewebsites.net -e WEBSITE_INSTANCE_ID=a822bcb6dd314caab4bd83084cc7a3991e4965ec4f97b7ce99c0ca46861dc419 appsvc/python:3.10_20240207.3.tuxprod python3 -m gunicorn app:app 2024-04-17T07:03:32.743Z INFO - Logging is not enabled for this container. Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here. 2024-04-17T07:03:35.978Z INFO - Initiating warmup request to container qahrshellbot_0_efe31bb7 for site qahrshellbot 2024-04-17T07:04:08.931Z INFO - Waiting for response to warmup request for container qahrshellbot_0_efe31bb7. Elapsed time = 32.9525835 sec 2024-04-17T07:04:35.219Z INFO - Container qahrshellbot_0_efe31bb7 for site qahrshellbot initialized successfully and is ready to serve requests.

When I visited the URL, it gave me Internal Server Error

sampleissue1
kagoolastha23 commented 2 months ago
image

Please look at the screenshot of error

kagoolastha23 commented 2 months ago
image

This is in Application logs

kagoolastha23 commented 2 months ago
image

This is the exception error which is coming.

github-actions[bot] commented 1 week ago

This issue is stale because it has been open for 30 days with no activity.