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

module 'lua_pack' not found #158

Closed
chaserb opened this issue Feb 2, 2023 · 4 comments · Fixed by #169
Closed

module 'lua_pack' not found #158

chaserb opened this issue Feb 2, 2023 · 4 comments · Fixed by #169

Comments

@chaserb
Copy link

chaserb commented Feb 2, 2023

Discovered the following in /usr/loca/openresty/nginx/logs/error.log after newly launched servers started throwing 500 errors in their health checks:

2023/02/02 20:47:28 [error] 14907#14907: *1 lua entry thread aborted: runtime error: /usr/local/openresty/site/lualib/resty/session/utils.lua:95: module 'lua_pack' not found:
	no field package.preload['lua_pack']
	no file '/usr/local/openresty/site/lualib/lua_pack.ljbc'
	no file '/usr/local/openresty/site/lualib/lua_pack/init.ljbc'
	no file '/usr/local/openresty/lualib/lua_pack.ljbc'
	no file '/usr/local/openresty/lualib/lua_pack/init.ljbc'
	no file '/usr/local/openresty/site/lualib/lua_pack.lua'
	no file '/usr/local/openresty/site/lualib/lua_pack/init.lua'
	no file '/usr/local/openresty/lualib/lua_pack.lua'
	no file '/usr/local/openresty/lualib/lua_pack/init.lua'
	no file './lua_pack.lua'
	no file '/usr/local/openresty/luajit/share/luajit-2.1.0-beta3/lua_pack.lua'
	no file '/usr/local/share/lua/5.1/lua_pack.lua'
	no file '/usr/local/share/lua/5.1/lua_pack/init.lua'
	no file '/usr/local/openresty/luajit/share/lua/5.1/lua_pack.lua'
	no file '/usr/local/openresty/luajit/share/lua/5.1/lua_pack/init.lua'
	no file '/usr/local/openresty/site/lualib/lua_pack.so'
	no file '/usr/local/openresty/lualib/lua_pack.so'
	no file './lua_pack.so'
	no file '/usr/local/lib/lua/5.1/lua_pack.so'
	no file '/usr/local/openresty/luajit/lib/lua/5.1/lua_pack.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
coroutine 0:
	[C]: in function 'require'
	access_by_lua(nginx.conf:119):41: in main chunk, client: 127.0.0.1, server: myhost.com, request: "GET / HTTP/1.1", host: "localhost"

These are the packages I've installed on the servers (Debian 11):

./opm install ledgetech/lua-resty-http
./opm install bungle/lua-resty-session
./opm install zmartzone/lua-resty-openidc

...producing:

admin@myhost:~$ opm list
bungle/lua-resty-session                                     4.0.0
jkeys089/lua-resty-hmac                                      0.06
zmartzone/lua-resty-openidc                                  1.7.5
cdbattags/lua-resty-jwt                                      0.2.0
ledgetech/lua-resty-http                                     0.16.1
openresty/lua-resty-string                                   0.11

Any suggestions on how I should provide the lua_pack dependency?

@bungle
Copy link
Owner

bungle commented Feb 3, 2023

luarocks install lua_pack

See also:
https://github.com/Kong/lua-pack

manual install is possible too.

@GordonMcKinney
Copy link

Same issue. OpenResty explicitly rejects the use of luarocks for adding packages. I don't seen an opm for lua-pack.

@GordonMcKinney
Copy link

I have to apply the following workaround to solve my production issue:

opm install bungle/lua-resty-session=3.10

@bungle
Copy link
Owner

bungle commented Mar 20, 2023

openresty does not explicitly reject packages installed with luarocks. I may look in a future of doing binary packing without lua_pack, but for now it is a dependency.

bungle added a commit that referenced this issue May 29, 2023
### Summary

Implements binary packing and unpacking of numbers in plain Lua.

### Issues Resolved

Fix #158
bungle added a commit that referenced this issue Jun 5, 2023
### Summary

Implements binary packing and unpacking of numbers in plain Lua.

### Issues Resolved

Fix #158
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

Successfully merging a pull request may close this issue.

3 participants