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

response-ratelimiting plugin appears broken in 0.5.3 #734

Closed
nricklin opened this issue Nov 21, 2015 · 4 comments
Closed

response-ratelimiting plugin appears broken in 0.5.3 #734

nricklin opened this issue Nov 21, 2015 · 4 comments
Labels

Comments

@nricklin
Copy link

I've got two instances of Kong running, 0.5.2 and 0.5.3, both spun up identically via the official AWS AMI.

The response-ratelimiting plugin works correctly in 0.5.2.

In 0.5.3, the X-RateLimit-Remaining header does not decrement (from the perspective from the API consumer) and the API is never limited.

Perhaps 0.5.3 requires different configuration than 0.5.2? Perhaps the cassandra connection is messed up and the plugin usage statefulness is not getting stored?

@subnetmarco
Copy link
Member

This is weird since we didn't change anything in the response rate-limiting plugin in 0.5.3: 0.5.2...0.5.3

Do the error logs show anything weird? Maybe Cassandra is not incrementing the counters, thus they always remain the same?

@nricklin
Copy link
Author

2015/11/21 22:28:59 [error] 2738#0: lua entry thread aborted: runtime error: ...share/lua/5.1/kong/plugins/response-ratelimiting/log.lua:7: bad argument #1 to 'log' (string, number, boolean, or nil expec
ted, got table)
stack traceback:
coroutine 0:
    [C]: in function 'log'
    ...share/lua/5.1/kong/plugins/response-ratelimiting/log.lua:7: in function 'increment'
    ...share/lua/5.1/kong/plugins/response-ratelimiting/log.lua:15: in function <...share/lua/5.1/kong/plugins/response-ratelimiting/log.lua:11>, context: ngx.timer, client: 24.9.78.84, server: 0.0.0
.0:443

Not sure what this means. In any case, I will check a fresh auto-deployed system for the same symptom tomorrow.

@thibaultcha
Copy link
Member

It appears that in log.lua line 7, the :increment function on the DAO returns an error. Unfortunately the error is not a string but a table (like all DAO errors), hence, the ngx.log function cannot log it. One needs to execute tostring(err) to output the content of the error in ngx.log. If this was corrected we could see the error properly in the logs.

@nricklin
Copy link
Author

I re-deployed the AMI and it's fine. Sorry for the false alarm!

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

No branches or pull requests

4 participants