microsoft / azurechat

🤖 💼 Azure Chat Solution Accelerator powered by Azure Open AI Service
MIT License
1.24k stars 1.21k forks source link

Application error: a server-side exception has occurred (see the server logs for more information). #48

Closed oliverlabs closed 1 year ago

oliverlabs commented 1 year ago

When I deploy an app to an Azure Web App using GitHub Actions, the Action succeeds and the deployment is there.

However, once I authenticate, I get the following error:

Application error: a server-side exception has occurred (see the server logs for more information). Digest: 807578399

The url is https://chatomg-app-[REDACTED].azurewebsites.net/chat

Looking at the logs, there's a MODULE NOT FOUND error upon loading the container:

2023-08-04T13:16:40  Welcome, you are now connected to log-streaming service.
Starting Log Tail -n 10 of existing logs ----
/home/LogFiles/__lastCheckTime.txt  (https://chatomg-app-[REDACTED].scm.azurewebsites.net/api/vfs/LogFiles/__lastCheckTime.txt)08/04/2023 13:11:04
/home/LogFiles/kudu/trace/ee68e071c1e3-8c0baba3-95b6-42c0-8b06-5ca15ca99b94.txt  (https://chatomg-app-[REDACTED].scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/ee68e071c1e3-8c0baba3-95b6-42c0-8b06-5ca15ca99b94.txt)
2023-08-04T13:03:30  Startup Request, url: /api/deployments/?$orderby=ReceivedTime%20desc&$top=20&api-version=2022-03-01, method: GET, type: request, pid: 86,1,14, ScmType: None
/home/LogFiles/kudu/trace/f0602c3d977b-f84ce349-8d4a-4684-86a7-caba7f488a61.txt  (https://chatomg-app-4waanfmk7mez2.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/f0602c3d977b-f84ce349-8d4a-4684-86a7-caba7f488a61.txt)
2023-08-04T13:08:20  Startup Request, url: /api/settings, method: GET, type: request, pid: 92,1,16, ScmType: None
/home/LogFiles/kudu/trace/fdaf58675734-42e852ef-a880-4d56-b4a6-f6d5119a2bbd.txt  (https://chatomg-app-4waanfmk7mez2.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/fdaf58675734-42e852ef-a880-4d56-b4a6-f6d5119a2bbd.txt)
2023-08-04T13:06:22  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/2023_08_04_ln0xsdlwk00000F_default_docker.log  (https://chatomg-app-4waanfmk7mez2.scm.azurewebsites.net/api/vfs/LogFiles/2023_08_04_ln0xsdlwk00000F_default_docker.log)
2023-08-04T13:08:38.716314930Z     at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
2023-08-04T13:08:38.716318930Z     at Module._load (node:internal/modules/cjs/loader:920:27)
2023-08-04T13:08:38.716322930Z     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
2023-08-04T13:08:38.716340930Z     at node:internal/main/run_main_module:23:47 {
2023-08-04T13:08:38.716345330Z   code: 'MODULE_NOT_FOUND',
2023-08-04T13:08:38.716349530Z   requireStack: []
2023-08-04T13:08:38.716353330Z }
2023-08-04T13:08:38.716463731Z
2023-08-04T13:08:38.716475931Z Node.js v18.16.0
Nettitude-MS commented 1 year ago

I am seeing the same here:

2023-08-04T13:26:23 Welcome, you are now connected to log-streaming service. Starting Log Tail -n 10 of existing logs ---- /home/LogFiles/lastCheckTime.txt (https://[REDACTED].scm.azurewebsites.net/api/vfs/LogFiles/lastCheckTime.txt)08/04/2023 12:14:12 /home/LogFiles/kudu/trace/36ecca4b6270-54a583d6-d700-4f5c-ba1e-548a8ed6c99d.txt (https://[REDACTED].scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/36ecca4b6270-54a583d6-d700-4f5c-ba1e-548a8ed6c99d.txt) 2023-08-04T12:12:38 Startup Request, url: /api/settings, method: GET, type: request, pid: 86,1,14, ScmType: None /home/LogFiles/kudu/trace/fd08e91a2b9c-d576cc91-951a-4522-97e9-aebb535ae520.txt (https://[REDACTED].scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/fd08e91a2b9c-d576cc91-951a-4522-97e9-aebb535ae520.txt) 2023-08-04T13:26:23 Startup Request, url: /api/logstream/, method: GET, type: request, pid: 86,1,5, ScmType: None /home/LogFiles/2023_08_04_ln0xsdlwk00000G_default_docker.log (https://[REDACTED].scm.azurewebsites.net/api/vfs/LogFiles/2023_08_04_ln0xsdlwk00000G_default_docker.log) 2023-08-04T12:09:48.325789075Z at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15) 2023-08-04T12:09:48.325793575Z at Module._load (node:internal/modules/cjs/loader:920:27) 2023-08-04T12:09:48.325797975Z at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) 2023-08-04T12:09:48.325815576Z at node:internal/main/run_main_module:23:47 { 2023-08-04T12:09:48.325820376Z code: 'MODULE_NOT_FOUND', 2023-08-04T12:09:48.325824776Z requireStack: [] 2023-08-04T12:09:48.325829076Z } 2023-08-04T12:09:48.326638200Z 2023-08-04T12:09:48.326673201Z Node.js v18.16.0

oliverlabs commented 1 year ago

I solved the issue. It was caused by the latest commits as someone tried to fix typos in the AZURE_COSMOSEDB_URI and AZURE_COSMOSEDB_KEY variable name. I reverted to the last commit on Aug 3 where this worked and it solved the issue.

TimArrow commented 1 year ago

Hi there, just deployed the app to an appservice and run into this issue as well. Any idea for a fix? Checked the mentioned variable names: AZURE_COSMOSDB_KEY and AZURE_COSMOSDB_URI seem to be right?

2023-08-10T09:57:31 Welcome, you are now connected to log-streaming service. Starting Log Tail -n 10 of existing logs ---- /home/LogFiles/lastCheckTime.txt (https://timsai-[redacted].scm.azurewebsites.net/api/vfs/LogFiles/lastCheckTime.txt)08/10/2023 09:43:14 /home/LogFiles/kudu/trace/18a4785f3f88-[redacted]-27b1-48f6-9e13-a563904832fc.txt (https://timsai-[redacted].scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/18a4785f3f88-[redacted]-27b1-48f6-9e13-a563904832fc.txt) 2023-08-10T09:38:04 Startup Request, url: /api/settings, method: GET, type: request, pid: 92,1,29, ScmType: None /home/LogFiles/kudu/trace/40c8cf713838-[redacted]-ffb7-4102-9a24-736ac6b998a4.txt (https://timsai-[redacted].scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/40c8cf713838-[redacted]-ffb7-4102-9a24-736ac6b998a4.txt) 2023-08-10T09:52:35 Startup Request, url: /api/logstream/, method: GET, type: request, pid: 92,1,18, ScmType: None /home/LogFiles/kudu/trace/722388e64825-[redacted]-936d-45ad-9f65-08d1f1c676c8.txt (https://timsai-[redacted].scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/722388e64825-[redacted]-936d-45ad-9f65-08d1f1c676c8.txt) 2023-08-10T09:26:20 Startup Request, url: /detectors, method: GET, type: request, pid: 84,1,7, ScmType: None /home/LogFiles/2023_08_10_ln1xsdlwk000006_default_docker.log (https://timsai-[redacted].scm.azurewebsites.net/api/vfs/LogFiles/2023_08_10_ln1xsdlwk000006_default_docker.log) 2023-08-10T09:37:45.890815395Z at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15) 2023-08-10T09:37:45.890819196Z at Module._load (node:internal/modules/cjs/loader:920:27) 2023-08-10T09:37:45.890823496Z at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) 2023-08-10T09:37:45.890840596Z at node:internal/main/run_main_module:23:47 { 2023-08-10T09:37:45.890845096Z code: 'MODULE_NOT_FOUND', 2023-08-10T09:37:45.890849197Z requireStack: [] 2023-08-10T09:37:45.890853297Z } 2023-08-10T09:37:45.890857197Z 2023-08-10T09:37:45.890861497Z Node.js v18.16.0

oliverlabs commented 1 year ago

@TimArrow try updating your fork with the latest commits from the main branch and re-run the script. It seems you're still getting issues with connecting to your database.

TimArrow commented 1 year ago

I forked it today, so it should be up-to-date i checked the URI of my Comsos it is correct, also checked the key value which is also correct. I am new to this GitHub stuff trying to figure it out. Do you mean by re-run the script to run the workflow again?

oliverlabs commented 1 year ago

@TimArrow, yes, naturally, you need to redeploy the web app by manually triggering the GitHub Actions, also once done, make sure all the env variables defined here are set on your Web App (or locally in a env.local file).

Hope this helps!

TimArrow commented 1 year ago

That did not solve my issue. Application error: a server-side exception has occurred (see the server logs for more information). Digest: 3110068063

TimArrow commented 1 year ago

Update: Seems to be a permission issue. If i use my LiveID /Owner Subscription i can access the app, if i use a user originating from the tenant i receive the above error, if i use a guest user invited into my tenant it works ?!

oliverlabs commented 1 year ago

@TimArrow , check the settings of your Enterprise App Registration. You might need to provide a Global Admin permission to access user details. Also, check if you need to explicitly assign a user role to that app registration for users.