openresty / openresty/lua-resty-dns

error: .../modules/lua-resty-dns-master/lib/resty/dns/resolver.lua:92: attempt to call local 'new_tab' (a table value)

Open
#34 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
338
Forks
107
Avg merge
1h 29m
Merged PRs (30d)
2

Description

hi, when I try to use this module it got me this error:
nginx: [error] init_by_lua error: .../modules/lua-resty-dns-master/lib/resty/dns/resolver.lua:92: attempt to call local 'new_tab' (a table value)
stack traceback:
.../modules/lua-resty-dns-master/lib/resty/dns/resolver.lua:92: in main chunk
[C]: in function 'require'
init_by_lua:2: in main chunk

the configuration that I use in nginx.conf is :
lua_package_path "/etc/nginx/modules/lua-resty-dns-master/lib/resty/dns/resolver.lua";

Is there something that I doing wrong? Thanks.

Update: is it need to use lua 5.2.3? because my current lua version is 5.1.4

Update: this issues is resolved by not using require "resty.dns.resolver" in init_by_lua_block. THanks

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lib/resty/dns/resolver.lua at line 92 and compare how it is loaded from nginx.conf through lua_package_path and init_by_lua_block. The issue is resolved when the configuration guidance explains the supported loading pattern and avoids the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, nginx
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.