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.04k stars 4.13k forks source link

Error: The app encountered an error processing your request. If you are an administrator of the app, view the full error in the logs. See aka.ms/appservice-logs for more information. Error type: <class 'openai.error.InvalidRequestError'> #957

Open namratam30 opened 11 months ago

namratam30 commented 11 months ago

Please provide us with the following information:

Getting this error- The app encountered an error processing your request. If you are an administrator of the app, view the full error in the logs. See aka.ms/appservice-logs for more information. Error type: <class 'openai.error.InvalidRequestError'>

I am using existing resources and open ai with below details- OPENAI_API_TYPE = "azure" OPENAI_API_VERSION = "2023-07-01-preview" OPENAI_API_KEY = "xxxxxx" OPENAI_API_BASE = " https://openaxxxx.openai.azure.com/" DEPLOYMENT_NAME = "gpt-4-32k" # 60K TPM

Please tell me how to configure the existing resources correctly.

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

azd version?

run azd version and copy paste here.

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

AdainRos commented 11 months ago

This also happens with a fresh deployment without existing Azure services. Issue #940 supposedly resolved this error. It seems to be intermittent. I ran a fresh install without the suggested front end customization and it worked for me a few days ago. I did verbiage only customization to the front end and ran a fresh deployment with the mentioned error above:

:( Application Error If you are the application administrator, you can access the [diagnostic resources]

hichamhammouchi commented 11 months ago

This happens with fresh deployments, just restart the app service and wait until it's up then refresh the page

kcordoc commented 11 months ago

2023-11-16T07:57:15 Welcome, you are now connected to log-streaming service. Starting Log Tail -n 10 of existing logs ---- /home/LogFiles/lastCheckTime.txt (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/lastCheckTime.txt)11/16/2023 07:54:48/home/LogFiles/Application/diagnostics-20231115.txt (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/Application/diagnostics-20231115.txt) 2023-11-15 23:58:19.178 +00:00 [Information] Middleware: Destination base URL is http://169.254.130.40:8000 2023-11-15 23:58:21.643 +00:00 [Information] Microsoft.Hosting.Lifetime: Now listening on: http://0.0.0.0:8181 2023-11-15 23:58:21.644 +00:00 [Debug] Microsoft.AspNetCore.Hosting.Diagnostics: Loaded hosting startup assembly Middleware.Host 2023-11-15 23:58:21.664 +00:00 [Information] Microsoft.Hosting.Lifetime: Application started. Press Ctrl+C to shut down. 2023-11-15 23:58:21.664 +00:00 [Information] Microsoft.Hosting.Lifetime: Hosting environment: Production 2023-11-15 23:58:21.664 +00:00 [Information] Microsoft.Hosting.Lifetime: Content root path: /app 2023-11-15 23:58:21.664 +00:00 [Debug] Microsoft.Extensions.Hosting.Internal.Host: Hosting started 2023-11-15 23:59:09.417 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMV66RDTHHRN" accepted. 2023-11-15 23:59:09.422 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMV66RDTHHRN" started. 2023-11-15 23:59:09.541 +00:00 [Information] Microsoft.AspNetCore.Hosting.Diagnostics: Request starting HTTP/1.1 GET http://169.254.130.41:8181/robots933456.txt - -/home/LogFiles/Application/diagnostics-20231116.txt (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/Application/diagnostics-20231116.txt) 2023-11-16 07:55:20.109 +00:00 [Information] Microsoft.Hosting.Lifetime: Content root path: /app 2023-11-16 07:55:20.109 +00:00 [Debug] Microsoft.Extensions.Hosting.Internal.Host: Hosting started 2023-11-16 07:56:09.742 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMV6F5VE7IUI" accepted. 2023-11-16 07:56:09.743 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMV6F5VE7IUI" started. 2023-11-16 07:56:09.895 +00:00 [Information] Microsoft.AspNetCore.Hosting.Diagnostics: Request starting HTTP/1.1 GET http://169.254.130.62:8181/robots933456.txt - - 2023-11-16 07:56:10.025 +00:00 [Trace] Middleware: Request came in on normal port, sending to normal target http://169.254.130.61:8000/robots933456.txt 2023-11-16 07:56:10.026 +00:00 [Trace] Middleware: Forwarding request to http://169.254.130.61:8000/robots933456.txt 2023-11-16 07:56:10.284 +00:00 [Error] Middleware: Failed to forward request to http://169.254.130.61:8000. Encountered a System.Net.Http.HttpRequestException exception after 290.796ms with message: Connection refused (169.254.130.61:8000). Check application logs to verify the application is properly handling HTTP traffic. 2023-11-16 07:56:10.441 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMV6F5VE7IUI" completed keep alive response. 2023-11-16 07:56:10.441 +00:00 [Information] Microsoft.AspNetCore.Hosting.Diagnostics: Request finished HTTP/1.1 GET http://169.254.130.62:8181/robots933456.txt - - - 500 0 - 546.8395ms/home/LogFiles/kudu/trace/12f92332b624-c29e95cf-065f-40ad-9df3-5e4a1cbb94f0.txt (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/12f92332b624-c29e95cf-065f-40ad-9df3-5e4a1cbb94f0.txt) 2023-11-16T04:29:31 Startup Request, url: /api/deployments/?$orderby=ReceivedTime%20desc&$top=20&api-version=2022-03-01, method: GET, type: request, pid: 92,1,19, SCM_DO_BUILD_DURING_DEPLOYMENT: True, ScmType: None/home/LogFiles/kudu/trace/23b2b4fff913-6d308b12-2e12-49f3-ab1a-ca345ebed502.txt (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/23b2b4fff913-6d308b12-2e12-49f3-ab1a-ca345ebed502.txt) 2023-11-15T10:53:46 Startup Request, url: /api/zipdeploy?isAsync=true, method: POST, type: request, pid: 87,1,5, SCM_DO_BUILD_DURING_DEPLOYMENT: True, ScmType: None/home/LogFiles/kudu/trace/36768ad996ff-78b42970-e3ff-4486-891c-53cf694818ea.txt (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/36768ad996ff-78b42970-e3ff-4486-891c-53cf694818ea.txt) 2023-11-16T04:35:39 Startup Request, url: /api/deployments/?$orderby=ReceivedTime%20desc&$top=20&api-version=2022-03-01, method: GET, type: request, pid: 87,1,19, SCM_DO_BUILD_DURING_DEPLOYMENT: True, ScmType: None /home/LogFiles/kudu/trace/58432d58cbbe-bf572250-1cb3-4f6f-a122-65ea4f8d80ac.txt (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/58432d58cbbe-bf572250-1cb3-4f6f-a122-65ea4f8d80ac.txt) 2023-11-16T04:23:07 Startup Request, url: /api/deployments/?$orderby=ReceivedTime%20desc&$top=20&api-version=2022-03-01, method: GET, type: request, pid: 87,1,7, SCM_DO_BUILD_DURING_DEPLOYMENT: True, ScmType: None/home/LogFiles/kudu/trace/add2e8b87f26-a5080c25-5cd8-45ae-a82b-9f252c148e0e.txt (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/add2e8b87f26-a5080c25-5cd8-45ae-a82b-9f252c148e0e.txt) 2023-11-16T04:44:39 Startup Request, url: /api/deployments/?$orderby=ReceivedTime%20desc&$top=20&api-version=2022-03-01, method: GET, type: request, pid: 86,1,7, SCM_DO_BUILD_DURING_DEPLOYMENT: True, ScmType: None/home/LogFiles/2023_11_15_lw1sdlwk000205_default_docker.log (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/2023_11_15_lw1sdlwk000205_default_docker.log) 2023-11-15T23:59:08.167603139Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/arbiter.py", line 342, in halt 2023-11-15T23:59:08.167607939Z self.stop() 2023-11-15T23:59:08.167612540Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/arbiter.py", line 393, in stop 2023-11-15T23:59:08.167628141Z time.sleep(0.1) 2023-11-15T23:59:08.231979293Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/arbiter.py", line 242, in handle_chld 2023-11-15T23:59:08.232024096Z self.reap_workers() 2023-11-15T23:59:08.232030896Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/arbiter.py", line 525, in reap_workers 2023-11-15T23:59:08.232036196Z raise HaltServer(reason, self.WORKER_BOOT_ERROR) 2023-11-15T23:59:08.232041197Z gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3> /home/LogFiles/2023_11_15_lw1sdlwk000205_docker.log (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/2023_11_15_lw1sdlwk000205_docker.log) 2023-11-15T23:58:07.227Z INFO - Pull Image successful, Time taken: 0 Seconds 2023-11-15T23:58:07.471Z INFO - Starting container for site 2023-11-15T23:58:07.472Z INFO - docker run -d --expose=8181 --name app-backend-iaoueykgwg6t4_0_52eaa323_middleware -e WEBSITE_CORS_ALLOWED_ORIGINS=https://portal.azure.com,https://ms.portal.azure.com, -e WEBSITE_CORS_SUPPORT_CREDENTIALS=False -e WEBSITE_SITE_NAME=app-backend-iaoueykgwg6t4 -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=app-backend-iaoueykgwg6t4.azurewebsites.net -e WEBSITE_INSTANCE_ID=d8ce030d10a8488f5af05adb44862a92568cc382a56095090ac9f1a788fb1dff -e HTTP_LOGGING_ENABLED=1 mcr.microsoft.com/appsvc/mi2023-11-15T23:58:10.484Z INFO - Initiating warmup request to container app-backend-iaoueykgwg6t4_0_52eaa323_msiProxy for site app-backend-iaoueykgwg6t4 2023-11-15T23:58:10.599Z INFO - Container app-backend-iaoueykgwg6t4_0_52eaa323_msiProxy for site app-backend-iaoueykgwg6t4 initialized successfully and is ready to serve requests. 2023-11-15T23:58:10.606Z INFO - Initiating warmup request to container app-backend-iaoueykgwg6t4_0_52eaa323 for site app-backend-iaoueykgwg6t4 2023-11-15T23:59:09.273Z ERROR - Container app-backend-iaoueykgwg6t4_0_52eaa323 for site app-backend-iaoueykgwg6t4 has exited, failing site start 2023-11-15T23:59:09.275Z INFO - Initiating warmup request to container app-backend-iaoueykgwg6t4_0_52eaa323_middleware for site app-backend-iaoueykgwg6t4 2023-11-15T23:59:10.117Z INFO - Container app-backend-iaoueykgwg6t4_0_52eaa323_middleware for site app-backend-iaoueykgwg6t4 initialized successfully and is ready to serve requests. 2023-11-15T23:59:10.144Z ERROR - Container app-backend-iaoueykgwg6t4_0_52eaa323 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging. 2023-11-15T23:59:10.204Z INFO - Stopping site app-backend-iaoueykgwg6t4 because it failed during startup./home/LogFiles/2023_11_15_lw1sdlwk000205_easyauth_docker.log (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/2023_11_15_lw1sdlwk000205_easyauth_docker.log)/home/LogFiles/2023_11_15_lw1sdlwk000205_msi_docker.log (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/2023_11_15_lw1sdlwk000205_msi_docker.log)/home/LogFiles/2023_11_16_lw1sdlwk000205_default_docker.log (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/2023_11_16_lw1sdlwk000205_default_docker.log) 2023-11-16T07:56:08.500581090Z During handling of the above exception, another exception occurred: 2023-11-16T07:56:08.500586191Z 2023-11-16T07:56:08.500591191Z Traceback (most recent call last): 2023-11-16T07:56:08.500596291Z object address : 0x7913f8c28820 2023-11-16T07:56:08.522389099Z object refcount : 2 2023-11-16T07:56:08.522413701Z object type : 0x5c3a7b6d2650 2023-11-16T07:56:08.522419901Z object type name: HaltServer 2023-11-16T07:56:08.522424902Z object repr : HaltServer('Worker failed to boot.', 3) 2023-11-16T07:56:08.522429702Z lost sys.stderr /home/LogFiles/2023_11_16_lw1sdlwk000205_docker.log (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/2023_11_16_lw1sdlwk000205_docker.log) 2023-11-16T07:55:00.679Z INFO - Starting container for site 2023-11-16T07:55:00.687Z INFO - docker run -d --expose=8181 --name app-backend-iaoueykgwg6t4_0_c411d2e7_middleware -e WEBSITE_CORS_ALLOWED_ORIGINS=https://portal.azure.com,https://ms.portal.azure.com, -e WEBSITE_CORS_SUPPORT_CREDENTIALS=False -e WEBSITE_SITE_NAME=app-backend-iaoueykgwg6t4 -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=app-backend-iaoueykgwg6t4.azurewebsites.net -e WEBSITE_INSTANCE_ID=d8ce030d10a8488f5af05adb44862a92568cc382a56095090ac9f1a788fb1dff -e HTTP_LOGGING_ENABLED=1 mcr.microsoft.com/appsvc/mi2023-11-16T07:55:04.532Z INFO - Initiating warmup request to container app-backend-iaoueykgwg6t4_0_c411d2e7_msiProxy for site app-backend-iaoueykgwg6t4 2023-11-16T07:55:04.602Z INFO - Container app-backend-iaoueykgwg6t4_0_c411d2e7_msiProxy for site app-backend-iaoueykgwg6t4 initialized successfully and is ready to serve requests. 2023-11-16T07:55:04.603Z INFO - Initiating warmup request to container app-backend-iaoueykgwg6t4_0_c411d2e7 for site app-backend-iaoueykgwg6t4 2023-11-16T07:55:25.582Z INFO - Waiting for response to warmup request for container app-backend-iaoueykgwg6t4_0_c411d2e7. Elapsed time = 21.0498817 sec 2023-11-16T07:56:09.671Z ERROR - Container app-backend-iaoueykgwg6t4_0_c411d2e7 for site app-backend-iaoueykgwg6t4 has exited, failing site start 2023-11-16T07:56:09.672Z INFO - Initiating warmup request to container app-backend-iaoueykgwg6t4_0_c411d2e7_middleware for site app-backend-iaoueykgwg6t4 2023-11-16T07:56:10.449Z INFO - Container app-backend-iaoueykgwg6t4_0_c411d2e7_middleware for site app-backend-iaoueykgwg6t4 initialized successfully and is ready to serve requests. 2023-11-16T07:56:10.466Z ERROR - Container app-backend-iaoueykgwg6t4_0_c411d2e7 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging. 2023-11-16T07:56:12.967Z INFO - Stopping site app-backend-iaoueykgwg6t4 because it failed during startup./home/LogFiles/2023_11_16_lw1sdlwk000205_easyauth_docker.log (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/2023_11_16_lw1sdlwk000205_easyauth_docker.log)/home/LogFiles/2023_11_16_lw1sdlwk000205_msi_docker.log (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/2023_11_16_lw1sdlwk000205_msi_docker.log)Ending Log Tail of existing logs ---Starting Live Log Stream --- 2023-11-16T07:58:15 No new trace in the past 1 min(s). 2023-11-16T07:59:15 No new trace in the past 2 min(s). 2023-11-16T08:00:15 No new trace in the past 3 min(s).

Exactly the same issue.

The app was working fine until last week. I made some minor changes to the frontend and backend, followed by 'azd deploy'. The config is the same otherwise.

rebeccaleeasml commented 11 months ago

I received the same error, for some questions. The index search shows the answer is ranked top1.

pamelafox commented 11 months ago

openai.error.InvalidRequestError may correspond to multiple errors, so we'd need to see the full error to see what the problem is. Please see instructions here for downloading default_docker.txt: https://blog.pamelafox.org/2023/06/tips-for-debugging-flask-deployments-to.html#download-logs

You can share the logs here if you need help debugging them.

AdainRos commented 11 months ago

2023-11-20T06:01:22.811634800Z _| / __/ |_| \ > 2023-11-20T06:01:22.811639601Z \/ \/ \/ 2023-11-20T06:01:22.811644201Z A P P S E R V I C E O N L I N U X 2023-11-20T06:01:22.811649101Z 2023-11-20T06:01:22.811653301Z Documentation: http://aka.ms/webapp-linux 2023-11-20T06:01:22.811657601Z Python 3.11.4 2023-11-20T06:01:22.811661901Z Note: Any data outside '/home' is not persisted 2023-11-20T06:01:24.510745055Z Starting OpenBSD Secure Shell server: sshd. 2023-11-20T06:01:24.871089326Z Site's appCommandLine: python3 -m gunicorn main:app 2023-11-20T06:01:24.872309251Z Launching oryx with: create-script -appPath /home/site/wwwroot -output /opt/startup/startup.sh -virtualEnvName antenv -defaultApp /opt/defaultsite -userStartupCommand 'python3 -m gunicorn main:app' 2023-11-20T06:01:25.120269423Z Found build manifest file at '/home/site/wwwroot/oryx-manifest.toml'. Deserializing it... 2023-11-20T06:01:25.132533274Z Build Operation ID: f6a432d8abcf4bd1 2023-11-20T06:01:25.150091333Z Oryx Version: 0.2.20230707.1, Commit: 0bd28e69919b5e8beba451e8677e3345f0be8361, ReleaseTagName: 20230707.1 2023-11-20T06:01:25.151194856Z Output is compressed. Extracting it... 2023-11-20T06:01:25.153728908Z Extracting '/home/site/wwwroot/output.tar.gz' to directory '/tmp/8dbe815157a43fd'... 2023-11-20T06:01:48.016367992Z App path is set to '/tmp/8dbe815157a43fd' 2023-11-20T06:01:48.057929542Z Writing output script to '/opt/startup/startup.sh' 2023-11-20T06:01:48.229357848Z Using packages from virtual environment antenv located at /tmp/8dbe815157a43fd/antenv. 2023-11-20T06:01:48.229394549Z Updated PYTHONPATH to '/opt/startup/app_logs:/tmp/8dbe815157a43fd/antenv/lib/python3.11/site-packages' 2023-11-20T06:01:50.317220351Z [2023-11-20 06:01:50 +0000] [70] [INFO] Starting gunicorn 20.1.0 2023-11-20T06:01:50.335360422Z [2023-11-20 06:01:50 +0000] [70] [INFO] Listening at: http://0.0.0.0:8000 (70) 2023-11-20T06:01:50.335806431Z [2023-11-20 06:01:50 +0000] [70] [INFO] Using worker: uvicorn.workers.UvicornWorker 2023-11-20T06:01:50.374869430Z [2023-11-20 06:01:50 +0000] [72] [INFO] Booting worker with pid: 72 2023-11-20T06:01:50.418309419Z [2023-11-20 06:01:50 +0000] [73] [INFO] Booting worker with pid: 73 2023-11-20T06:01:50.457868328Z [2023-11-20 06:01:50 +0000] [74] [INFO] Booting worker with pid: 74 2023-11-20T06:02:44.688536609Z [2023-11-20 06:02:44 +0000] [72] [ERROR] Exception in worker process 2023-11-20T06:02:44.787100762Z Traceback (most recent call last): 2023-11-20T06:02:44.787124563Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker 2023-11-20T06:02:44.787145464Z worker.init_process() 2023-11-20T06:02:44.787151064Z File "/tmp/8dbe815157a43fd/antenv/lib/python3.11/site-packages/uvicorn/workers.py", line 66, in init_process 2023-11-20T06:02:44.787156164Z super(UvicornWorker, self).init_process() 2023-11-20T06:02:44.787160864Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/workers/base.py", line 134, in init_process 2023-11-20T06:02:44.787165764Z self.load_wsgi() 2023-11-20T06:02:44.787170964Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi 2023-11-20T06:02:44.787176164Z self.wsgi = self.app.wsgi() 2023-11-20T06:02:44.787180764Z ^^^^^^^^^^^^^^^ 2023-11-20T06:02:44.787185665Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/app/base.py", line 67, in wsgi 2023-11-20T06:02:44.787190765Z self.callable = self.load() 2023-11-20T06:02:44.787195365Z ^^^^^^^^^^^ 2023-11-20T06:02:44.787200065Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 58, in load 2023-11-20T06:02:44.787204965Z return self.load_wsgiapp() 2023-11-20T06:02:44.787209665Z ^^^^^^^^^^^^^^^^^^^ 2023-11-20T06:02:44.787214365Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp 2023-11-20T06:02:44.787219165Z return util.import_app(self.app_uri) 2023-11-20T06:02:44.787223866Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-11-20T06:02:44.787228566Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/util.py", line 359, in import_app 2023-11-20T06:02:44.787233366Z mod = importlib.import_module(module) 2023-11-20T06:02:44.787237966Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-11-20T06:02:44.787255666Z File "/opt/python/3.11.4/lib/python3.11/importlib/init.py", line 126, in import_module 2023-11-20T06:02:44.787260767Z return _bootstrap._gcd_import(name[level:], package, level) 2023-11-20T06:02:44.787265467Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-11-20T06:02:44.787270067Z File "", line 1204, in _gcd_import 2023-11-20T06:02:44.787275467Z File "", line 1176, in _find_and_load 2023-11-20T06:02:44.787280167Z File "", line 1147, in _find_and_load_unlocked 2023-11-20T06:02:44.787284867Z File "", line 690, in _load_unlocked 2023-11-20T06:02:44.787289567Z File "", line 940, in exec_module 2023-11-20T06:02:44.787294468Z File "", line 241, in _call_with_frames_removed 2023-11-20T06:02:44.787303568Z File "/tmp/8dbe815157a43fd/main.py", line 1, in 2023-11-20T06:02:44.787313368Z from app import create_app 2023-11-20T06:02:44.787317968Z File "/tmp/8dbe815157a43fd/app.py", line 33, in 2023-11-20T06:02:44.787322768Z from approaches.retrievethenread import RetrieveThenReadApproach 2023-11-20T06:02:44.787327568Z File "/tmp/8dbe815157a43fd/approaches/retrievethenread.py", line 40 2023-11-20T06:02:44.787332369Z answer = "My contributions to security products and projects have spanned client onboarding, automation, 2023-11-20T06:02:44.787337269Z ^ 2023-11-20T06:02:44.787341769Z SyntaxError: unterminated string literal (detected at line 40) 2023-11-20T06:02:44.787346469Z [2023-11-20 06:02:44 +0000] [73] [ERROR] Exception in worker process 2023-11-20T06:02:44.787351069Z Traceback (most recent call last): 2023-11-20T06:02:44.787356069Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker 2023-11-20T06:02:44.787361169Z worker.init_process() 2023-11-20T06:02:44.787374370Z File "/tmp/8dbe815157a43fd/antenv/lib/python3.11/site-packages/uvicorn/workers.py", line 66, in init_process 2023-11-20T06:02:44.787379570Z super(UvicornWorker, self).init_process() 2023-11-20T06:02:44.787384170Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/workers/base.py", line 134, in init_process 2023-11-20T06:02:44.787388970Z self.load_wsgi() 2023-11-20T06:02:44.787393570Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi 2023-11-20T06:02:44.787398370Z self.wsgi = self.app.wsgi() 2023-11-20T06:02:44.787402870Z ^^^^^^^^^^^^^^^ 2023-11-20T06:02:44.787407471Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/app/base.py", line 67, in wsgi 2023-11-20T06:02:44.787412171Z self.callable = self.load() 2023-11-20T06:02:44.787416671Z ^^^^^^^^^^^ 2023-11-20T06:02:44.787421171Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 58, in load 2023-11-20T06:02:44.787426171Z return self.load_wsgiapp() 2023-11-20T06:02:44.787430671Z ^^^^^^^^^^^^^^^^^^^ 2023-11-20T06:02:44.787435271Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp 2023-11-20T06:02:44.787439971Z return util.import_app(self.app_uri) 2023-11-20T06:02:44.787444572Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-11-20T06:02:44.787449172Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/util.py", line 359, in import_app 2023-11-20T06:02:44.787453872Z mod = importlib.import_module(module) 2023-11-20T06:02:44.787458472Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-11-20T06:02:44.787463072Z File "/opt/python/3.11.4/lib/python3.11/importlib/init.py", line 126, in import_module

namratam30 commented 11 months ago

Here is the error i am getting- 2023-11-20T05:01:44.136396666Z ERROR:root:Exception while generating response stream: Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.chat_completion.ChatCompletion'> 2023-11-20T05:01:44.136458966Z Traceback (most recent call last): 2023-11-20T05:01:44.136467066Z File "/tmp/8dbe97ce2e23f7d/app.py", line 131, in format_as_ndjson 2023-11-20T05:01:44.136471966Z async for event in r: 2023-11-20T05:01:44.136476466Z File "/tmp/8dbe97ce2e23f7d/approaches/chatreadretrieveread.py", line 264, in run_with_streaming 2023-11-20T05:01:44.136481066Z extra_info, chat_coroutine = await self.run_until_final_call( 2023-11-20T05:01:44.136485566Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-11-20T05:01:44.136489966Z File "/tmp/8dbe97ce2e23f7d/approaches/chatreadretrieveread.py", line 130, in run_until_final_call 2023-11-20T05:01:44.136494466Z chat_completion = await openai.ChatCompletion.acreate( 2023-11-20T05:01:44.136498866Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-11-20T05:01:44.136503266Z File "/tmp/8dbe97ce2e23f7d/antenv/lib/python3.11/site-packages/openai/api_resources/chat_completion.py", line 45, in acreate 2023-11-20T05:01:44.136507866Z return await super().acreate(*args, **kwargs) 2023-11-20T05:01:44.136512266Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-11-20T05:01:44.136516766Z File "/tmp/8dbe97ce2e23f7d/antenv/lib/python3.11/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 216, in acreate 2023-11-20T05:01:44.136521366Z ) = cls.__prepare_create_request( 2023-11-20T05:01:44.136525666Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-11-20T05:01:44.136530066Z File "/tmp/8dbe97ce2e23f7d/antenv/lib/python3.11/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 85, in __prepare_create_request 2023-11-20T05:01:44.136534666Z raise error.InvalidRequestError( 2023-11-20T05:01:44.136539466Z openai.error.InvalidRequestError: Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.chat_completion.ChatCompletion'> 2023-11-20 05:01:43.939 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMV9FMT0CI4G" accepted. 2023-11-20 05:01:43.939 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMV9FMT0CI4G" started. 2023-11-20 05:01:43.948 +00:00 [Information] Microsoft.AspNetCore.Hosting.Diagnostics: Request starting HTTP/1.1 POST http://genai-backend-xxxoai-dev.azurewebsites.net/chat application/json 326 2023-11-20 05:01:43.949 +00:00 [Trace] Middleware: Request came in on normal port, sending to normal target http://169.254.129.88:8000/chat 2023-11-20 05:01:43.949 +00:00 [Trace] Middleware: Forwarding request to http://169.254.129.88:8000/chat 2023-11-20 05:01:43.978 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel: Connection id "0HMV9FMT0CI4G", Request id "0HMV9FMT0CI4G:00000002": started reading request body. 2023-11-20 05:01:44.035 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel: Connection id "0HMV9FMT0CI4G", Request id "0HMV9FMT0CI4G:00000002": done reading request body. 2023-11-20 05:01:44.397 +00:00 [Trace] Middleware: Forwarded request finished in 448.189ms 200 OK 2023-11-20 05:01:44.398 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMV9FMT0CI4G" completed keep alive response. 2023-11-20 05:01:44.398 +00:00 [Information] Microsoft.AspNetCore.Hosting.Diagnostics: Request finished HTTP/1.1 POST http://genai-backend-xxxoai-dev.azurewebsites.net/chat application/json 326 - 200 - text/html;+charset=utf-8 449.4488ms 2023-11-20 05:02:22.864 +00:00 [Information] Microsoft.AspNetCore.Hosting.Diagnostics: Request starting HTTP/1.1 GET http://genai-backend-xxxoai-dev.azurewebsites.net/ - - 2023-11-20 05:02:22.950 +00:00 [Trace] Middleware: Request came in on normal port, sending to normal target http://169.254.129.88:8000/ 2023-11-20 05:02:22.950 +00:00 [Trace] Middleware: Forwarding request to http://169.254.129.88:8000/ 2023-11-20 05:02:23.063 +00:00 [Trace] Middleware: Forwarded request finished in 112.486ms 200 OK 2023-11-20 05:02:23.130 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMV9FMT0CI4G" completed keep alive response. 2023-11-20 05:02:23.130 +00:00 [Information] Microsoft.AspNetCore.Hosting.Diagnostics: Request finished HTTP/1.1 GET http://genai-backend-xxxoai-dev.azurewebsites.net/ - - - 200 761 text/html;+charset=utf-8 265.7262ms 2023-11-20 05:03:36.847 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets: Connection id "0HMV9FMT0CI4G" received FIN. 2023-11-20 05:03:36.852 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMV9FMT0CI4G" disconnecting. 2023-11-20 05:03:36.852 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMV9FMT0CI4G" stopped. 2023-11-20 05:03:36.853 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets: Connection id "0HMV9FMT0CI4G" sending FIN because: "The Socket transport's send loop completed gracefully." 2023-11-20T05:04:56 No new trace in the past 1 min(s). 2023-11-20T05:05:56 No new trace in the past 2 min(s).

kcordoc commented 11 months ago

2023-11-16T07:57:15 Welcome, you are now connected to log-streaming service. Starting Log Tail -n 10 of existing logs ---- /home/LogFiles/lastCheckTime.txt (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/lastCheckTime.txt)11/16/2023 07:54:48/home/LogFiles/Application/diagnostics-20231115.txt (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/Application/diagnostics-20231115.txt) 2023-11-15 23:58:19.178 +00:00 [Information] Middleware: Destination base URL is http://169.254.130.40:8000 2023-11-15 23:58:21.643 +00:00 [Information] Microsoft.Hosting.Lifetime: Now listening on: http://0.0.0.0:8181 2023-11-15 23:58:21.644 +00:00 [Debug] Microsoft.AspNetCore.Hosting.Diagnostics: Loaded hosting startup assembly Middleware.Host 2023-11-15 23:58:21.664 +00:00 [Information] Microsoft.Hosting.Lifetime: Application started. Press Ctrl+C to shut down. 2023-11-15 23:58:21.664 +00:00 [Information] Microsoft.Hosting.Lifetime: Hosting environment: Production 2023-11-15 23:58:21.664 +00:00 [Information] Microsoft.Hosting.Lifetime: Content root path: /app 2023-11-15 23:58:21.664 +00:00 [Debug] Microsoft.Extensions.Hosting.Internal.Host: Hosting started 2023-11-15 23:59:09.417 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMV66RDTHHRN" accepted. 2023-11-15 23:59:09.422 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMV66RDTHHRN" started. 2023-11-15 23:59:09.541 +00:00 [Information] Microsoft.AspNetCore.Hosting.Diagnostics: Request starting HTTP/1.1 GET http://169.254.130.41:8181/robots933456.txt - -/home/LogFiles/Application/diagnostics-20231116.txt (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/Application/diagnostics-20231116.txt) 2023-11-16 07:55:20.109 +00:00 [Information] Microsoft.Hosting.Lifetime: Content root path: /app 2023-11-16 07:55:20.109 +00:00 [Debug] Microsoft.Extensions.Hosting.Internal.Host: Hosting started 2023-11-16 07:56:09.742 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMV6F5VE7IUI" accepted. 2023-11-16 07:56:09.743 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMV6F5VE7IUI" started. 2023-11-16 07:56:09.895 +00:00 [Information] Microsoft.AspNetCore.Hosting.Diagnostics: Request starting HTTP/1.1 GET http://169.254.130.62:8181/robots933456.txt - - 2023-11-16 07:56:10.025 +00:00 [Trace] Middleware: Request came in on normal port, sending to normal target http://169.254.130.61:8000/robots933456.txt 2023-11-16 07:56:10.026 +00:00 [Trace] Middleware: Forwarding request to http://169.254.130.61:8000/robots933456.txt 2023-11-16 07:56:10.284 +00:00 [Error] Middleware: Failed to forward request to http://169.254.130.61:8000. Encountered a System.Net.Http.HttpRequestException exception after 290.796ms with message: Connection refused (169.254.130.61:8000). Check application logs to verify the application is properly handling HTTP traffic. 2023-11-16 07:56:10.441 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMV6F5VE7IUI" completed keep alive response. 2023-11-16 07:56:10.441 +00:00 [Information] Microsoft.AspNetCore.Hosting.Diagnostics: Request finished HTTP/1.1 GET http://169.254.130.62:8181/robots933456.txt - - - 500 0 - 546.8395ms/home/LogFiles/kudu/trace/12f92332b624-c29e95cf-065f-40ad-9df3-5e4a1cbb94f0.txt (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/12f92332b624-c29e95cf-065f-40ad-9df3-5e4a1cbb94f0.txt) 2023-11-16T04:29:31 Startup Request, url: /api/deployments/?$orderby=ReceivedTime%20desc&$top=20&api-version=2022-03-01, method: GET, type: request, pid: 92,1,19, SCM_DO_BUILD_DURING_DEPLOYMENT: True, ScmType: None/home/LogFiles/kudu/trace/23b2b4fff913-6d308b12-2e12-49f3-ab1a-ca345ebed502.txt (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/23b2b4fff913-6d308b12-2e12-49f3-ab1a-ca345ebed502.txt) 2023-11-15T10:53:46 Startup Request, url: /api/zipdeploy?isAsync=true, method: POST, type: request, pid: 87,1,5, SCM_DO_BUILD_DURING_DEPLOYMENT: True, ScmType: None/home/LogFiles/kudu/trace/36768ad996ff-78b42970-e3ff-4486-891c-53cf694818ea.txt (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/36768ad996ff-78b42970-e3ff-4486-891c-53cf694818ea.txt) 2023-11-16T04:35:39 Startup Request, url: /api/deployments/?$orderby=ReceivedTime%20desc&$top=20&api-version=2022-03-01, method: GET, type: request, pid: 87,1,19, SCM_DO_BUILD_DURING_DEPLOYMENT: True, ScmType: None /home/LogFiles/kudu/trace/58432d58cbbe-bf572250-1cb3-4f6f-a122-65ea4f8d80ac.txt (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/58432d58cbbe-bf572250-1cb3-4f6f-a122-65ea4f8d80ac.txt) 2023-11-16T04:23:07 Startup Request, url: /api/deployments/?$orderby=ReceivedTime%20desc&$top=20&api-version=2022-03-01, method: GET, type: request, pid: 87,1,7, SCM_DO_BUILD_DURING_DEPLOYMENT: True, ScmType: None/home/LogFiles/kudu/trace/add2e8b87f26-a5080c25-5cd8-45ae-a82b-9f252c148e0e.txt (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/add2e8b87f26-a5080c25-5cd8-45ae-a82b-9f252c148e0e.txt) 2023-11-16T04:44:39 Startup Request, url: /api/deployments/?$orderby=ReceivedTime%20desc&$top=20&api-version=2022-03-01, method: GET, type: request, pid: 86,1,7, SCM_DO_BUILD_DURING_DEPLOYMENT: True, ScmType: None/home/LogFiles/2023_11_15_lw1sdlwk000205_default_docker.log (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/2023_11_15_lw1sdlwk000205_default_docker.log) 2023-11-15T23:59:08.167603139Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/arbiter.py", line 342, in halt 2023-11-15T23:59:08.167607939Z self.stop() 2023-11-15T23:59:08.167612540Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/arbiter.py", line 393, in stop 2023-11-15T23:59:08.167628141Z time.sleep(0.1) 2023-11-15T23:59:08.231979293Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/arbiter.py", line 242, in handle_chld 2023-11-15T23:59:08.232024096Z self.reap_workers() 2023-11-15T23:59:08.232030896Z File "/opt/python/3.11.4/lib/python3.11/site-packages/gunicorn/arbiter.py", line 525, in reap_workers 2023-11-15T23:59:08.232036196Z raise HaltServer(reason, self.WORKER_BOOT_ERROR) 2023-11-15T23:59:08.232041197Z gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3> /home/LogFiles/2023_11_15_lw1sdlwk000205_docker.log (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/2023_11_15_lw1sdlwk000205_docker.log) 2023-11-15T23:58:07.227Z INFO - Pull Image successful, Time taken: 0 Seconds 2023-11-15T23:58:07.471Z INFO - Starting container for site 2023-11-15T23:58:07.472Z INFO - docker run -d --expose=8181 --name app-backend-iaoueykgwg6t4_0_52eaa323_middleware -e WEBSITE_CORS_ALLOWED_ORIGINS=https://portal.azure.com,https://ms.portal.azure.com, -e WEBSITE_CORS_SUPPORT_CREDENTIALS=False -e WEBSITE_SITE_NAME=app-backend-iaoueykgwg6t4 -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=app-backend-iaoueykgwg6t4.azurewebsites.net -e WEBSITE_INSTANCE_ID=d8ce030d10a8488f5af05adb44862a92568cc382a56095090ac9f1a788fb1dff -e HTTP_LOGGING_ENABLED=1 mcr.microsoft.com/appsvc/mi2023-11-15T23:58:10.484Z INFO - Initiating warmup request to container app-backend-iaoueykgwg6t4_0_52eaa323_msiProxy for site app-backend-iaoueykgwg6t4 2023-11-15T23:58:10.599Z INFO - Container app-backend-iaoueykgwg6t4_0_52eaa323_msiProxy for site app-backend-iaoueykgwg6t4 initialized successfully and is ready to serve requests. 2023-11-15T23:58:10.606Z INFO - Initiating warmup request to container app-backend-iaoueykgwg6t4_0_52eaa323 for site app-backend-iaoueykgwg6t4 2023-11-15T23:59:09.273Z ERROR - Container app-backend-iaoueykgwg6t4_0_52eaa323 for site app-backend-iaoueykgwg6t4 has exited, failing site start 2023-11-15T23:59:09.275Z INFO - Initiating warmup request to container app-backend-iaoueykgwg6t4_0_52eaa323_middleware for site app-backend-iaoueykgwg6t4 2023-11-15T23:59:10.117Z INFO - Container app-backend-iaoueykgwg6t4_0_52eaa323_middleware for site app-backend-iaoueykgwg6t4 initialized successfully and is ready to serve requests. 2023-11-15T23:59:10.144Z ERROR - Container app-backend-iaoueykgwg6t4_0_52eaa323 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging. 2023-11-15T23:59:10.204Z INFO - Stopping site app-backend-iaoueykgwg6t4 because it failed during startup./home/LogFiles/2023_11_15_lw1sdlwk000205_easyauth_docker.log (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/2023_11_15_lw1sdlwk000205_easyauth_docker.log)/home/LogFiles/2023_11_15_lw1sdlwk000205_msi_docker.log (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/2023_11_15_lw1sdlwk000205_msi_docker.log)/home/LogFiles/2023_11_16_lw1sdlwk000205_default_docker.log (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/2023_11_16_lw1sdlwk000205_default_docker.log) 2023-11-16T07:56:08.500581090Z During handling of the above exception, another exception occurred: 2023-11-16T07:56:08.500586191Z 2023-11-16T07:56:08.500591191Z Traceback (most recent call last): 2023-11-16T07:56:08.500596291Z object address : 0x7913f8c28820 2023-11-16T07:56:08.522389099Z object refcount : 2 2023-11-16T07:56:08.522413701Z object type : 0x5c3a7b6d2650 2023-11-16T07:56:08.522419901Z object type name: HaltServer 2023-11-16T07:56:08.522424902Z object repr : HaltServer('Worker failed to boot.', 3) 2023-11-16T07:56:08.522429702Z lost sys.stderr /home/LogFiles/2023_11_16_lw1sdlwk000205_docker.log (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/2023_11_16_lw1sdlwk000205_docker.log) 2023-11-16T07:55:00.679Z INFO - Starting container for site 2023-11-16T07:55:00.687Z INFO - docker run -d --expose=8181 --name app-backend-iaoueykgwg6t4_0_c411d2e7_middleware -e WEBSITE_CORS_ALLOWED_ORIGINS=https://portal.azure.com,https://ms.portal.azure.com, -e WEBSITE_CORS_SUPPORT_CREDENTIALS=False -e WEBSITE_SITE_NAME=app-backend-iaoueykgwg6t4 -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=app-backend-iaoueykgwg6t4.azurewebsites.net -e WEBSITE_INSTANCE_ID=d8ce030d10a8488f5af05adb44862a92568cc382a56095090ac9f1a788fb1dff -e HTTP_LOGGING_ENABLED=1 mcr.microsoft.com/appsvc/mi2023-11-16T07:55:04.532Z INFO - Initiating warmup request to container app-backend-iaoueykgwg6t4_0_c411d2e7_msiProxy for site app-backend-iaoueykgwg6t4 2023-11-16T07:55:04.602Z INFO - Container app-backend-iaoueykgwg6t4_0_c411d2e7_msiProxy for site app-backend-iaoueykgwg6t4 initialized successfully and is ready to serve requests. 2023-11-16T07:55:04.603Z INFO - Initiating warmup request to container app-backend-iaoueykgwg6t4_0_c411d2e7 for site app-backend-iaoueykgwg6t4 2023-11-16T07:55:25.582Z INFO - Waiting for response to warmup request for container app-backend-iaoueykgwg6t4_0_c411d2e7. Elapsed time = 21.0498817 sec 2023-11-16T07:56:09.671Z ERROR - Container app-backend-iaoueykgwg6t4_0_c411d2e7 for site app-backend-iaoueykgwg6t4 has exited, failing site start 2023-11-16T07:56:09.672Z INFO - Initiating warmup request to container app-backend-iaoueykgwg6t4_0_c411d2e7_middleware for site app-backend-iaoueykgwg6t4 2023-11-16T07:56:10.449Z INFO - Container app-backend-iaoueykgwg6t4_0_c411d2e7_middleware for site app-backend-iaoueykgwg6t4 initialized successfully and is ready to serve requests. 2023-11-16T07:56:10.466Z ERROR - Container app-backend-iaoueykgwg6t4_0_c411d2e7 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging. 2023-11-16T07:56:12.967Z INFO - Stopping site app-backend-iaoueykgwg6t4 because it failed during startup./home/LogFiles/2023_11_16_lw1sdlwk000205_easyauth_docker.log (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/2023_11_16_lw1sdlwk000205_easyauth_docker.log)/home/LogFiles/2023_11_16_lw1sdlwk000205_msi_docker.log (https://app-backend-iaoueykgwg6t4.scm.azurewebsites.net/api/vfs/LogFiles/2023_11_16_lw1sdlwk000205_msi_docker.log)Ending Log Tail of existing logs ---Starting Live Log Stream --- 2023-11-16T07:58:15 No new trace in the past 1 min(s). 2023-11-16T07:59:15 No new trace in the past 2 min(s). 2023-11-16T08:00:15 No new trace in the past 3 min(s).

Exactly the same issue.

The app was working fine until last week. I made some minor changes to the frontend and backend, followed by 'azd deploy'. The config is the same otherwise.

My .env and config on the portal were slightly different. Issue resolved with updating the online configuration.

pamelafox commented 11 months ago

@namratam30 Are you still seeing this error?

openai.error.InvalidRequestError: Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.chat_completion.ChatCompletion'>

If so, it sounds like it thinks it's supposed to use Azure OpenAI, but you're trying to use non-Azure OpenAI instead (if I remember correctly from your other issues). Check your environment variables and make sure they're specified correctly. Specifically, for non-Azure OpenAI, OPENAI_HOST should be "openai".

lhojeda commented 11 months ago

Hi, I'm still seeing this error in a fresh installation cloned yesterday, no matter how many TPMs. Also randomly I'm getting this one:

Error: The app encountered an error processing your request. If you are an administrator of the app, view the full error in the logs. See aka.ms/appservice-logs for more information. Error type: <class 'openai.error.InvalidRequestError'>

I tried with gpt-3.5-turbo and gpt-4, getting the same issue.

pamelafox commented 11 months ago

@lhojeda Can you check the logs to find the full traceback? openai.error.InvalidRequestError can have many causes. You can download logs following instructions at https://blog.pamelafox.org/2023/06/tips-for-debugging-flask-deployments-to.html#download-logs

delicpsyche commented 11 months ago

I also cloned this today to test new functionality , getting the same error. The only traceback I see on the docker logs

2023-11-29T14:28:35.868889149Z Traceback (most recent call last): 2023-11-29T14:28:35.868896250Z File "/opt/python/3/lib/python3.11/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker 2023-11-29T14:28:35.868901950Z worker.init_process() 2023-11-29T14:28:35.868912851Z File "/opt/python/3/lib/python3.11/site-packages/gunicorn/workers/base.py", line 134, in init_process 2023-11-29T14:28:35.868918751Z self.load_wsgi() 2023-11-29T14:28:35.868933552Z File "/opt/python/3/lib/python3.11/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi 2023-11-29T14:28:35.868938753Z self.wsgi = self.app.wsgi() 2023-11-29T14:28:35.868943553Z ^^^^^^^^^^^^^^^ 2023-11-29T14:28:35.868948253Z File "/opt/python/3/lib/python3.11/site-packages/gunicorn/app/base.py", line 67, in wsgi 2023-11-29T14:28:35.868953154Z self.callable = self.load() 2023-11-29T14:28:35.868957954Z ^^^^^^^^^^^ 2023-11-29T14:28:35.868962554Z File "/opt/python/3/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 58, in load 2023-11-29T14:28:35.868967355Z return self.load_wsgiapp() 2023-11-29T14:28:35.868975555Z ^^^^^^^^^^^^^^^^^^^ 2023-11-29T14:28:35.868980556Z File "/opt/python/3/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp 2023-11-29T14:28:35.868985756Z return util.import_app(self.app_uri) 2023-11-29T14:28:35.868990356Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-11-29T14:28:35.868994857Z File "/opt/python/3/lib/python3.11/site-packages/gunicorn/util.py", line 359, in import_app 2023-11-29T14:28:35.868999457Z mod = importlib.import_module(module) 2023-11-29T14:28:35.869003857Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-11-29T14:28:35.869008358Z File "/opt/python/3/lib/python3.11/importlib/init.py", line 126, in import_module 2023-11-29T14:28:35.869012858Z return _bootstrap._gcd_import(name[level:], package, level) 2023-11-29T14:28:35.869017558Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-11-29T14:28:35.869022059Z File "", line 1204, in _gcd_import 2023-11-29T14:28:35.869027159Z File "", line 1176, in _find_and_load 2023-11-29T14:28:35.869031759Z File "", line 1140, in _find_and_load_unlocked 2023-11-29T14:28:35.869036360Z ModuleNotFoundError: No module named 'main'

2023_11_29_lw1sdlwk0004A7_default_docker.log

pamelafox commented 10 months ago

@delicpsyche That is a different error, and that is one we typically see what the app is still getting started. Do you still see that if you wait another 10 minutes and reload?

delicpsyche commented 10 months ago

Thanks - that is what I thought. Though I do not see any errors on the logs even though the UI responds with the same error openai.error . I cannot verify I waited for 10 minutes but I am pretty sure I waited 5 minutes. Having said that I redeployed it for the third time and the errors are gone.

delicpsyche commented 10 months ago

Errors are back - super intermittent. Log files seems empty when this happens. Waiting - refreshing the page seems to resolve it. I can take any other logs needs to isolate.

pamelafox commented 10 months ago

Do you have application insights turned on? If so, I've been successful recently debugging errors by going into Application Insights > Investigate > Failures, and then filtering by recency.

delicpsyche commented 10 months ago

Thanks - I was able to figure out the issue.

This model's maximum context length is 4096 tokens. However, you requested 4290 tokens (3266 in the messages, 1024 in the completion). Please reduce the length of the messages or completion.

GnanaSaiKrishna commented 9 months ago

I am facing this Error: The app encountered an error processing your request. If you are an administrator of the app, view the full error in the logs. See aka.ms/appservice-logs for more information. Error type: <class 'requests.exceptions.SSLError'> could anyone please help me to resolve this error.