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

HTTP 500: Error in logs says Worker was unable to load function: 'Cannot find module 'uuid' #29689

Closed
charlesanim opened this issue May 13, 2024 · 7 comments
Assignees
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@charlesanim
Copy link

charlesanim commented May 13, 2024

When i trigger the function i immediately get a http 500 error.
Then I see this below error thats says cannot find module uuid. The function was working fine until May 3, 2024. My hunch is maybe a regression occured at that time?
I'm not sure if I need to update something as my package.json doesn't have a dependency of uuid directly.

"@azure/functions": "^3.5.0",
"@azure/storage-blob": "^12.10.0"

In host.json, i have

"extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[4.0.0, 5.0.0)"
}

Result: Failure Exception: Worker was unable to load function reports: 'Cannot find module 'uuid' Require stack: - /home/site/wwwroot/node_modules/@azure/core-http/dist/index.js - /home/site/wwwroot/node_modules/@azure/storage-blob/dist/index.js - /home/site/wwwroot/dist/shared/containerClient.js - /home/site/wwwroot/dist/reports/index.js - /azure-functions-host/workers/node/dist/src/worker-bundle.js - /azure-functions-host/workers/node/dist/src/nodejsWorker.js' Stack: Error: Worker was unable to load function reports: 'Cannot find module 'uuid' Require stack: - /home/site/wwwroot/node_modules/@azure/core-http/dist/index.js - /home/site/wwwroot/node_modules/@azure/storage-blob/dist/index.js - /home/site/wwwroot/dist/shared/containerClient.js - /home/site/wwwroot/dist/reports/index.js - /azure-functions-host/workers/node/dist/src/worker-bundle.js - /azure-functions-host/workers/node/dist/src/nodejsWorker.js' at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15) at Module._load (node:internal/modules/cjs/loader:981:27) at Module.require (node:internal/modules/cjs/loader:1231:19) at Object.apply (/azure-functions-host/workers/node/dist/src/worker-bundle.js:2:51713) at require (node:internal/modules/helpers:177:18) at Object. (/home/site/wwwroot/node_modules/@azure/core-http/dist/index.js:5:12) at Module._compile (node:internal/modules/cjs/loader:1364:14) at Module._extensions..js (node:internal/modules/cjs/loader:1422:10) at Module.load (node:internal/modules/cjs/loader:1203:32) at Module._load (node:internal/modules/cjs/loader:1019:12)

@github-actions github-actions bot added Azure.Core Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels May 13, 2024
Copy link

Copy link

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@charlesanim charlesanim changed the title Worker was unable to load function reports: 'Cannot find module 'uuid' Worker was unable to load function: 'Cannot find module 'uuid' May 14, 2024
@charlesanim charlesanim changed the title Worker was unable to load function: 'Cannot find module 'uuid' HTTP 500: Error in logs says Worker was unable to load function: 'Cannot find module 'uuid' May 14, 2024
@xirzec
Copy link
Member

xirzec commented May 14, 2024

Odd that this isn't being loaded since @azure/core-http hasn't been updated since last November: https://www.npmjs.com/package/@azure/core-http and I see it still has the dependency listed in its package.json.

Can you reproduce this error using @azure/storage-blob locally outside of functions? Is it perhaps some issue with functions not deploying all your node dependencies?

@charlesanim
Copy link
Author

i think the issue could be on the host environment itself since im able to execute the function locally with local.settings.json environment variables set to prod account key, storage connection string etc. It all works as expected but in the host environment on azure portal, thats where this error gets thrown. See below for local log of successful function execution

Screenshot 2024-05-18 at 9 46 13 PM

@charlesanim
Copy link
Author

I redeployed the function from local vscode and now getting

Result: Failure Exception: Stack: RestError at handleErrorResponse (/home/site/wwwroot/node_modules/@azure/core-http/dist/index.js:3139:19) at /home/site/wwwroot/node_modules/@azure/core-http/dist/index.js:3075:49 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

@xirzec
Copy link
Member

xirzec commented May 20, 2024

The RestError thrown should have additional details that will let you know what the service responded with. I recommend catching it and logging them.

@charlesanim
Copy link
Author

Closing this issue as I found out my node_modules that was packaged was missing core dependencies. Thanks all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants