Anybody else experienced this issue in Lambda? My ...
# sst
a
Anybody else experienced this issue in Lambda? My lambda is timing out, but checking in the logs, there is nothing there… only couple of warnings, but looks like is taking long time to do the cold-start and it doesn’t log anything.
r
When I've seen this kind of thing before it's been because of a problem connecting to some AWS service like SSM or S3 - usually due to VPC config. If you add a log statement to the very start of the handler and at top of the file that's imported that holds the lambda, do you see anything in the logs?
a
Good call. I’ve been having issues with SSM, apparently reaching the quota limit.
But I enabled ‘advanced usage’ or something like that.
I’m using middy, I can try to add a log on the top, I have some but are never shown.
Due middy is called first, not sure if those are getting called.
r
If you run it via SST start, can you add breakpoints in the middy middlewares to see which are getting hit?
a
Yeah but locally works.
That’s the weird thing.
Only fails when deployed to AWS.
Maybe it’s an issue with VPC like you said?
r
could be, but if it's working locally you'd typically have the opposite problem
a
Not sure how is that related.
I can’t connect to the DB from local for example, because it’s on the VPC.
But I can connect to external services, from local.
r
Yeah, that's what I mean. usually the challenge is with getting the local running lambda to connect to services in a vpc but you seem to have the opposite problem, local can connect but deployed can't
a
Yeah. It’s weird because I think it can connect sometimes.
But sometimes this problem happens, with a timeout.
Looks like the cold-start is the one that can not connect.
s
Have you checked VPC security group? For debugging you can enable all TCP traffic and see if it still timeouts.
a
I’m going to check it.
@Slawomir Stec I have all traffic enabled 😞
In both inbound and outbound.
s
I'm guessing this is axios timeout, I would try to enable VPC Flow Logs to gather more data.
a
Oh didn’t know that existed.
Also, looks like I didn’t have ENDPOINT enabled.
Didn’t know that existed.
Do you know that?
Had to add some endpoints like `*`com.amazonaws.region.ssm`.`*
s
this is also new for me