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

nginx: [error] lua_load_resty_core failed to load the resty.core module #1533

Closed
wangkepermit opened this issue May 24, 2019 · 20 comments
Closed

Comments

@wangkepermit
Copy link

Thanks for your help!

base info:

  nginx:1.10.1
  luagit:2.1
  ngx_devel_kit:0.2.19
  lua-nginx-module:0.10.15

configure command for nginx:

./configure --prefix=/opt/nginx-1.10.1 --with-ld-opt='-ljemalloc' --with-ld-opt="-Wl,-rpath,/usr/local/luajit/lib" --add-module=/usr/local/src/freeapis-nginx/lua-nginx-module-0.10.2 --add-module=/usr/local/src/freeapis-nginx/ngx_devel_kit-0.2.19

error messages in nginx startup:

nginx: [error] lua_load_resty_core failed to load the resty.core module from https://github.com/openresty/lua-resty-core; ensure you are using an OpenResty release from https://openresty.org/en/download.html (rc: 2, reason: module 'resty.core' not found:
no field package.preload['resty.core']
no file './resty/core.lua'
no file '/usr/local/luajit/share/luajit-2.1.0-beta3/resty/core.lua'
no file '/usr/local/share/lua/5.1/resty/core.lua'
no file '/usr/local/share/lua/5.1/resty/core/init.lua'
no file '/usr/local/luajit/share/lua/5.1/resty/core.lua'
no file '/usr/local/luajit/share/lua/5.1/resty/core/init.lua'
no file './resty/core.so'
no file '/usr/local/lib/lua/5.1/resty/core.so'
no file '/usr/local/luajit/lib/lua/5.1/resty/core.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file './resty.so'
no file '/usr/local/lib/lua/5.1/resty.so'
no file '/usr/local/luajit/lib/lua/5.1/resty.so'
no file '/usr/local/lib/lua/5.1/loadall.so')

@wangkepermit
Copy link
Author

my system is CentOS7:Linux localhost.localdomain 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

@spacewander
Copy link
Member

See #1501 (comment).
You need to put lua-resty-core in your package.path.

@wangkepermit
Copy link
Author

See #1501 (comment).
You need to put lua-resty-core in your package.path.

thank you ,i try

@Firegarden
Copy link

How do you actually do this? I am having same problem.

@aftabnaveed
Copy link

aftabnaveed commented Aug 20, 2019

@wangkepermit

You need to put lua-resty-core in your package.path.

I am using the official docker container, isn't that supposed to be in the path already?

@Firegarden
Copy link

Firegarden commented Aug 22, 2019

@wangkepermit

You need to put lua-resty-core in your package.path.

I am using the official docker container, isn't that supposed to be in the path already?

Example: sudo nano /etc/nginx/nginx.conf

lua_package_path "/usr/local/lib/lua/?.lua;;";

@a575606
Copy link

a575606 commented Sep 4, 2019

@wangkepermit

You need to put lua-resty-core in your package.path.

I am using the official docker container, isn't that supposed to be in the path already?

my question exactly

joshzarrabi added a commit to cloudfoundry/nginx-buildpack that referenced this issue Jul 31, 2020
see openresty/lua-nginx-module#1533

Signed-off-by: Forest Eckhardt <feckhardt@vmware.com>
@yjfvictor
Copy link

See #1501 (comment).
You need to put lua-resty-core in your package.path.

Where is package.path?

@abhipsamishra0110
Copy link

abhipsamishra0110 commented Sep 17, 2021

Any fixes available for this please? I have a similar issue on MAC M1, while running on docker. nginx shows as starting up successfully but the logs show PANIC! How to include in package.path for docker? Any way to add in nginx config file ?

@Firegarden
Copy link

Did you add the path to your nginx config?
lua_package_path "/usr/local/lib/lua/?.lua;;";

@abhipsamishra0110
Copy link

abhipsamishra0110 commented Sep 20, 2021

Indeed I have, but I get this error consistently when nginx starts up.

PANIC: unprotected error in call to Lua API (bad light userdata pointer),

am using LuaJIT Version 2.1.0-beta3 and openresty-lua-nginx-module of version 0.10.15. Ngnix alpine version of 1.14.2.

Badly stuck on this, tried all kinds of workarounds, like adding lua package path and upgrading libraries, but nothing works :(

Please can anyone help resolve. :( :(

@Firegarden
Copy link

Firegarden commented Sep 21, 2021

Please clarify if you are using the latest openresty version of LuaJIT v2.1-20210510?

If you are using openresty-lua-nginx-module then you need to use the openresty version of lua jit

@YummyTastyCode
Copy link

YummyTastyCode commented Oct 12, 2021

I've spent a whole day looking for a solution.
Just clone current project lua-resty-core

and setup nginx.conf file regarding the documentation.

@Firegarden
Copy link

I am now having the same problem. I will try clone current project from lua-resty-core

@zhuizhuhaomeng
Copy link
Contributor

you should add the detail info about how you build your openresty/nginx

@Firegarden
Copy link

Turns out I was using an older version of the code and by cloning the current project I was able to build fine on Ubuntu 20. Sorry for the confusion.

@nilyang
Copy link

nilyang commented Aug 3, 2023

Did you add the path to your nginx config? lua_package_path "/usr/local/lib/lua/?.lua;;";

I'v solved it by add it to the path's last:

lua_package_path "/etc/nginx/library/?.lua;;/usr/local/share/lua/5.1/?.lua;;/usr/local/lib/lua/?.lua;;";

@HaSaKiYasuooo
Copy link

@wangkepermit

您需要将 lua-resty-core 放入 package.path 中。

我正在使用官方的 docker 容器,它不是应该已经在路径中了吗?

示例: sudo nano /etc/nginx/nginx.conf

lua_package_path "/usr/local/lib/lua/?.lua;;";

amazing solution!!

@NoWait126
Copy link

Is there a way to custom the path, I have install openresty in /home/mydir/usr/local/ not /usr/local, This directory/home/mydir/usr/local/usr/local/openresty/lualib/resty/core exists correctly . And I add lua_package_path "/home/mydir/usr/local/share/lua/5.1?.lua;;/home/mydir/usr/local/lib/lua/?.lua;;"; , but it still does not work, it is the same error.

@HaSaKiYasuooo
Copy link

Is there a way to custom the path, I have install openresty in /home/mydir/usr/local/ not /usr/local, This directory/home/mydir/usr/local/usr/local/openresty/lualib/resty/core exists correctly . And I add lua_package_path "/home/mydir/usr/local/share/lua/5.1?.lua;;/home/mydir/usr/local/lib/lua/?.lua;;"; , but it still does not work, it is the same error.

Maybe you should check out the errors,Is different from the before.

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

No branches or pull requests