sst / ion

❍ — a new engine for SST
https://ion.sst.dev
MIT License
1.09k stars 127 forks source link

Remix Getting Started docs lead to unkown error #150

Closed tallowen closed 2 months ago

tallowen commented 3 months ago

Feel free to close this if it's not helpful, I'm following up on #132 but I'm happy to just use local remix dev mode too be unblocked.

Steps to reproduce:

Same errors as previously:

0 verbose cli /opt/homebrew/Cellar/node@20/20.11.1_1/bin/node /opt/homebrew/opt/node@20/bin/npm
1 info using npm@10.2.4
2 info using node@v20.11.1
3 timing npm:load:whichnode Completed in 2ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/opt/homebrew/Cellar/node@20/20.11.1_1/lib/node_modules/npm/npmrc Completed in 2ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:/Users/ocoutts/dev/american-whitewater/my-remix-app/.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:/Users/ocoutts/.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:/opt/homebrew/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:setEnvs Completed in 0ms
16 timing config:load Completed in 7ms
17 timing npm:load:configload Completed in 7ms
18 timing config:load:flatten Completed in 1ms
19 timing npm:load:mkdirpcache Completed in 0ms
20 timing npm:load:mkdirplogs Completed in 0ms
21 verbose title npm run dev
22 verbose argv "run" "dev" "--loglevel" "verbose"
23 timing npm:load:setTitle Completed in 2ms
24 timing npm:load:display Completed in 1ms
25 verbose logfile logs-max:10 dir:/Users/ocoutts/.npm/_logs/2024-04-01T16_58_41_663Z-
26 verbose logfile /Users/ocoutts/.npm/_logs/2024-04-01T16_58_41_663Z-debug-0.log
27 timing npm:load:logFile Completed in 5ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 26ms
31 silly logfile start cleaning logs, removing 1 files
32 silly logfile done cleaning log files
33 timing command:run Completed in 2269ms
34 verbose exit 1
35 timing npm Completed in 2337ms
36 verbose code 1
thdxr commented 3 months ago

can you run the remix command manually? eg sst dev --verbose remix vite:dev or whatever your remix command is and show me the logs?

tallowen commented 3 months ago

Here is the output from a fresh run:

➜  my-remix-app sst dev --verbose remix vite:dev
time=2024-04-01T12:24:43.785-07:00 level=INFO msg="checking for pulumi" path="/Users/ocoutts/Library/Application Support/sst/bin/pulumi"
time=2024-04-01T12:24:44.117-07:00 level=INFO msg="checking for bun" path="/Users/ocoutts/Library/Application Support/sst/bin/bun"
time=2024-04-01T12:24:44.117-07:00 level=INFO msg=args args="[remix vite:dev]" length=2
time=2024-04-01T12:24:44.118-07:00 level=INFO msg="no existing server found, starting new one"
time=2024-04-01T12:24:44.119-07:00 level=INFO msg="waiting for server to start"
time=2024-04-01T12:24:44.131-07:00 level=INFO msg="checking for pulumi" path="/Users/ocoutts/Library/Application Support/sst/bin/pulumi"
time=2024-04-01T12:24:44.212-07:00 level=INFO msg="checking for bun" path="/Users/ocoutts/Library/Application Support/sst/bin/bun"
time=2024-04-01T12:24:44.212-07:00 level=INFO msg="initializing project" version=0.0.247
time=2024-04-01T12:24:44.213-07:00 level=INFO msg="esbuild building"
time=2024-04-01T12:24:44.221-07:00 level=INFO msg="esbuild built" outfile=/Users/ocoutts/dev/my-remix-app/.sst/eval/eval-1711999484212.mjs
time=2024-04-01T12:24:44.221-07:00 level=INFO msg="evaluating config"
time=2024-04-01T12:24:44.368-07:00 level=INFO msg="config evaluated"
time=2024-04-01T12:24:44.369-07:00 level=INFO msg="checking platform"
time=2024-04-01T12:24:44.370-07:00 level=INFO msg="credentials found"
time=2024-04-01T12:24:44.371-07:00 level=INFO msg="fetching bootstrap"
time=2024-04-01T12:24:44.840-07:00 level=INFO msg="found existing bootstrap" data="{\"version\":1,\"asset\":\"sst-asset-mxbtutnuaunk\",\"state\":\"sst-state-mxbtutnuaunk\"}"
time=2024-04-01T12:24:44.840-07:00 level=INFO msg="loaded config" app=my-remix-app stage=ocoutts
time=2024-04-01T12:24:44.842-07:00 level=INFO msg=server addr=0.0.0.0:13557
time=2024-04-01T12:24:44.842-07:00 level=INFO msg="credentials found"
time=2024-04-01T12:24:44.842-07:00 level=INFO msg="getting endpoint"
time=2024-04-01T12:24:44.844-07:00 level=INFO msg=subscribed type=*aws.FunctionInvokedEvent
time=2024-04-01T12:24:44.844-07:00 level=INFO msg=subscribed type=*aws.FunctionResponseEvent
time=2024-04-01T12:24:44.845-07:00 level=INFO msg=subscribed type=*aws.FunctionErrorEvent
time=2024-04-01T12:24:44.845-07:00 level=INFO msg=subscribed type=*aws.FunctionLogEvent
time=2024-04-01T12:24:44.845-07:00 level=INFO msg=subscribed type=*project.StackEvent
time=2024-04-01T12:24:45.161-07:00 level=INFO msg="found endpoint endpoint" url="wss://a275jihp0d1nno.iot.us-east-2.amazonaws.com/mqtt?X-Amz-Expires=86400"
time=2024-04-01T12:24:45.162-07:00 level=INFO msg="signed request" url="wss://a275jihp0d1nno.iot.us-east-2.amazonaws.com/mqtt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential={redacted}%2F20240401%2Fus-east-2%2Fiotdevicegateway%2Faws4_request&X-Amz-Date=20240401T192444Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature={redacted}"
time=2024-04-01T12:24:46.000-07:00 level=INFO msg=unsubscribing type=*aws.FunctionResponseEvent
time=2024-04-01T12:24:46.000-07:00 level=ERROR msg="exited with error" err="network Error : websocket: close 1005 (no status)"
×  Unexpected error occurred. Please check the logs or run with --verbose for more details.
time=2024-04-01T12:24:46.006-07:00 level=ERROR msg="exited with error" err="exit status 1"

Note - I did replace credential looking things with {redacted} to avoid doxing myself

theonlydaleking commented 3 months ago

fwiw I sst init'd before adding credentials and I got something similar:

time=2024-04-02T09:24:35.712+11:00 level=ERROR msg="exited with error" err="network Error : dial tcp: lookup aey6b7fekm0uc.iot.us-east-1.amazonaws.com: no such host"

I deleted everything and started again after adding credentials and it worked fine.

tallowen commented 3 months ago

I can reproduce this on a fresh remix project even with my credentials installed. For what it's worth, I can deploy a project to aws but development mode is what's failing.

thdxr commented 3 months ago

are you an sst2 user? we did occasionally see some people's network configurations blocking ws connections to iot

tallowen commented 3 months ago

I have not ever tried sst2 - I just went straight into trying sst3

thdxr commented 3 months ago

so we have seen an issue where the iot endpoint that aws is returning does not seem to be active (i can see that http://aey6b7fekm0uc.iot.us-east-1.amazonaws.com/ just hangs)

can you try setting a different region and seeing if you get the same error?

tallowen commented 3 months ago

Sure, how do I do I set the region? I tried configuring it in the sst.config.ts:

/// <reference path="./.sst/platform/config.d.ts" />

export default $config({
  app(input) {
    return {
      name: "my-remix-app",
      removal: input?.stage === "production" ? "retain" : "remove",
      home: "aws",
      region: 'us-west-1'
    };
  },
  async run() {
    new sst.aws.Remix("MyWeb");
  },
});

But alas it looks like us-east-2 is still being used.

➜  my-remix-app sst dev remix vite:dev --verbose
time=2024-04-02T14:00:36.059-07:00 level=INFO msg="checking for pulumi" path="/Users/ocoutts/Library/Application Support/sst/bin/pulumi"
time=2024-04-02T14:00:36.362-07:00 level=INFO msg="checking for bun" path="/Users/ocoutts/Library/Application Support/sst/bin/bun"
time=2024-04-02T14:00:36.363-07:00 level=INFO msg=args args="[remix vite:dev]" length=2
time=2024-04-02T14:00:36.364-07:00 level=INFO msg="no existing server found, starting new one"
time=2024-04-02T14:00:36.365-07:00 level=INFO msg="waiting for server to start"
time=2024-04-02T14:00:36.378-07:00 level=INFO msg="checking for pulumi" path="/Users/ocoutts/Library/Application Support/sst/bin/pulumi"
time=2024-04-02T14:00:36.470-07:00 level=INFO msg="checking for bun" path="/Users/ocoutts/Library/Application Support/sst/bin/bun"
time=2024-04-02T14:00:36.470-07:00 level=INFO msg="initializing project" version=0.0.247
time=2024-04-02T14:00:36.471-07:00 level=INFO msg="esbuild building"
time=2024-04-02T14:00:36.480-07:00 level=INFO msg="esbuild built" outfile=/Users/ocoutts/dev/my-remix-app/.sst/eval/eval-1712091636470.mjs
time=2024-04-02T14:00:36.480-07:00 level=INFO msg="evaluating config"
time=2024-04-02T14:00:36.619-07:00 level=INFO msg="config evaluated"
time=2024-04-02T14:00:36.620-07:00 level=INFO msg="checking platform"
time=2024-04-02T14:00:36.621-07:00 level=INFO msg="credentials found"
time=2024-04-02T14:00:36.622-07:00 level=INFO msg="fetching bootstrap"
time=2024-04-02T14:00:37.049-07:00 level=INFO msg="found existing bootstrap" data="{\"version\":1,\"asset\":\"sst-asset-mxbtutnuaunk\",\"state\":\"sst-state-mxbtutnuaunk\"}"
time=2024-04-02T14:00:37.050-07:00 level=INFO msg="loaded config" app=my-remix-app stage=ocoutts
time=2024-04-02T14:00:37.051-07:00 level=INFO msg=server addr=0.0.0.0:13557
time=2024-04-02T14:00:37.051-07:00 level=INFO msg="credentials found"
time=2024-04-02T14:00:37.052-07:00 level=INFO msg="getting endpoint"
time=2024-04-02T14:00:37.051-07:00 level=INFO msg=subscribed type=*aws.FunctionInvokedEvent
time=2024-04-02T14:00:37.052-07:00 level=INFO msg=subscribed type=*aws.FunctionResponseEvent
time=2024-04-02T14:00:37.052-07:00 level=INFO msg=subscribed type=*aws.FunctionErrorEvent
time=2024-04-02T14:00:37.052-07:00 level=INFO msg=subscribed type=*aws.FunctionLogEvent
time=2024-04-02T14:00:37.052-07:00 level=INFO msg=subscribed type=*project.StackEvent
time=2024-04-02T14:00:37.318-07:00 level=INFO msg="found endpoint endpoint" url="wss://a275jihp0d1nno.iot.us-east-2.amazonaws.com/mqtt?X-Amz-Expires=86400"
time=2024-04-02T14:00:37.318-07:00 level=INFO msg="signed request" url="wss://a275jihp0d1nno.iot.us-east-2.amazonaws.com/mqtt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVWZ5SGNLHVACABUF%2F20240402%2Fus-east-2%2Fiotdevicegateway%2Faws4_request&X-Amz-Date=20240402T210037Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=1d1880b06ecf7106b378f7fba930178591cbbff893d9bdd69f507d781ec1cd6b"
time=2024-04-02T14:00:38.102-07:00 level=INFO msg=unsubscribing type=*aws.FunctionLogEvent
time=2024-04-02T14:00:38.102-07:00 level=ERROR msg="exited with error" err="network Error : websocket: close 1005 (no status)"
×  Unexpected error occurred. Please check the logs or run with --verbose for more details.
time=2024-04-02T14:00:38.102-07:00 level=INFO msg=unsubscribing type=*aws.FunctionErrorEvent
time=2024-04-02T14:00:38.105-07:00 level=ERROR msg="exited with error" err="exit status 1"
thdxr commented 3 months ago
{
  home: "aws",
  providers: {
    aws: {
      region: "us-west-2"
    }
  }
}
tallowen commented 3 months ago

Looks like it's a slightly different error on us-west-2:

➜  my-remix-app sst dev remix vite:dev --verbose
time=2024-04-03T10:19:06.506-05:00 level=INFO msg="checking for pulumi" path="/Users/ocoutts/Library/Application Support/sst/bin/pulumi"
time=2024-04-03T10:19:06.797-05:00 level=INFO msg="checking for bun" path="/Users/ocoutts/Library/Application Support/sst/bin/bun"
time=2024-04-03T10:19:06.798-05:00 level=INFO msg=args args="[remix vite:dev]" length=2
time=2024-04-03T10:19:06.798-05:00 level=INFO msg="no existing server found, starting new one"
time=2024-04-03T10:19:06.799-05:00 level=INFO msg="waiting for server to start"
time=2024-04-03T10:19:06.812-05:00 level=INFO msg="checking for pulumi" path="/Users/ocoutts/Library/Application Support/sst/bin/pulumi"
time=2024-04-03T10:19:06.892-05:00 level=INFO msg="checking for bun" path="/Users/ocoutts/Library/Application Support/sst/bin/bun"
time=2024-04-03T10:19:06.892-05:00 level=INFO msg="initializing project" version=0.0.247
time=2024-04-03T10:19:06.893-05:00 level=INFO msg="esbuild building"
time=2024-04-03T10:19:06.902-05:00 level=INFO msg="esbuild built" outfile=/Users/ocoutts/dev/my-remix-app/.sst/eval/eval-1712157546892.mjs
time=2024-04-03T10:19:06.902-05:00 level=INFO msg="evaluating config"
time=2024-04-03T10:19:07.081-05:00 level=INFO msg="config evaluated"
time=2024-04-03T10:19:07.082-05:00 level=INFO msg="checking platform"
time=2024-04-03T10:19:07.085-05:00 level=INFO msg="credentials found"
time=2024-04-03T10:19:07.085-05:00 level=INFO msg="fetching bootstrap"
time=2024-04-03T10:19:07.742-05:00 level=INFO msg="creating bootstrap bucket" name=sst-asset-szxmvrfnbfxe
time=2024-04-03T10:19:11.134-05:00 level=INFO msg="loaded config" app=my-remix-app stage=ocoutts
time=2024-04-03T10:19:11.135-05:00 level=INFO msg=server addr=0.0.0.0:13557
time=2024-04-03T10:19:11.136-05:00 level=INFO msg=subscribed type=*aws.FunctionInvokedEvent
time=2024-04-03T10:19:11.136-05:00 level=INFO msg=subscribed type=*aws.FunctionResponseEvent
time=2024-04-03T10:19:11.136-05:00 level=INFO msg=subscribed type=*aws.FunctionErrorEvent
time=2024-04-03T10:19:11.136-05:00 level=INFO msg=subscribed type=*aws.FunctionLogEvent
time=2024-04-03T10:19:11.136-05:00 level=INFO msg=subscribed type=*project.StackEvent
time=2024-04-03T10:19:11.137-05:00 level=INFO msg="credentials found"
time=2024-04-03T10:19:11.137-05:00 level=INFO msg="getting endpoint"
time=2024-04-03T10:19:11.835-05:00 level=INFO msg="found endpoint endpoint" url="wss://a275jihp0d1nno.iot.us-west-2.amazonaws.com/mqtt?X-Amz-Expires=86400"
time=2024-04-03T10:19:11.835-05:00 level=INFO msg="signed request" url="wss://a275jihp0d1nno.iot.us-west-2.amazonaws.com/mqtt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVWZ5SGNLHVACABUF%2F20240403%2Fus-west-2%2Fiotdevicegateway%2Faws4_request&X-Amz-Date=20240403T151911Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=d83af290b970407f67cce142d9966ba000441b2f8197682bb73f802aff710cb2"
time=2024-04-03T10:19:11.917-05:00 level=INFO msg=unsubscribing type=*aws.FunctionResponseEvent
time=2024-04-03T10:19:11.917-05:00 level=ERROR msg="exited with error" err="network Error : dial tcp: lookup a275jihp0d1nno.iot.us-west-2.amazonaws.com: no such host"
×  Unexpected error occurred. Please check the logs or run with --verbose for more details.
time=2024-04-03T10:19:11.919-05:00 level=ERROR msg="exited with error" err="exit status 1"
jayair commented 3 months ago

Hmm is that endpoint hanging too? @tallowen

tallowen commented 3 months ago

Yeah, it looks like all the endpoints are hanging - I've tried a couple different regions to no avail. I've also tried doing a few different regions from other networks:

For what it's worth, sst deploy continues to work. Perhaps there is no connection to websockets there?

tallowen commented 2 months ago

@jayair / @thdxr - is there anything else that would be helpful in debugging this?

thdxr commented 2 months ago

i'm not too sure what's going on here - it seems like iot is busted in your aws account. is there any way to try another aws account?

thdxr commented 2 months ago

going to close this for now as it's not related to remix - feel free to open an issue about the iot problem if it comes up again