[Summary]openresty current limit count.lua:53:attempt to call method ' expire ' (a nil value) error troubleshooting

Source: Internet
Author: User
Tags lua

Recently in the study of Openresty 1.13.6.1 Version current limit scheme, refer to this document: https://github.com/openresty/lua-resty-limit-traffic/blob/master/lib/resty/ Limit/count.md wrote a time window to call the total number of current limit demo, but the test, encountered the following problems:


2018/03/20 12:38:05 [ERROR] 33074#814554: * LUA entry thread Aborted:runtime error: ... l/cellar/openresty/1.13.6.1/lual Ib/resty/limit/count.lua:53:attempt to call method ' expire ' (a nil value)

Stack Traceback:

Coroutine 0:

... l/cellar/openresty/1.13.6.1/lualib/resty/limit/count.lua:in function ' incoming '

conf/limit_frequency.lua:18:in function ' incoming '

... Ideaprojects/luaapp/work/conf/access_limit_frequency.lua:8: in function < Ideaprojects/luaapp/work/conf/access_limit_frequency.lua:1>, client:10.202.97.23, server:, Request: "GET/ Limitfrequency http/1.1 ", Host:" 10.202.97.23:8080 "


The direct cause of the error is: Openresty/1.13.6.1/lualib/resty/limit/count.lua:53:attempt to call method ' expire ' (a nil value)

At that time the mistake Google A, did not find any solution. The error was then sent to the Google discussion group, and Https://groups.google.com/forum/#!forum/openresty soon responded. It turns out I didn't add resty.core dependencies within the http{} configuration block:

Init_by_lua_block {

Require "Resty.core"

}


In fact, the reference document has a description of the dependent Resty.core, and the original demo also has configuration init_by_lua_block ...

Blame yourself too careless, the original document is not read carefully.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.