luarocks / luarocks-site

LuaRocks website and module host
http://luarocks.org
175 stars 38 forks source link

Lapis Error #119

Closed yy1993 closed 6 years ago

yy1993 commented 6 years ago

Hi, I could run lapis server after installed all independencies and lua modules. However, any request for the home page will get 500 error code. Have no idea what happens as found no similar issues.

error info: [error] 10131#0: *2 lua entry thread aborted: runtime error: /usr/local/share/lua/5.1/lapis/request.lua:93: Don't know how to write: (boolean) false

stack traceback: coroutine 0: [C]: in function 'error' /usr/local/share/lua/5.1/lapis/request.lua:93: in function 'write' /usr/local/share/lua/5.1/lapis/application.lua:141: in function 'render_error_request' /usr/local/share/lua/5.1/lapis/application.lua:173: in function 'dispatch' /usr/local/share/lua/5.1/lapis/nginx.lua:214: in function 'serve' content_by_lua(nginx.conf.compiled:25):1: in function <content_by_lua(nginx.conf.compiled:25):1>, client: 10.32.241.77, server: , request: "GET / HTTP/1.1", host: "10.128.141.218:8080"

version info: lapis: 1.5.1-1, as version 1.6 depends on luaossl, which conflicts with openresty. openresty: 1.11.2.4 nodejs: 8.3.0 Others are latest version.

leafo commented 6 years ago

That error message means that a boolean value was passed to write, instead of a table of options. I'll have to take a deeper look to see where this may be happening. In the meantime, how does luaossl conflict with openresty?

yy1993 commented 6 years ago

I tried to print some information in application.lua. It seems like req is nil table. As a rookie to lua, I'm not sure about that, because I found req is a lazy lable about ngx_req.

For the conflict, it is similar as lua-cjson. When I run this: $ sudo luarocks install luaossl

The output: Warning: falling back to curl - install luasec to get native HTTPS support Installing https://luarocks.org/luaossl-20161214-0.src.rock gcc -O2 -fPIC -I/usr/local/openresty/luajit/include/luajit-2.1 -c src/openssl.c -o src/openssl.o -D_REENTRANT -D_THREAD_SAFE -D_GNU_SOURCE -DLUA_COMPAT_APIINTCASTS -I/usr/include -I/usr/include In file included from src/openssl.c:78:0: src/compat52.h:57:13: error: static declaration of ‘luaL_setfuncs’ follows non-static declaration static void luaL_setfuncs(lua_State L, const luaL_Reg l, int nup) { ^ In file included from src/openssl.c:75:0: /usr/local/openresty/luajit/include/luajit-2.1/lauxlib.h:88:18: note: previous declaration of ‘luaL_setfuncs’ was here LUALIB_API void (luaL_setfuncs) (lua_State L, const luaL_Reg l, int nup); ^ In file included from src/openssl.c:78:0: src/compat52.h:71:0: warning: "luaL_newlibtable" redefined [enabled by default]

define luaL_newlibtable(L, l) \

^ In file included from src/openssl.c:75:0: /usr/local/openresty/luajit/include/luajit-2.1/lauxlib.h:121:0: note: this is the location of the previous definition

define luaL_newlibtable(L, l) \

^ In file included from src/openssl.c:78:0: src/compat52.h:74:0: warning: "luaL_newlib" redefined [enabled by default]

define luaL_newlib(L, l) \

^ In file included from src/openssl.c:75:0: /usr/local/openresty/luajit/include/luajit-2.1/lauxlib.h:123:0: note: this is the location of the previous definition

define luaL_newlib(L, l) (luaL_newlibtable(L, l), luaL_setfuncs(L, l, 0))

^

Error: Build error: Failed compiling object src/openssl.o

yy1993 commented 6 years ago

I've also tried luarocks-site(v2016.9.30), openresty-1.9.15.1, and lapis 1.6.0-1 on Ubuntu 14.04. The good news is I do not need to manually handle lua-cjson compile conflicts, as well as luaossl; while still the same error occurs when run lapis server.

BTW, would luabitop lead to the error? As its state is so different from other rocks. $ sudo luarocks install luabitop Error: Rock luabitop 2.1.0beta2-1 was found but it is provided by VM or 'rocks_provided' in the config file.

yy1993 commented 6 years ago

I guess the issue roots in some dependencies like tup, sassc, etc. As I can run lapis example with openresty-1.9.15.1, and lapis 1.6.0-1. Could you list the version you use?

leafo commented 6 years ago

On my development machine I have openresty 1.11.2.1 and lapis 1.6.0-1, I also have lua 5.1 installed through my package manager, and luarocks builds and installs modules like that, then openresty loads them

zhongweikang commented 4 years ago

Hello, I have the same problem, how did you solve it in the end? @yy1993