Skip to content
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

fix(rate_limiter): lookup new ID before actioning a deletion #715

Merged
merged 1 commit into from
Jun 22, 2023

Conversation

rayzorinc
Copy link
Contributor

Issue

when deleting an existing rate_limiter, we encounter a "422 Unprocessable Entity" error.

Terraform will perform the following actions:

  #fastly_service_vcl.service will be updated in-place
  ~ resource "fastly_service_vcl" "service" {
      ~ cloned_version     = 99 -> (known after apply)
        id                 = "XXXX"
        name               = "test"
        # (11 unchanged attributes hidden)



      - rate_limiter {
          - action               = "response" -> null
          - client_key           = "client.ip,req.http.User-Agent" -> null
          - feature_revision     = 1 -> null
          - http_methods         = "GET,PUT,TRACE,POST,HEAD,DELETE,PATCH,OPTIONS" -> null
          - name                 = "rate limit" -> null
          - penalty_box_duration = 2 -> null
          - ratelimiter_id       = "33Fp31Wo4lUKNLmw7g9H2s" -> null
          - rps_limit            = 100 -> null
          - window_size          = 10 -> null

          - response {
              - content      = <<-EOT
                    <html>
                    	<head>
                    		<title>Too Many Requests</title>
                    	</head>
                    	<body>
                    		<p>Too Many Requests</p>
                    	</body>
                    </html>
                EOT -> null
              - content_type = "text/html" -> null
              - status       = 429 -> null
            }
        }



        # (25 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.


Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

fastly_service_vcl.service: Modifying... [id=XXX]

│ Error: Plugin did not respond

│   with fastly_service_vcl.service,
│   on fastly_service/main.tf line 204, in resource "fastly_service_vcl" "service":
│  204: resource "fastly_service_vcl" "service" {

│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details

This is because when we clone a service, it creates a new ratelimit ID associated with the clone. The fix is try to find the new ratelimit id from the clone and remove it.

@Integralist Integralist changed the title (rate_limiter): delete ratelimit bug fix(rate_limiter): lookup new ID before actioning a deletion Jun 22, 2023
… "422 Unprocessable Entity" error.

This is because when we clone a service, it creates a new ratelimit ID associated with the clone. The fix is try to find the new ratelimit id from the clone and remove it.
Copy link
Collaborator

@Integralist Integralist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you @rayzorinc !

@Integralist Integralist merged commit f180aa9 into fastly:main Jun 22, 2023
@rayzorinc rayzorinc deleted the rw/ratelimit-bug branch June 22, 2023 18:31
Integralist pushed a commit that referenced this pull request Jun 22, 2023
This is because when we clone a service, it creates a new ratelimit ID associated with the clone. The fix is try to find the new ratelimit id from the clone and remove it.
Integralist added a commit that referenced this pull request Jun 22, 2023
* fix(s3): add missing FileMaxBytes value to test file

* v5.2.0

fix(rate_limiter): lookup new ID before actioning a deletion (#715)

This is because when we clone a service, it creates a new ratelimit ID associated with the clone. The fix is try to find the new ratelimit id from the clone and remove it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants