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

Incorrect v8 (241) lambda layer dependencies #12074

Closed
3 tasks done
JoaquinFernandez opened this issue May 16, 2024 · 1 comment · Fixed by #12083
Closed
3 tasks done

Incorrect v8 (241) lambda layer dependencies #12074

JoaquinFernandez opened this issue May 16, 2024 · 1 comment · Fixed by #12083

Comments

@JoaquinFernandez
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/aws-serverless

SDK Version

8.1.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

  1. Load the lambda layer 241 and initialize as documented -r @sentry/aws-serverless/awslambda-auto

Apparently, although the dependencies are correctly stated in the package.json of the @sentry/aws-serverless package, the lambda layer bundle only contains the @sentry/aws-serverless package with no dependencies from it.

Expected Result

The lambda is initialized and instrumented correctly

Actual Result


node:internal/modules/cjs/loader:1031
--
throw err;
^
Error: Cannot find module '@sentry/node'
Require stack:
- /opt/nodejs/node_modules/@sentry/aws-serverless/build/npm/cjs/awslambda-auto.js
- internal/preload
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
at Function.Module._load (node:internal/modules/cjs/loader:873:27)
at Module.require (node:internal/modules/cjs/loader:1100:19)
at require (node:internal/modules/cjs/helpers:119:18)
at Object.<anonymous> (/opt/nodejs/node_modules/@sentry/aws-serverless/build/npm/cjs/awslambda-auto.js:1:14)
at Module._compile (node:internal/modules/cjs/loader:1198:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
at Module.load (node:internal/modules/cjs/loader:1076:32)
at Function.Module._load (node:internal/modules/cjs/loader:911:12)
at internalRequire (node:internal/modules/cjs/loader:169:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/opt/nodejs/node_modules/@sentry/aws-serverless/build/npm/cjs/awslambda-auto.js',
'internal/preload'
]
}

@Lms24
Copy link
Member

Lms24 commented May 16, 2024

Hey @JoaquinFernandez thanks for writing in and reporting! We identified and fixed the issue in #12083. We're releasing 8.2.0 right now but will right after that release 8.2.1 which will include this fix.

Sorry for the inconvenience!

Your issue btw also served as a reminder that we need to isolate future v7 layer releases to not release under the same AWS lambda layer name. Otherwise we'd break v8 users. We'll also follow up with this a bit later.

Lms24 added a commit that referenced this issue May 16, 2024
We previously adjusted our lambda layer auto initialization in
#12017. This
unfortunately changed the build output of the `awslambda-auto`
bootstrapping script which required a package that isn't included in the
layer (`@sentry/node`). This PR fixes the `awslambda-auto` file; local
testing showed no more imports from `@sentry/node`.

fixes #12074
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants