Hi, I keep getting "Failed to send response becaus...
# help
m
Hi, I keep getting "Failed to send response because lambda function us disconnected", together with a lambda timeout error, the timeout is 10s. This happens randomly it seems. Then afterwards, I get "The security Token included in the request is expired" but then it it works a few minutes later. I get these errors but in the background, the operation completes somehow. EG if I write to a dynamodb table, I get the errors above, (disconnected, timeout, security token) but when I check the table. The data has been written?? I had recently updated to the latest sst version then when these issues cropped up, I downgraded to my original version. But still I got these issues. Another side effect is that, lambdas are invoked twice. For instance, sending an sms or an email, I receive two emails and two sms...
I try to add photo metadata from a react frontend, I get a timeout errors. But when I check the database, the data was successifully added?
t
So the issue here is that the lambda in AWS is invoked, forwarded to your local machine, code is executed but for some reason not able to be sent back through
So the lambda times out even though the code is executing, looking into this
If you can replicate this can you pull logs from the AWS console for the websocket default function
m
Do you need these logs?
t
Yeah so in your lambda functions section in AWS console there hsould be a function named something like <stage>-<app>-debug-stack-Resource
and if you click to View Logs in Cloudwatch from the monitor tab
There should be errors printing there whenever you get a lambda function disconnected
m
Here's the log...
j
Just following up on this one, did we have a chance to look at this for you @mkarsene?
j
Hello friends, I just wanted to mention im having the exact same issue, after I upgraded sst form
0.44.0
to
0.54.4
.
Also, ive noticed, when running
sst start
, it takes a really long time to get from
Starting Live Lambda Dev
to
Debug session started. Listening for requests...
- about a minute or two, whereas before it took just a couple of seconds.
t
what region are you using jacoby?
j
@thdxr n. virginia
t
Ok I'm going to have to add some more diagnostics to see if I can get to the bottom of it. From what I'm aware of the only thing that happens between those two lines is connecting to the websocket server
j
i have an api + lambda setup as showed here. Ive also noticed after running
sst start
, and getting
Debug session started. Listening for requests...
, when i try to call my api, im getting 500s. Lambda logs show timeouts:
only after like 3 min or so the api starts to respond with correct messages 🤔
m
@Jay No. Still have the issue regardless of version. Now migrating to serverless framework as I am on a tight schedule and this issue is slowing things down too much. Atleast there I can deploy individual lambdas quickly after every change. Its not live lambda but its quicker than sst right now... hopefully you have better luck.
j
Yeah we are taking a look into this.
t
@Jacoby does downgrading fix the problem
j
@thdxr yes, i downgraded to
0.53.4
and all issues disappeared.
all is working super fast again
t
Can you run latest with --verbose and send me the log from start to the listening for messages line
Looks like @Frank got to the bottom of this! Our file watcher was watching node_modules which slows things down drastically on Windows (which I assume you're on). We're going to get a release out today
Fixed in 0.55.0
j
Sorry for not responding, im actually on my vacation 😄. Anyways, yes, im on windows, thanks for the fix, will upgrade shortly. You are the best 💪 .
ive upgraded and all seems to work well, thank you again!
j
Awesome!