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

mkarsene

12/20/2021, 7:55 AM
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

thdxr

12/20/2021, 3:24 PM
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

mkarsene

12/20/2021, 6:06 PM
Do you need these logs?
t

thdxr

12/20/2021, 6:22 PM
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

mkarsene

12/20/2021, 6:50 PM
Here's the log...
j

Jay

12/25/2021, 11:13 PM
Just following up on this one, did we have a chance to look at this for you @mkarsene?
j

Jacoby

12/26/2021, 4:43 PM
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

thdxr

12/26/2021, 4:53 PM
what region are you using jacoby?
j

Jacoby

12/26/2021, 4:54 PM
@thdxr n. virginia
t

thdxr

12/26/2021, 5:46 PM
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

Jacoby

12/26/2021, 11:43 PM
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

mkarsene

12/27/2021, 12:12 AM
@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

Jay

12/27/2021, 12:35 AM
Yeah we are taking a look into this.
t

thdxr

12/27/2021, 3:45 AM
@Jacoby does downgrading fix the problem
j

Jacoby

12/27/2021, 1:47 PM
@thdxr yes, i downgraded to
0.53.4
and all issues disappeared.
all is working super fast again
t

thdxr

12/27/2021, 1:48 PM
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

Jacoby

12/28/2021, 12:05 PM
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

Jay

12/28/2021, 1:14 PM
Awesome!