hashicorp / terraform-provider-consul

Terraform Consul provider
https://www.terraform.io/docs/providers/consul/
Mozilla Public License 2.0
124 stars 113 forks source link

failed to delete 'service' config entry: discovery chain "service" uses inconsistent protocols #398

Closed danihuerta closed 6 months ago

danihuerta commented 6 months ago

Terraform Version

Terraform v1.5.7 on linux_amd64

Affected Resource(s)

Please list the resources as a list, for example:

consul_config_entry_service_defaults

Terraform Configuration Files

resource "consul_config_entry_service_defaults" "app" { name = "app" protocol = "http" expose {} }

resource "consul_config_entry_service_defaults" "new-app" { name = "new-app" protocol = "http" expose {} }

Debug Output

Error: failed to delete 'new-app' config entry: Unexpected response code: 500 (discovery chain "app" uses inconsistent protocols; service "new-app" has "tcp" which is not "http") │ Error: failed to delete 'app' config entry: Unexpected response code: 500 (discovery chain "app" uses inconsistent protocols; service "new-app" has "http" which is not "tcp")

Expected Behavior It applies.

Actual Behavior It didn't apply. If I retry the 'terraform destroy' it works. Sometimes is the same when applying.

danihuerta commented 6 months ago

The solution was to include a DEPENDENCY in the service splitter configuration file so then it wait until the default settings were applied.