aws-samples / aws-samples/amazon-ivs-ugc-sample

Lambda function: Cannot find package '@2toad/profanity'

Open
#13 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Hi,

The stream and metrics data are not being populated into the DB. Since it is apparently managed by EventBridge, I suspect the issue is due to the following error:

AWS cloudWatch logs

INIT_START Runtime Version: nodejs:18.v29 Runtime Version ARN: arn:aws:lambda:us-east-1::runtime:e78f4a8a086bd7395a083454a3b1a85e8bb06f09428b715c8078dfc31ce0c35c
[AWS Parameters and Secrets Lambda Extension] 2024/07/02 10:49:41 PARAMETERS_SECRETS_EXTENSION_LOG_LEVEL is info. Log level set to info.
[AWS Parameters and Secrets Lambda Extension] 2024/07/02 10:49:41 INFO Systems Manager Parameter Store and Secrets Manager Lambda Extension 1.0.103
[AWS Parameters and Secrets Lambda Extension] 2024/07/02 10:49:41 INFO Serving on port 2773
2024-07-02T10:49:41.517Z undefined ERROR Uncaught Exception
{
"errorType": "Error",
"errorMessage": "Cannot find package '@2toad/profanity' imported from /var/task/index.mjs",
"code": "ERR_MODULE_NOT_FOUND",
"stack": [
"Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@2toad/profanity' imported from /var/task/index.mjs",
" at new NodeError (node:internal/errors:405:5)",
" at packageResolve (node:internal/modules/esm/resolve:965:9)",
" at moduleResolve (node:internal/modules/esm/resolve:1022:20)",
" at moduleResolveWithNodePath (node:internal/modules/esm/resolve:876:12)",
" at defaultResolve (node:internal/modules/esm/resolve:1242:79)",
" at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:404:12)",
" at ModuleLoader.resolve (node:internal/modules/esm/loader:373:25)",
" at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:250:38)",
" at ModuleWrap. (node:internal/modules/esm/module_job:76:39)",
" at link (node:internal/modules/esm/module_job:75:36)"
]
}
EXTENSION Name: AWSParametersAndSecretsLambdaExtension State: Ready Events: [INVOKE, SHUTDOWN]

Can we have the source code of that lambda function : arn:aws:lambda:us-east-1:177933569100:layer:AWS-Parameters-and-Secrets-Lambda-Extension-Arm64:4?

Thanks

Contributor guide

Open the contributing guide

Research direction

Start with the Lambda entry point identified in the logs, /var/task/index.mjs, and inspect how the function is packaged and deployed with its dependencies. Verify why @2toad/profanity is unavailable at runtime and trace the EventBridge path; done means the Lambda initializes without ERR_MODULE_NOT_FOUND and stream and metrics data are populated in the database.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, node.js, typescript
Domain
backend, cloud, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.