sst / ion

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

The specified log group already exists #612

Open alfman99 opened 2 months ago

alfman99 commented 2 months ago

MacOS Sonoma 14.5 SST version 0.0.421 Node version v22.3.0

Not always but sometimes, when I run sst dev I get this error:

×  Failed
   DLQSubscriberDfuuzx sst:aws:QueueLambdaSubscriber → DLQSubscriberDfuuzxFunctionLogGroup aws:cloudwatch:LogGroup
   Logs: CreateLogGroup, https response error StatusCode: 400, RequestID: 5c121c0b-6b90-4daa-90ba-1a07ed97e2ac, ResourceAlreadyExistsException: The specified log group already exists
   QProcessShortSubscriberDkzodr sst:aws:QueueLambdaSubscriber → QProcessShortSubscriberDkzodrFunctionLogGroup aws:cloudwatch:LogGroup
   Logs: CreateLogGroup, https response error StatusCode: 400, RequestID: f8d1f494-1ac2-4391-88ae-44ec9d4a5259, ResourceAlreadyExistsException: The specified log group already exists

I've tried doing sst refresh and sst remove.

alfman99 commented 2 months ago

Had to go to the Cloudwatch -> log group tab on aws panel and delete manually the log groups for it to work correctly.

jayair commented 1 month ago

That's weird. We'll need to take a look.

dror-weiss commented 1 month ago

For me this happened after my credentials got expired during deployment.

jcohenho commented 1 month ago

This also happened to me after cancelling in the middle of a deploy. I also resolved it by manually deleting the CloudWatch log group.

djodrell commented 1 month ago

This happens to me regularly, but not just with log groups. Usually happens after a GitHub Action times out and auto cancels the workflow. Not sure what's causing the timeout, but it seems to leave sst in a bad state.

My workaround is to sst unlock, sst remove, then manually delete all the offending log groups, iam roles, plus whatever stray resources it's complaining about.

Currently running SST ion 0.0.485, but will be upgrading to 0.1.x after our next release.

@jayair @fwang If you are unable to reproduce this, I'm happy to jump on a call and walk through our dev environment when it happens again.

nyacg commented 3 weeks ago

Also experiencing this on 0.1.7, just a simple API

nyacg commented 3 weeks ago

Seemed to be caused by having a name in function path

   api.route('POST /webhooks/scrape_profiles', {
      handler: 'src/workflow/handlers/scrapeProfilesWebhookCallback.scrapeProfilesWebhookCallback',
      // name: 'ScrapeProfilesCallbackWebhook',  // fixed when removed
      timeout: '1 minute',
      memory: '512 MB',
      link: [apifySecret, dbUrl],
    })