copilot-cli: Listener rule priority already exists

Specifically, the error is in HTTPSListenerRule

Resource handler returned message: "Resource of type 'AWS::ElasticLoadBalancingV2::ListenerRule' with identifier 'One or more priorities not found (Service: ElasticLoadBalancingV2, Status Code: 400, Request ID: 4d85f81b-1fd1-4ec0-97e2-47ef4dc741dc, Extended Request ID: null)' already exists." (RequestToken: 318bcb60-c823-a2ba-6b21-6180adaed7d6, HandlerErrorCode: AlreadyExists)

We’re updating our services’ ports. Some are successfully updated and some of them failed with this error.

  • Our copilot app was initialized with --domain flag so all of our services’ base path is ‘/’
  • We made sure that the port are not in conflict with each other

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

You can update the value of http.path, and then run copilot svc deploy. And then, you can change http.path back to ‘/’ then copilot svc deploy again

Anyway, this solves our problem. Thank you @Lou1415926 🙌

Was there any manual operations that were performed before, on the listener rules?

Yes, we added a service on ecs that is not deployed through copilot. We need this to be internet facing so we manually edited the listener rules of the load balancer that our copilot env is using as well as add record in Route 53.