-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EdgeCacheService deployment fails with Error "defaultTtl must not be set when cacheMode is USE_ORIGIN_HEADERS or BYPASS_CACHE." #14903
Comments
Looking into this but receiving 404 error. b/287444737
|
@edwardmedia thanks for looking into this. Note that you need to do this within an mediacdn allowlisted project. |
This may be an unfortunate side effect of using Computed + Optional on the default_ttl field in the Terraform schema. Basically what I believe is happening is that default_ttl is set to a value during the initial apply, then when you remove default_ttl from your config the value is kept in state because this field is marked as Computed+Optional. When it creates the PATCH request to update the resource it uses the value in state. If you recreate the resource entirely it should work. Do you know if there is a zero value that signifies that default_ttl is unset? Sometimes this is a special string like "0" or the empty string "". Can you try those values out and see if that allows the update? |
@slevenick I tried both.. none of them worked out - setting default_ttl filed to zero value or 0 does not help removing this line. For now, the only workaround I found out is to first remove the the particular route rule and then add them back in a different location - i.e. adding them back at the very bottom of all route rules so that TF will treat them as new_addition and not override any existing route rule. Again this is not ideal and quite complex for customers who simply want to modify the cache_mode.. It would be great if we can explore some options to address the issue. |
It looks like defaultTtl can be set to zero or omitted, and those have different meanings. Additionally, it sounds from the API docs like there's a server-side default of Ideally, this would probably be an Optional only field (not O + C) with a client-side default value of |
BackendService and BackendBucket needed encoders to mitigate this- basically, the default values are fairly complex and the API pretty picky (incl. rejecting explicit zero values) |
any update for this breaking change and google api not found error?
|
If this can be handled with encoders I believe it should be possible to fix without a breaking change. |
@esmaeilram: I deployed correctly a I think that whatever the problem is with Reproduced on version:
|
I have a similar error. I cannot create an Edge service origin. This configuration (from the doc) always fails for me:
With this error:
I tried with 5.4.0 and 5.7.2 providers. I'm just trying to create the origin. I don't even have the service yet in my Terraform configuration file. I don't know how to resolve this. Any ideas? Thank you! |
removing 6.0.0 assignment since it does not have to wait for a major release according to #14903 (comment) |
I have the same error. I can't create the "google_network_services_edge_cache_origin" or the "google_network_services_edge_cache_service". This is my file for the origin: resource "google_network_services_edge_cache_origin" "test-origin" { Fails with this error: google_network_services_edge_cache_origin.test-origin: Creating... │ Error: Error creating EdgeCacheOrigin: googleapi: Error 404: Method not found. I even used the Google Cloud Shell option that the Terraform Provider has. https://registry.terraform.io/providers/hashicorp/google/6.6.0/docs/resources/network_services_edge_cache_origin I tried with 6.6.0, 6.2.0 and some other older providers, and tf configs seems correct. Any ideas on how to solve this? Thanks in advance! |
bumping up this issue.. I am seeing more and more folks running into the challenge
is there a way to tell terraform to completely remove this field using a special value? for example, can we do something like, if default_ttl = Null, then this field is deem to be removed? |
I'd missed this comment earlier, but I guess this explains the issue. |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Terraform v1.5.0
on darwin_arm64
Affected Resource(s)
google_network_services_edge_cache_service
Terraform Configuration Files
Debug Output
https://gist.github.com/CDN-guy/090e2b47848bd8b53b80c1d21b46f56b
Panic Output
Expected Behavior
Actual Behavior
Steps to Reproduce
terraform apply
cdn_policy
cache_mode
fromFORCE_CACHE_ALL
toBYPASS_CACHE
terraform apply
againImportant Factoids
References
b/309603268
The text was updated successfully, but these errors were encountered: