sst / ion

SST v3
https://sst.dev
MIT License
2k stars 234 forks source link

MQTT connection error on SST(ION) dev next dev command (macOS M1) #262

Closed KundaiClayton closed 5 months ago

KundaiClayton commented 5 months ago

I'm encountering an issue when running the sst dev next dev command on my macOS M1 machine (Also have the same error in my remix app as well). I'm using the following versions:

Error: time=2024-04-17T13:42:27.499+02:00 level=INFO msg=unsubscribing type=*aws.FunctionLogEvent time=2024-04-17T13:42:27.499+02:00 level=ERROR msg="exited with error" err="failed to connect to mqtt: network Error : websocket: close 1005 (no status)"

thdxr commented 5 months ago

does this issue eventually go away? or is it consistently happening

thdxr commented 5 months ago

also what region is this?

mjh316 commented 5 months ago

Just wanted drop in that it happens for me on us-west-2 the first 3-4 times that I run sst dev, but seems to be working now after a few more attempts.

jayair commented 5 months ago

@mjh316 is yours a new AWS account?

mjh316 commented 5 months ago

@jayair It's relatively new (few weeks), but it's not the first time I've used AWS instances on the account.

webdeb commented 5 months ago

Just created a new dev sub account with PowerUser access in eu-central-1 and wanted to try it out, got the same error with pnpm dev in a new nextjs project.

*Update: works now

asynchroza commented 4 months ago

eu-central-1 here as well. I keep experiencing this issue.

asynchroza commented 4 months ago

It seems it's a permission error. I assigned my user the following policy AWSIoTFullAccess and it started working. Not exactly sure which permission enabled that per se.

bmstefanski commented 4 months ago

Also getting the same error. App deployed on us-east-1, connecting from Europe. Happens quite frequently. Using USA (CA) vpn fixes the issue

justinwaite commented 3 months ago

This error happens for me as well. I was able to get it working for a while, but as soon as I switched to a different AWS account, I started having troubles again. Interestingly, I can ping the IOT address just fine, only fails when running sst dev.

time=2024-06-20T18:16:22.195-06:00 level=ERROR msg="exited with error" err="failed to connect to mqtt: network Error : dial tcp: lookup xxx.iot.us-west-2.amazonaws.com: no such host"

Edit: the key is to complain on this thread and then try again for the 19th time and it will work.

asynchroza commented 3 months ago

This error happens for me as well. I was able to get it working for a while, but as soon as I switched to a different AWS account, I started having troubles again. Interestingly, I can ping the IOT address just fine, only fails when running sst dev.

time=2024-06-20T18:16:22.195-06:00 level=ERROR msg="exited with error" err="failed to connect to mqtt: network Error : dial tcp: lookup xxx.iot.us-west-2.amazonaws.com: no such host"

Edit: the key is to complain on this thread and then try again for the 19th time and it will work.

It looks to me as if you've switched your region as well and now pointing to a location where your services are not deployed.

tmayr commented 3 months ago

Observing the same issue with different regions Deployment goes through fine in all regions, but sst dev does not

First tries on eu-west-1 didn't work, but after a few, it did But now it isn't working on eu-north-1, same no such host error, the IOT MQTT url seems correct

justinwaite commented 3 months ago

This error happens for me as well. I was able to get it working for a while, but as soon as I switched to a different AWS account, I started having troubles again. Interestingly, I can ping the IOT address just fine, only fails when running sst dev.


time=2024-06-20T18:16:22.195-06:00 level=ERROR msg="exited with error" err="failed to connect to mqtt: network Error : dial tcp: lookup xxx.iot.us-west-2.amazonaws.com: no such host"

Edit: the key is to complain on this thread and then try again for the 19th time and it will work.

It looks to me as if you've switched your region as well and now pointing to a location where your services are not deployed.

Just one region that I'm using, and this was a first time deployment on the account, so of course the services weren't deployed there yet, that's what sst dev is supposed to do 😉

jayair commented 3 months ago

I think with newer accounts/regions it takes a few minutes (around 10?) to warm up IoT?

klaemo commented 3 months ago

Same here

time=2024-07-04T16:07:12.586+02:00 level=ERROR msg="exited with error" err="failed to connect to mqtt: network Error : dial tcp: lookup xxx.iot.eu-central-1.amazonaws.com: no such host"

Very old AWS account, but never used IoT stuff with it 🤔

I think with newer accounts/regions it takes a few minutes (around 10?) to warm up IoT?

Yeah, for me it took around 20 minutes.

Chriscbr commented 1 month ago

I got this as well, trying to use SST for the first time. I retried a few times, then did a google search and found this thread -- looks like waiting a bit fixed it.

deweller commented 2 weeks ago

This also happened to me. Not a new account, but first time I used sst on this account. Waiting about 5 minutes and trying again fixed it.