Kong / kong

🦍 The Cloud-Native API Gateway and AI Gateway.
https://konghq.com/install/#kong-community
Apache License 2.0
38.97k stars 4.78k forks source link

Error with rate-limiting plugin after 3.8.0.0 upgrade #13715

Open spirrello opened 3 days ago

spirrello commented 3 days ago

Is there an existing issue for this?

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

Anything else?

We're running Kong on AWS ECS Fargate.

ADD-SP commented 1 day ago

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

Internal ticket: KAG-5492