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

Error with rate-limiting plugin after 3.8.0.0 upgrade #13715

Closed
1 task done
spirrello opened this issue Sep 27, 2024 · 1 comment · Fixed by #13722
Closed
1 task done

Error with rate-limiting plugin after 3.8.0.0 upgrade #13715

spirrello opened this issue Sep 27, 2024 · 1 comment · Fixed by #13722
Labels

Comments

@spirrello
Copy link

spirrello commented Sep 27, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Kong version ($ kong version)

Kong 3.8.0.0

Current Behavior

When the rate-limiting plugin is in use for a service, we are seeing the following error. It also appears that Kong is returning a HTTP 500s because of this. We do see requests succeed (HTTP 200s) until the rate-limiting plugin throttles traffic and that's when we see HTTP 500s.

"2024/09/27 02:32:25 [error] 2567#0: *63070 [kong] init.lua:427 [rate-limiting] ./rate-limiting/handler.lua:212: arg #3 `value` for function `store_response_header` must be a string or a number, got nil, client: x.x.x.x, server: kong, request: \"POST /som/path HTTP/1.1\", host: \"some.host.com\", request_id: \"asdfasdfdsf\""

Expected Behavior

When using the rate-limiting plugin I expect no errors in the logs and when the rate-limiting plugin is in affect Kong should respond with HTTP 429 instead.

Steps To Reproduce

  1. Using our preprod environment.
  2. Using this configuration
_format_version: "3.0"
_info:
  select_tags:
    - my-app
_plugin_configs:
  jwt-config:
    claims_to_verify:
      - exp
    key_claim_name: sub

  rate-limiting-my-app-config:
    second: null
    minute: 60
    hour: null
    day: null
    month: null
    year: null
    fault_tolerant: true
    header_name: null
    hide_client_headers: true
    limit_by: ip
    policy: local

- connect_timeout: 60000
  read_timeout: 60000
  write_timeout: 60000
  retries: 5
 
  name: my-app
  hosts:
    - some.host.com
  methods:
    - GET
    - OPTIONS
  paths:
    - ~/some/path
  preserve_host: false
  protocols:
    - https
  regex_priority: 0
  tags:
    - my-app
  https_redirect_status_code: 426
  plugins:
    - name: rate-limiting
      _config: rate-limiting-my-app-config
      enabled: true
      protocols:
        - https
      tags:
        - my-app

Anything else?

We're running Kong on AWS ECS Fargate.

@ADD-SP
Copy link
Contributor

ADD-SP commented Sep 29, 2024

@spirrello Thanks for your report, I think it is a bug. We should fix it.

Internal ticket: KAG-5492

@ADD-SP ADD-SP added the bug label Sep 29, 2024
@ADD-SP ADD-SP closed this as completed in cf403a7 Oct 8, 2024
github-actions bot pushed a commit that referenced this issue Oct 16, 2024
…headers` is `true` (#13722)

Fix #13715; we should not set the response header if `conf.hide_client_headers` is `true`.

(cherry picked from commit cf403a7)
ADD-SP added a commit that referenced this issue Oct 16, 2024
…headers` is `true` (#13759)

Fix #13715; we should not set the response header if `conf.hide_client_headers` is `true`.

Backport #13722

Co-authored-by: Qi <[email protected]>
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 a pull request may close this issue.

2 participants