Copilot-cli: Unable to deploy a service with a domain: DomainLabelEmpty (Domain label is empty)

Created on 15 Apr 2021  ·  5Comments  ·  Source: aws/copilot-cli

❯ copilot --version
copilot version: v1.5.0

After deleting my application and starting from scratch, I'm able to reproduce this error with the following steps:

❯ copilot app init --domain my.domain.com --name app
❯ copilot env init --name env --profile default
❯ copilot svc init --name svc -t "Load Balanced Web Service" -i image/name
❯ copilot svc deploy --name svc --env env

At this point the CLI rolls back, and after checking CloudFormation I see this error in the environment's stack:

app-env:

EnvironmentHostedZone
UPDATE_FAILED
Resource handler returned message: "Invalid request provided: FATAL problem: DomainLabelEmpty (Domain label is empty) encountered with '.app.my.domain.com' (Service: Route53, Status Code: 400, Request ID: ..., Extended Request ID: null)" (RequestToken: ..., HandlerErrorCode: InvalidRequest)
typbug

Most helpful comment

How was the application torn down? Was it with running copilot app delete? If not it's possible that there orphaned resources around causing some weird behavior 🤔

I actually took the long road - manually deleting the services and then all the environments - before I realized app delete would nuke the whole thing. Maybe doing it piecemeal like that left room for stragglers?

That would be super helpful thank you!
I am not sure how to revert to an older version with homebrew, but we can download an older version temporarily locally and try running the command again (https://aws.github.io/copilot-cli/docs/getting-started/install/):

Good call, I just gave this a shot. Here's what I did:

❯ copilot1.5 app delete
❯ ./copilot1.4 app init app --domain my.domain.com
❯ ./copilot1.4 env init --name env --profile default --default-config
❯ ./copilot1.4 svc init --name svc -t "Load Balanced Web Service" -i image/name --port 80
❯ ./copilot1.4 deploy --name svc --env env

That succeeds!

I went ahead and then (using 1.5) tried another experiment: redeploy after deleting/recreating the environment + service. That also seemed to work as well.

Finally I tore down the application and went through all the same steps, this time using 1.5 for everything, and again it worked.

I'm not sure what did it, but eventually I was able to get things working!

All 5 comments

Oh very strange, I'm sorry about that 🙇 ! I have a few clarification questions if you wouldn't mind:

  • Does the error happen on multiple tries or I wonder if it was a transient issue?
  • Was the application working before with the provided domain name my.domain.com? and it stopped working after v1.5.0?
  • Just to make sure the domain was purchased with route53 right?

@efekarakus no problem, happy to add more detail!

Does the error happen on multiple tries or I wonder if it was a transient issue?

Not transient, I went through these steps a few times and got the error each time.

Was the application working before with the provided domain name my.domain.com? and it stopped working after v1.5.0?

Yes, although updating to 1.5 could be unrelated. I originally setup the application with 1.4, created some working environments, and left them alone for a while. I came back to play with 1.5, tore down those environments, and tried setting up new ones. It's very possible the 1.5 update is unrelated, and there are just some orphaned resources hanging around mucking things up.

I'm happy to try these same steps with 1.4 if you can give me steps to downgrade in homebrew, that would help narrow to the problem.

Just to make sure the domain was purchased with route53 right?

Yep!

I came back to play with 1.5, tore down those environments, and tried setting up new ones

How was the application torn down? Was it with running copilot app delete? If not it's possible that there orphaned resources around causing some weird behavior 🤔

We just tried to reproduce the issue by spinning up a new application with a domain on v1.5.0 and couldn't reproduce the bug unfortunately.

I'm happy to try these same steps with 1.4 if you can give me steps to downgrade in homebrew, that would help narrow to the problem.

That would be super helpful thank you!
I am not sure how to revert to an older version with homebrew, but we can download an older version temporarily locally and try running the command again (https://aws.github.io/copilot-cli/docs/getting-started/install/):

# For macOS
curl -Lo copilot-v140 https://github.com/aws/copilot-cli/releases/download/v1.4.0/copilot-darwin 
chmod +x copilot-v140 
./copilot-v140 init

How was the application torn down? Was it with running copilot app delete? If not it's possible that there orphaned resources around causing some weird behavior 🤔

I actually took the long road - manually deleting the services and then all the environments - before I realized app delete would nuke the whole thing. Maybe doing it piecemeal like that left room for stragglers?

That would be super helpful thank you!
I am not sure how to revert to an older version with homebrew, but we can download an older version temporarily locally and try running the command again (https://aws.github.io/copilot-cli/docs/getting-started/install/):

Good call, I just gave this a shot. Here's what I did:

❯ copilot1.5 app delete
❯ ./copilot1.4 app init app --domain my.domain.com
❯ ./copilot1.4 env init --name env --profile default --default-config
❯ ./copilot1.4 svc init --name svc -t "Load Balanced Web Service" -i image/name --port 80
❯ ./copilot1.4 deploy --name svc --env env

That succeeds!

I went ahead and then (using 1.5) tried another experiment: redeploy after deleting/recreating the environment + service. That also seemed to work as well.

Finally I tore down the application and went through all the same steps, this time using 1.5 for everything, and again it worked.

I'm not sure what did it, but eventually I was able to get things working!

Yay awesome to hear that things got to work again! I'm glad that the app delete command also turned out to be useful :)

I'll close the issue now but feel free to re-open/create a new one if you encounter another problem!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

efe-selcuk picture efe-selcuk  ·  3Comments

jaybauson picture jaybauson  ·  3Comments

fullstackdev-online picture fullstackdev-online  ·  3Comments

srrengar picture srrengar  ·  3Comments

iamhopaul123 picture iamhopaul123  ·  3Comments