Hi all, we just updated sst from 0.53.3 to 0.69.6....
# help
o
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
Lambdas not wrapped with a sentry handler are fine?
o
yes, no issues there
t
Can I see an example function you've wrapped?
o
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
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
@Frank ah, let me try that out
Unfortunately, it didn’t work without the sentry wrapper in production. Any other thoughts?
t
yeah you do need to wrap
I'm not sure why it's not working locally, I have this exact setup
o
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
have you installed @sentry/serverless ?
it's possible in prod it's loading from a layer but locally it can't find it
o
yeah, i think that might be what’s happening here. sentry was installed.