chalice icon indicating copy to clipboard operation
chalice copied to clipboard

"The domain name you provided already exists" Continuous Deployment (CD) + Custom Domain Names

Open leonelgalan opened this issue 3 years ago • 2 comments

After following both the Continuous Deployment (CD) and Custom Domain Names guides in the documentations. I'm not able to deploy by pushing to Github. The Beta stage is created but it fails with the message:

"The domain name you provided already exists"

Long version:

Logical ID: ApiGatewayCustomDomain
Status: CREATE_FAILED
Status Reason: Resource handler returned message: "The domain name you provided already exists. (Service: ApiGateway, Status Code: 400, Request ID: a1f7ccd0-706f-4276-b5d2-a678276c793b, Extended Request ID: null)" (RequestToken: d5adf486-d4a1-721c-de04-c1bda238ee7d, HandlerErrorCode: AlreadyExists)

For clarification, I was able to properly deploy my app with the custom domain using chalice deploy, it's only when I push to Github and that triggers the cloud formation deploy that it fails, because the beta app is trying to use the same domain I'm already using. Is there a way to have this two "stages" use different domains?

image

leonelgalan avatar Dec 11 '21 15:12 leonelgalan

I have the exact same issue. @leonelgalan did you find a fix?

eliyaba avatar Jul 04 '22 10:07 eliyaba

I have the exact same issue. @leonelgalan did you find a fix?

No, I just stopped using Chalice. I'm using CDK and Lambda Powertools Python instead.

leonelgalan avatar Jul 06 '22 13:07 leonelgalan

@eliyaba IDK if you still facing this problem, but I did some initial tests keeping the zip file generated right after I add the domain as an empty file (same name.zip but empty) and it worked fine. This is of course a huge workaround that worked fine to me. For example, after add my custom host, the .chalice looks like this:

.chalice/deployments/<some_hash>.zip

If you open this zip, delete all the content and then zip it again as an empty folder chalice will recognize it. So you can keep deploying with custom domains without any other problem.

That makes me think that we have a bug inside chalice code that make conditional we have the previous deployments to execute the deployment correctly. Anyways, that worked to me even don't being what I expected as perfect solution.

luis-kaufmann-silva avatar Oct 18 '22 02:10 luis-kaufmann-silva