https://serverless-stack.com/ logo
#help
Title
# help
o

Orlando

04/21/2022, 4:37 PM
Hi all, we just updated sst from 0.53.3 to 0.69.6. Everything is working well in production. However, we’re seeing an issue where live lambda gets hung up and then times out on all lambda functions wrapped with a Sentry handler. Sentry is set up like this where its only conditionally attached to prod deploy, and not on local. Any ideas why we might be seeing this issue?
t

thdxr

04/21/2022, 4:38 PM
Lambdas not wrapped with a sentry handler are fine?
o

Orlando

04/21/2022, 4:38 PM
yes, no issues there
t

thdxr

04/21/2022, 4:40 PM
Can I see an example function you've wrapped?
o

Orlando

04/21/2022, 4:44 PM
Copy code
import Sentry from "@sentry/serverless";
import type { SQSHandler, EventBridgeEvent } from 'aws-lambda';

export const main: SQSHandler = Sentry.AWSLambda.wrapHandler(async (evt) => {
 evt.Records.map(({ body }) => {
    console.log(body);
    //TODO: handle error
  }
 )});
This one goes from queue to lambda. Also did a quick test on this where it got stuck too.
Copy code
import Sentry from "@sentry/serverless";

export const handler = Sentry.AWSLambda.wrapHandler(async (event) => {
  return {
    statusCode: 200,
    headers: { "Content-Type": "text/plain" },
    body: `Hello, World! Your request was received at ${event.requestContext.time}.`,
  };
});
f

Frank

04/21/2022, 4:51 PM
As a side note, can you try not wrapping the Lambda functions and see if Sentry works in production?
I think if u r already using the Sentry layer, u might not need to wrap.
o

Orlando

04/21/2022, 4:53 PM
@Frank ah, let me try that out
Unfortunately, it didn’t work without the sentry wrapper in production. Any other thoughts?
t

thdxr

04/21/2022, 6:48 PM
yeah you do need to wrap
I'm not sure why it's not working locally, I have this exact setup
o

Orlando

04/21/2022, 8:55 PM
we installed a new sst project with sst v1.0.0-beta.22 to test. Instead of hanging up, it gives us this error:
Copy code
ERROR Runtime.UnhandledPromiseRejection: TypeError: Cannot read properties of undefined (reading 'AWSLambda')
t

thdxr

04/21/2022, 9:06 PM
have you installed @sentry/serverless ?
it's possible in prod it's loading from a layer but locally it can't find it
o

Orlando

04/21/2022, 9:14 PM
yeah, i think that might be what’s happening here. sentry was installed.
2 Views