Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Still MODULE_NOT_FOUND after successful push via GH actions #78

Closed
Nettitude-MS opened this issue Aug 8, 2023 · 5 comments
Closed

Still MODULE_NOT_FOUND after successful push via GH actions #78

Nettitude-MS opened this issue Aug 8, 2023 · 5 comments

Comments

@Nettitude-MS
Copy link

I'm still seeing issues and I am really not sure why as I am confident I have setup the application based on the README.

I've created the required App Reg within my Development AAD and I created the AZURE_CREDENTIALS and the AZURE_APP_SERVICE variables within GH.

I ensured the App Reg had the required Contributor role within the RG I was deployed into.

Used the updated ARM template to ensure that the NEXTAUTH_URL had the 'https:/' prefix as explained previously.

Updated the settings within the App Service with the AZURE_AD_TENANT_ID, AZURE_AD_CLIENT_ID and AZURE_AD_CLIENT_SECRET variables.

Pushed the app files to the app service via the GH action and this excutes successfully without issue.

I then traverse to the app, complete initial sign in (which completes successfully based on the AAD logs)until I get the following error:

image

I know from previous issues that this related to an issue with the COSMOSDB_KEY and COSMOSDB_URI variables being incorrectly set so I have validated this on my side and I can confirm that the variable names are correct in the App Service and in the code within GH.

I took a look at the Kudu portal to see if I could diagnose further and I am still seeing events like the below:

image

I checked the file path that the error mentions (/home/site/wwwroot/) and confirmed that the file 'server.js" does indeed exist within the application files:

image

Really sorry if this is a simple fix but I am really struggling and not sure where else to troubleshoot.

Thanks for your help.

@Xtrah
Copy link
Contributor

Xtrah commented Aug 9, 2023

Do you have node server.js set as startup command in your Azure Web App? If yes, can you share a "censored" version of your environment variables in Azure and GitHub repo secrets?

@Nettitude-MS
Copy link
Author

Yes, I have the start-up command entered correctly as far as I can see within General Settings.

My enviorment variables within the Azure Portal are below for:

image

My GH secrets are below:

image

Anything else I can check?

@TimArrow
Copy link

Hi there, just deployed the app to an appservice and run into this issue as well. Any idea for a fix?

I do have node server.js set as startup command in my Azure Web App
Variables look nearly like Nettitude-MS ones

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

image

@Nettitude-MS
Copy link
Author

This must be authentication issue as I have invited a guest account from a separate tenancy and I was able to sign in and use the application without issue.

Must be some kind of bug. Hopefully an admin can help us understand what next steps.

@thivy
Copy link
Contributor

thivy commented Aug 15, 2023

@Nettitude-MS could you please ensure that you have run the GitHub actions to trigger the deployment?

@thivy thivy closed this as completed Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants