I'm pretty confused here. When I run `npx sst star...
# help
l
I'm pretty confused here. When I run
npx sst start
and test a POST request with Postman, it works. When I stop running that, and test the POST request to the same URL, with the sst app deployed via
npx sst start
, I immediately get
500 Internal Server Error
, and no log appearing for the Lambda function in CloudWatch. I am certain that I'm sending the request to the correct URL. Any ideas of what I could be doing wrong? tl;dr: I'm getting
500 Internal Server Error
on all my functions and not sure why, and struggling to debug.
Some more context: • The deployed app has worked before with no problems • I've checked to make sure it's deployed in Lambda -> Applications, and it is
Think I will try deploy it as a new stack and see what happens
f
Hi @Louis Barclay , after u stop sst start, you’d need to run sst deploy to deploy the real app.
l
Yup, I did that
The app has historically been deployed
It currently is deployed but still giving the 500. Can't figure out why
f
Hmm… just a sanity check.. can you try running sst deploy again?
l
I'm currently running it, having changed the stack name so it'll generate a new app and endpoint (I think)
I will see if that fixes it
Yup, seems to work now
Really weird
f
Just to clarify, after you stop sst start, the API won’t work until you run sst deploy again.
l
Ah OK. Every single time?
So basically if I have my live app that's in production using the same endpoint, I am in trouble if I ever test the API locally and then forget to run npx sst deploy?
I think I misunderstand the best practice here
Presumably I should then have a separate endpoint that is my production API
f
Yeah, you shouldn’t run sst start in production stages.
l
Aha OK. So what's best practice once I've 1) deployed for the first time? 2) Need to make a change?
f
You should always work in a development stage (ie. dev stage). And when you want to deploy to production you run “sst deploy -- stage prod”
l
OK cool!
Thanks a lot for the help Frank! Insanely appreciated as always