Closed
Description
The easiest way to reproduce "weirdness":
init_by_lua 'print({})';
Will produce:
nginx: [error] init_by_lua error: init_by_lua:1: bad argument #1 to 'print' (string, number, boolean, or nil expected, got table)
stack traceback:
[C]: in function 'print'
init_by_lua:1: in main chunk
Strange because this works outside of Nginx fine, and even seems to work in content_by_lua.
Specifically in my case, I have similar weirdness:
local upvalues = self:readObject()
for index,upvalue in ipairs(upvalues) do
if typeidx == LEGACY_TYPE_RECUR_FUNCTION then
debug.setupvalue(func, index, upvalue)
elseif upvalue.name == '_ENV' then
debug.setupvalue(func, index, _ENV)
else
debug.setupvalue(func, index, upvalue.value)
end
end
Results in:
nginx: [error] init_by_lua_file error: ...g/Development/torch/install/share/lua/5.1/torch/File.lua:241: bad argument #1 to 'ipairs' (table expected, got nil)
stack traceback:
[C]: in function 'ipairs'
Again, code works fine outside of init_by_lua*
Metadata
Metadata
Assignees
Labels
No labels