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

unknown luaJIT command or jit.* modules not installed #9

Closed
lilien1010 opened this issue Sep 29, 2016 · 20 comments
Closed

unknown luaJIT command or jit.* modules not installed #9

lilien1010 opened this issue Sep 29, 2016 · 20 comments

Comments

@lilien1010
Copy link

/usr/local/openresty/luajit/bin/luajit-2.1.0-beta2: unknown luaJIT command or jit.* modules not installed

openresty-1.11.2.1 installed
lastest opm installed
then I cp opm/bin/opm /usr/local/openresty/bin
when I set dist.ini down and run opm build
it shows error like this
found license: BSD 3-Clause "New" or "Revised" license. derived main_module file resty/s3uploader.lua /usr/local/openresty/luajit/bin/luajit-2.1.0-beta2: unknown luaJIT command or jit.* modules not installed ERROR: failed to run command

@agentzh
Copy link
Member

agentzh commented Sep 29, 2016

Looks like your OpenResty installation directory tree is incomplete or corrupted?

@pintsized
Copy link
Contributor

I have the same problem, also with 1.11.2.1.

[jhurst@sl6 lua-resty-http]$ opm build
found license: BSD 2-Clause "Simplified" or "FreeBSD" license.
extracted verson number 0.09 from main_module file lib/resty/http.lua.
/usr/local/openresty/luajit/bin/luajit-2.1.0-beta2: unknown luaJIT command or jit.* modules not installed
ERROR: failed to run command

@pintsized
Copy link
Contributor

Appear to be the -b flag passed to luajit? My OpenResty was configured with the default options.

@agentzh
Copy link
Member

agentzh commented Sep 29, 2016

@pintsized Could you try running the following commands on your side?

/usr/local/openresty/luajit/bin/luajit-2.1.0-beta2 -bl lib/resty/http.lua /dev/null

/usr/local/openresty/luajit/bin/luajit-2.1.0-beta2 -b lib/resty/http.lua /dev/null

@agentzh
Copy link
Member

agentzh commented Sep 29, 2016

@lilien1010 @pintsized Please try out the latest opm tool in the code repository. Just added more info to the error message and also switched to luajit -b instead of luajit -bl. Please let me know your output if it still breaks.

@pintsized
Copy link
Contributor

@agentzh For me, using the -b flag at all always shows that error:

[jhurst@sl6 lua-resty-http]$ /usr/local/openresty/luajit/bin/luajit-2.1.0-beta2 -bl lib/resty/http.lua /dev/null
/usr/local/openresty/luajit/bin/luajit-2.1.0-beta2: unknown luaJIT command or jit.* modules not installed

[jhurst@sl6 lua-resty-http]$ /usr/local/openresty/luajit/bin/luajit-2.1.0-beta2 -b lib/resty/http.lua /dev/null
/usr/local/openresty/luajit/bin/luajit-2.1.0-beta2: unknown luaJIT command or jit.* modules not installed

I just tried out the latest version - slightly different output but the same error:

[jhurst@sl6 lua-resty-http]$ opm build
found license: BSD 2-Clause "Simplified" or "FreeBSD" license.
extracted verson number 0.09 from main_module file lib/resty/http.lua.
/usr/local/openresty/luajit/bin/luajit-2.1.0-beta2: unknown luaJIT command or jit.* modules not installed
ERROR: failed to run command     _VERSION = '0.09',

Anything else I can do to help?

@agentzh
Copy link
Member

agentzh commented Sep 29, 2016

@pintsized Your latest output is very helpful. Please git pull and try out the latest version of opm. Thanks!

@agentzh
Copy link
Member

agentzh commented Sep 29, 2016

@pintsized BTW, what version of perl are you using? Will you show the output of the command perl -v on your side? Thanks!

@pintsized
Copy link
Contributor

[jhurst@sl6 lua-resty-http]$ perl -v

This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi

@pintsized
Copy link
Contributor

Just pulled - slightly different again:

[jhurst@sl6 lua-resty-http]$ /usr/local/openresty/bin/opm build
found license: BSD 2-Clause "Simplified" or "FreeBSD" license.
extracted verson number 0.09 from main_module file lib/resty/http.lua.
/usr/local/openresty/luajit/bin/luajit-2.1.0-beta2: unknown luaJIT command or jit.* modules not installed
ERROR: failed to run command /usr/local/openresty/luajit/bin/luajit-2.1.0-beta2 -b 'lib/resty/http.lua' /dev/null

@agentzh
Copy link
Member

agentzh commented Sep 29, 2016

@pintsized Okay, it seems that your LuaJIT in the OpenResty installation tree fails to load the standard LuaJIT module, jit.bcsave. Please try the following command and provide the output:

strace /usr/local/openresty/luajit/bin/luajit-2.1.0-beta2 -b lib/resty/http.lua /dev/null 2>&1|grep -i jit

On my side (Fedora Linux x86_64), the output looks like this, which is the corrected behavior:

execve("/usr/local/openresty/luajit/bin/luajit-2.1.0-beta2", ["/usr/local/openresty/luajit/bin/"..., "-b", "lib/resty/http.lua", "/dev/null"], [/* 70 vars */]) = 0
open("./jit/bcsave.lua", O_RDONLY)      = -1 ENOENT (No such file or directory)
open("/usr/local/openresty/luajit/share/luajit-2.1.0-beta2/jit/bcsave.lua", O_RDONLY) = 3
open("/usr/local/openresty/luajit/share/luajit-2.1.0-beta2/jit/bcsave.lua", O_RDONLY) = 3

Wondering if your OpenResty/LuaJIT installation just does not have the jit/bcsave.lua file or your system account just does not have enough permission to read it.

@agentzh
Copy link
Member

agentzh commented Sep 29, 2016

@pintsized BTW, what Linux distribution are you in? Will you provide as much details as possible? Thanks!

@pintsized
Copy link
Contributor

pintsized commented Sep 29, 2016

[jhurst@sl6 lua-resty-http]$ strace /usr/local/openresty/luajit/bin/luajit-2.1.0-beta2 -b lib/resty/http.lua /dev/null 2>&1|grep -i jit
execve("/usr/local/openresty/luajit/bin/luajit-2.1.0-beta2", ["/usr/local/openresty/luajit/bin/"..., "-b", "lib/resty/http.lua", "/dev/null"], [/* 47 vars */]) = 0
open("/usr/share/lua/5.1/jit/bcsave.lua", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/lua/5.1/jit/bcsave.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/lua/5.1/jit.so", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "/usr/local/openresty/luajit/bin/"..., 50/usr/local/openresty/luajit/bin/luajit-2.1.0-beta2) = 50
write(2, "unknown luaJIT command or jit.* "..., 53unknown luaJIT command or jit.* modules not installed) = 53

Seems it's looking for it in the wrong place for some reason? /usr/share/lua/5.1/jit doesn't exist. bcsave.lua does exist in the OpenResty installation....

[jhurst@sl6 lua-resty-http]$ ls -l /usr/local/openresty/luajit/share/luajit-2.1.0-beta2/jit
total 180
-rw-r--r--. 1 root root  5620 Sep 20 14:47 bc.lua
-rw-r--r--. 1 root root 18267 Sep 20 14:47 bcsave.lua
-rw-r--r--. 1 root root 19363 Sep 20 14:47 dis_arm.lua
-rw-r--r--. 1 root root   715 Sep 20 14:47 dis_mipsel.lua
-rw-r--r--. 1 root root 13221 Sep 20 14:47 dis_mips.lua
-rw-r--r--. 1 root root 20318 Sep 20 14:47 dis_ppc.lua
-rw-r--r--. 1 root root   712 Sep 20 14:47 dis_x64.lua
-rw-r--r--. 1 root root 32832 Sep 20 14:47 dis_x86.lua
-rw-r--r--. 1 root root 19896 Sep 20 14:47 dump.lua
-rw-r--r--. 1 root root  9092 Sep 20 14:47 p.lua
-rw-r--r--. 1 root root  5755 Sep 20 14:47 v.lua
-rw-r--r--. 1 root root  7356 Sep 20 14:47 vmdef.lua
-rw-r--r--. 1 root root  1002 Sep 20 14:47 zone.lua

This is a Scientific Linux 6 x86_64 environment. I compiled OpenResty with a plain ./configure; gmake; sudo gmake install.

Could LUA_PATH be relevant at all?

[jhurst@sl6 lua-resty-http]$ echo $LUA_PATH
/usr/share/lua/5.1/?.lua

@agentzh
Copy link
Member

agentzh commented Sep 29, 2016

Oh yeah, your global LUA_PATH environment setting hides all the standard LuaJIT modules.

@agentzh
Copy link
Member

agentzh commented Sep 29, 2016

@pintsized I'll explicitly clear any LUA_PATH or LUA_CPATH environments in the opm tool then. Such things are painful to debug.

@pintsized
Copy link
Contributor

@agentzh Ah, yep makes sense!

agentzh added a commit that referenced this issue Sep 29, 2016
…om hiding standard luajit modules. thanks Lien and James Hurst for the report in #9.
@agentzh
Copy link
Member

agentzh commented Sep 29, 2016

Okay, please try the latest opm.

@agentzh agentzh closed this as completed Sep 29, 2016
@pintsized
Copy link
Contributor

@agentzh To confirm, I fixed my path and all is now working...

[jhurst@sl6 lua-resty-http]$ echo $LUA_PATH
/usr/share/lua/5.1/?.lua;;
[jhurst@sl6 lua-resty-http]$ opm build
found license: BSD 2-Clause "Simplified" or "FreeBSD" license.
extracted verson number 0.09 from main_module file lib/resty/http.lua.
lua-resty-http-0.09/
lua-resty-http-0.09/README.md
lua-resty-http-0.09/dist.ini
lua-resty-http-0.09/lib/
lua-resty-http-0.09/lib/resty/
lua-resty-http-0.09/lib/resty/http.lua
lua-resty-http-0.09/lib/resty/http_headers.lua

Will update and test against both this and the old LUA_PATH for good measure.

@pintsized
Copy link
Contributor

@agentzh Confirmed, it works now regardless of LUA_PATH. Thanks! I'll start uploading some modules tomorrow :)

@agentzh
Copy link
Member

agentzh commented Sep 29, 2016

@pintsized Cool, thanks for your patience!

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

3 participants