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

Publish Lambda Layers for Node 16 #5752

Closed
AbhiPrasad opened this issue Sep 15, 2022 · 5 comments · Fixed by #7483
Closed

Publish Lambda Layers for Node 16 #5752

AbhiPrasad opened this issue Sep 15, 2022 · 5 comments · Fixed by #7483
Assignees

Comments

@AbhiPrasad
Copy link
Member

AbhiPrasad commented Sep 15, 2022

Problem Statement

https://aws.amazon.com/about-aws/whats-new/2022/05/aws-lambda-adds-support-node-js-16/

Solution Brainstorm

Update this craft, as per was done in #3303

- name: aws-lambda-layer
includeNames: /^sentry-node-serverless-\d+.\d+.\d+(-(beta|alpha)\.\d+)?\.zip$/
layerName: SentryNodeServerlessSDK
compatibleRuntimes:
- name: node
versions:
- nodejs10.x
- nodejs12.x
- nodejs14.x

Will have to then update docs

@kitsunde
Copy link

I am uncertain what the root cause of this is, but I upgraded an AWS lambda function from node 14.x to 16.x and the sentry lambda extension crashes on invoke. We jumped from the last < 7.0 SentryNodeServerlessSDK:65 to the latest SentryNodeServerlessSDK:83 in one go.

I've removed the AWS layer and moved sentry into package.json to resolve it.

In addition to the sentry lambda layer it has:

  • arn:aws:lambda:ap-southeast-1:580247275435:layer:LambdaInsightsExtension:21
  • AWS X-Ray enabled
+ exec /opt/relay/relay run --mode=proxy --shutdown-timeout=2 --aws-runtime-api=127.0.0.1:9001
LOGS	Name: cloudwatch_lambda_agent	State: Subscribed	Types: [platform]
2022-10-31T09:34:14Z [relay::setup] INFO: launching relay without config folder
2022-10-31T09:34:14Z [relay::setup] INFO:   relay mode: proxy
2022-10-31T09:34:14Z [relay::setup] INFO:   relay id: -
2022-10-31T09:34:14Z [relay::setup] INFO:   public key: -
2022-10-31T09:34:14Z [relay::setup] INFO:   log level: INFO
2022-10-31T09:34:14Z [relay_server::actors::upstream] INFO: upstream relay started
2022-10-31T09:34:14Z [relay_server::actors::outcome] INFO: Configured to emit outcomes as client reports
2022-10-31T09:34:14Z [relay_server::actors::processor] INFO: starting 2 envelope processing workers
2022-10-31T09:34:14Z [relay_server::actors::outcome] INFO: OutcomeProducer started.
2022-10-31T09:34:14Z [relay_server::actors::envelopes] INFO: envelope manager started
2022-10-31T09:34:14Z [relay_server::actors::project_cache] INFO: project cache started
2022-10-31T09:34:14Z [relay_server::actors::relays] INFO: key cache started
2022-10-31T09:34:14Z [relay_aws_extension::aws_extension] INFO: AWS extension started
2022-10-31T09:34:14Z [relay_aws_extension::aws_extension] INFO: Registering AWS extension on http://127.0.0.1:9001/2020-01-01/extension
2022-10-31T09:34:14Z [relay_aws_extension::aws_extension] INFO: AWS extension successfully registered
2022-10-31T09:34:14Z [relay_log::utils] ERROR: bind to interface failed
  caused by: Address already in use (os error 98)
EXTENSION	Name: sentry-lambda-extension	State: Ready	Events: [INVOKE,SHUTDOWN]
EXTENSION	Name: cloudwatch_lambda_agent	State: Ready	Events: [INVOKE,SHUTDOWN]
+ exec /opt/relay/relay run --mode=proxy --shutdown-timeout=2 --aws-runtime-api=127.0.0.1:9001
LOGS	Name: cloudwatch_lambda_agent	State: Already subscribed	Types: [platform]
2022-10-31T09:34:14Z [relay::setup] INFO: launching relay without config folder
2022-10-31T09:34:14Z [relay::setup] INFO:   relay mode: proxy
2022-10-31T09:34:14Z [relay::setup] INFO:   relay id: -
2022-10-31T09:34:14Z [relay::setup] INFO:   public key: -
2022-10-31T09:34:14Z [relay::setup] INFO:   log level: INFO
2022-10-31T09:34:14Z [relay_server::actors::upstream] INFO: upstream relay started
2022-10-31T09:34:14Z [relay_server::actors::outcome] INFO: Configured to emit outcomes as client reports
2022-10-31T09:34:14Z [relay_server::actors::processor] INFO: starting 2 envelope processing workers
2022-10-31T09:34:14Z [relay_server::actors::outcome] INFO: OutcomeProducer started.
2022-10-31T09:34:14Z [relay_server::actors::envelopes] INFO: envelope manager started
2022-10-31T09:34:14Z [relay_server::actors::project_cache] INFO: project cache started
2022-10-31T09:34:14Z [relay_server::actors::relays] INFO: key cache started
2022-10-31T09:34:14Z [relay_aws_extension::aws_extension] INFO: AWS extension started
2022-10-31T09:34:14Z [relay_aws_extension::aws_extension] INFO: Registering AWS extension on http://127.0.0.1:9001/2020-01-01/extension
2022-10-31T09:34:14Z [relay_aws_extension::aws_extension] INFO: AWS extension successfully registered
2022-10-31T09:34:14Z [relay_log::utils] ERROR: bind to interface failed
  caused by: Address already in use (os error 98)
EXTENSION	Name: sentry-lambda-extension	State: Ready	Events: [INVOKE,SHUTDOWN]
EXTENSION	Name: cloudwatch_lambda_agent	State: Ready	Events: [INVOKE,SHUTDOWN]
START RequestId: 7856a408-5a55-45cf-814a-b74e348075c4 Version: $LATEST
END RequestId: 7856a408-5a55-45cf-814a-b74e348075c4
REPORT RequestId: 7856a408-5a55-45cf-814a-b74e348075c4	Duration: 734.92 ms	Billed Duration: 735 ms	Memory Size: 2048 MB	Max Memory Used: 46 MB	
XRAY TraceId: 1-635f9695-2bda8cc631cb4e982e2029af	SegmentId: 7e14f0e12ce77a09	Sampled: true	
RequestId: 7856a408

@sl0thentr0py
Copy link
Member

@kitsunde seems some other service is running on the port we try to start our new AWS extension on, this is on our roadmap to fix.

@kitsunde
Copy link

@sl0thentr0py Ah, it's this issue #5412. Thanks. Btw if it's not targeting to be released shortly, maybe you want just switch the default port away first from the lambda insights extension since it's very common to include?

@sl0thentr0py
Copy link
Member

sl0thentr0py commented Oct 31, 2022

Will get fixed with next release by #6093
Just didn't get time to pick this up / dropped off my radar.

@souredoutlook
Copy link
Member

sync failed for closed issue: https://getsentry.atlassian.net/browse/ISSUE-1653

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants