flyctl icon indicating copy to clipboard operation
flyctl copied to clipboard

Prevent users from deploying fly tomls with duplicate service definitions

Open gwuah opened this issue 1 year ago • 3 comments

Change Summary

Users sometimes end up defining multiple services for the same protocol & port. This harmless mistake would cause health-checks to fail because of only one of these services get picked by flaps. To fix this, I'm introducing some client-side validation to flag these issues.

They would now see this warning/help text 👇

Service [tcp-1738] has 2 duplicate definitions. To resolve this, merge them into 1 service.

References https://community.fly.io/t/health-checks-failing-with-failed-to-get-vm/18077 https://community.fly.io/t/unable-to-perform-health-checks/19604 https://community.fly.io/t/health-checks-always-failing/19641/2

gwuah avatar May 03 '24 23:05 gwuah

@gwuah do you know if this validation also checks if a http_service and a regular service use the same port? I feel like this could be a common source of misconception.

lubien avatar May 03 '24 23:05 lubien

@lubien yes it does. The thing is, http services are actually tcp services. They are converted to tcp services in flyctl before we send them to flaps.

gwuah avatar May 03 '24 23:05 gwuah

@dangra I think the process group remark is valuable, so I've added support for that. https://github.com/superfly/flyctl/pull/3522/commits/f0539a14e807bfae83d12905db509f20a4c0a365 Duplicate external ports however, I think we can ignore them for now and merge this.

gwuah avatar May 07 '24 12:05 gwuah