sst / sst

Build full-stack apps on your own infrastructure.
https://sst.dev
MIT License
24.05k stars 1.85k forks source link

Bug: deploy stuck on creating Email component #5895

Open orelbn opened 3 weeks ago

orelbn commented 3 weeks ago

I created the email component for my dev environment, but when I tried to move it over to production, the deployment gets stuck on aws:ses:DomainIdentityVerification. I am using the Cloudflare DNS

sst.config.ts

const email = $app.stage !== "production"
    ? sst.aws.Email.get("MyEmail", "mydomain")
    : new sst.aws.Email("MyEmail", { sender: "mydomain", dns: sst.cloudflare.dns() });

Deploy output.

|  Error       MyEmail sst:aws:Email → MyEmailTXTRecord*** cloudflare:index:DnsRecord
failed to make http request: POST “URL”: 400 Bad Request {"result":null,"success":false,"errors":[{"code":81058,"message":"An identical record already exists."}],"messages":[]}
|  Created     MyEmail sst:aws:Email → MyEmailCNAMERecord*** cloudflare:index:DnsRecord
|  Created     MyEmail sst:aws:Email → MyEmailCNAMERecord*** cloudflare:index:DnsRecord
|  Created     MyEmail sst:aws:Email → MyEmailCNAMERecord*** cloudflare:index:DnsRecord
⠴  Creating    MyEmail sst:aws:Email → MyEmailVerification aws:ses:DomainIdentityVerification

Any help is greatly appreciated!

Update: Email component was able to be created after 23 minutes, but the deployment failed due to duplicate records.

Changed my config to:

 const email = sst.aws.Email.get("MyEmail", "mydomain")

As a workaround, after the DomainIdentityVerification was created, to avoid needing to try to create the DNS record on cloudflare.

Steps: Deployed to the dev environment that uses the dev aws account with a custom domain through Cloudflare DNS. Deployed to the production environment that uses the production aws account with a custom domain through Cloudflare DNS.

jayair commented 3 weeks ago

Can you describe the steps? Did you deploy to dev with a custom domain?

orelbn commented 3 weeks ago

Yes, I deployed to dev with a custom domain first. At this point, this is resolved on my end, but it might be helpful to refer to this issue if you want to make a change in handling DNS records when changing between stages. Feel free to close.