sst / ion

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

NoSuchBucket error with 'sst deploy' #281

Closed dev2xl closed 5 months ago

dev2xl commented 5 months ago

Context

I removed all buckets created by sst when I saw that 3 buckets still on my account after sst remove using development stage.

Now I am getting that error after set deploy

This is a default project create-next-app@latest with nothing more.

On the other hand set dev next dev it doesn't start the nextjs server. It keeps waiting for changes but I can't access localhost:3000, not sure is related or is another bug.

SST Log

time=2024-04-20T09:55:03.127-04:00 level=INFO msg="checking for pulumi" path="/Users/user/Library/Application Support/sst/bin/pulumi" time=2024-04-20T09:55:03.245-04:00 level=INFO msg="checking for bun" path="/Users/user/Library/Application Support/sst/bin/bun" time=2024-04-20T09:55:03.249-04:00 level=INFO msg="initializing project" version=0.0.296 time=2024-04-20T09:55:09.093-04:00 level=INFO msg="esbuild building" time=2024-04-20T09:55:09.097-04:00 level=INFO msg="esbuild built" outfile=/Users/user/ion/starter/.sst/eval/eval-1713621309093.mjs time=2024-04-20T09:55:09.097-04:00 level=INFO msg="evaluating config" time=2024-04-20T09:55:09.151-04:00 level=INFO msg="config evaluated" time=2024-04-20T09:55:09.151-04:00 level=INFO msg="checking platform" time=2024-04-20T09:55:09.152-04:00 level=INFO msg="credentials found" time=2024-04-20T09:55:09.152-04:00 level=INFO msg="fetching bootstrap" time=2024-04-20T09:55:09.367-04:00 level=INFO msg="found existing bootstrap" data="{\"version\":1,\"asset\":\"sst-asset-ovtcxxtuuceu\",\"state\":\"sst-state-ovtcxxtuuceu\"}" time=2024-04-20T09:55:09.367-04:00 level=INFO msg="loaded config" app=starter stage=test time=2024-04-20T09:55:09.367-04:00 level=INFO msg="running stack command" cmd=up time=2024-04-20T09:55:09.368-04:00 level=INFO msg="INFO locking app=starter stage=test" time=2024-04-20T09:55:09.368-04:00 level=INFO msg="INFO getting data key=lock app=starter stage=test" time=2024-04-20T09:55:09.514-04:00 level=ERROR msg="exited with error" err="operation error S3: GetObject, https response error StatusCode: 404, RequestID: GH14BWJTBA0ZSJFP, HostID: m6MUXaOpx3K7OP1wncT0fVYaVKpa+CuCCZ3/fp8xKUQcbiLrhDeh/56BVSFIut27JTIFylBBPfg=, api error NoSuchBucket: The specified bucket does not exist"

dev2xl commented 5 months ago

I'm guessing it detects a previous configuration probably from my aws account where those three buckets were used instead of creating a new one.

found existing bootstrap" data="{"version":1,"asset":"sst-asset-ovtcxxtuuceu","state":"sst-state-ovtcxxtuuceu"}"

dev2xl commented 5 months ago

I just found the solution looking through the code. If we delete the three buckets created by sst, we need to delete also the Parameters in AWS Systems Manager -> Parameter Store. It would be great to have this in some part of the docs. You can close the ticket thanks

ennioVisco commented 5 months ago

I just found the solution looking through the code. If we delete the three buckets created by sst, we need to delete also the Parameters in AWS Systems Manager -> Parameter Store. It would be great to have this in some part of the docs. You can close the ticket thanks

This should be documented somewhere, otherwise it's very hard to do a hard reset (quite convenient at this stage of development of ion)

joshymcd commented 4 months ago

I lost hours trying to figure out why it wouldnt do a clean deploy due to the above :( defo needs to be documented

ennioVisco commented 4 months ago

@thdxr sorry to bother, do you think a warning to the deploy command could be added? Or are you planning to address this problem when ion becomes more mature?

jayair commented 4 months ago

@ennioVisco let me make sure I get the issue. You deleted one of the buckets that SST uses internally and then the next deploy fails?

joshymcd commented 4 months ago

@jayair can't comment on @ennioVisco but for me i was trying to do a clean deploy, so i did a sst remove and manually removed the S3 buckets but the sst remove doesnt clear out the AWS Systems Manager Parameter Store configs. so the deploy fails. sst remove should remove the ASM config (maybe if a extra flag is passed in) or there should be a warning in the doc under the SST Remove to let you know that those configs persist after a sst remove.

ennioVisco commented 4 months ago

@ennioVisco let me make sure I get the issue. You deleted one of the buckets that SST uses internally and then the next deploy fails?

Precisely, the naive assumption of a user of sst/ion is that the state is entirely stored in the bucket, but this is not the case since a critical component is the AWS Parameter Store

jayair commented 4 months ago

Yeah these are needed across SST apps in the same account, so removing them would break those.

We might need a separate command to completely clear out the account because sst remove acts on your current app.