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

An unexpected error occurred for response ratelimiting plugin #8314

Closed
1 task done
arunbabucode opened this issue Jan 20, 2022 · 5 comments · Fixed by #8483
Closed
1 task done

An unexpected error occurred for response ratelimiting plugin #8314

arunbabucode opened this issue Jan 20, 2022 · 5 comments · Fixed by #8483

Comments

@arunbabucode
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Kong version ($ kong version)

2.4.1

Current Behavior

I have activated response rate-limiting for a consumer. When I am accessing the endpoint, it throws an error.

Message:
{ "message": "An unexpected error occurred" }

The corresponding message is on the error log.

[kong] init.lua:286 [response-ratelimiting] ...re/lua/5.1/kong/plugins/response-ratelimiting/access.lua:53: attempt to perform arithmetic on local 'lv' (a userdata value)

my plugin config
{ "name": "response-ratelimiting", "service": null, "enabled": true, "route": null, "id": "127c0436-67e3-43d3-9def-a39e80a4549e", "consumer": { "id": "05d958f3-a561-4501-8a12-27c6f81c5e48" }, "config": { "redis_timeout": 2000, "redis_database": 0, "redis_host": null, "redis_port": 6379, "limits": { "test": { "year": null, "second": null, "minute": null, "hour": 10, "day": null, "month": null } }, "limit_by": "consumer", "redis_password": null, "policy": "cluster", "hide_client_headers": false, "fault_tolerant": true, "header_name": "X-Kong-Limit", "block_on_first_violation": false }, "protocols": [ "grpc", "grpcs", "http", "https" ], "created_at": 1642669998, "tags": null }

Response headers from service:
X-Kong-Limit: test=1

Expected Behavior

Should work like the default rate-limiting plugin.

Steps To Reproduce

The config used for creating is given above

Anything else?

No response

@arunbabucode
Copy link
Author

Tried to upgrade to 2.5 and 2.6, the issue persists in both versions

@vineelyalamarthy
Copy link

@bungle Is this something that I can take up. Would love to volunteer.

@ADD-SP
Copy link
Contributor

ADD-SP commented Mar 1, 2022

Hi @arunbabucode ! Thanks for your report.

I have not reproduced this issue on 2.6.0, could you please provide more information? Such as the entire declarative configuration.

@ADD-SP ADD-SP added the pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... label Mar 1, 2022
@bungle
Copy link
Member

bungle commented Mar 1, 2022

@vineelyalamarthy, by all means, please go ahead. a userdata value feels like something may be set to ngx.null in some cases. @ADD-SP, is it possible that we ever get null with any of the supported strategies/limits?

@ADD-SP ADD-SP removed the pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... label Mar 2, 2022
@leeran88
Copy link

Hi
In which version this was resolves?
We experience it on 2.7.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants