Comments (14)
We cannot reproduce this on our side. Could you please provide more information regarding your OS name, OS version, nginx version, ngx_lua's version, luarocks' version, and etc. Thank you.
from lua-nginx-module.
I can reproduce this in my side.
If change the test.lua to:
--test.lua
require("XXX") ---not local xxx = require("XXX")
that will work fine.
luajit2.0-bata6
ubuntu 10.04
nginx 8.54
ngx_lua 0.16rc3
from lua-nginx-module.
我再用中文说一次吧。
就是当调用一个module的时候
使用
local mdl = require("Mdl") 就会出错,返回200,但是是空白。
直接require("Mdl") 的话。就可以调用到 Mdl这个模块
所以顺便请教一下,如何进行调试啊?错误信息既不再页面显示,也不再nginx的error log里。
我现在只能模拟ngx的变量,然后用命令行 luajit filename.lua 来debug,挺痛苦的。
from lua-nginx-module.
Regarding debugging, use lua's print function will emit outputs to error.log at the notice log level. Also, there's ngx.log() function that you can use to debug your Lua code. To send error messages to the web page output, just use pcall at the top level of your lua script, and ngx.print() it out to the response body.
from lua-nginx-module.
I have had the same problem when I used luarocks, there was a stack overflow. This was with cache off, I didn't test with cache on.
I think it's because Luarocks might do something to the "require" function that the Lua Nginx module doesn't like.
I will try to test with the latest versions of every components and report.
from lua-nginx-module.
On Wed, Jun 22, 2011 at 6:09 PM, golgote
[email protected]
wrote:
I think it's because Luarocks might do something to the "require" function that the Lua Nginx module doesn't like.
I will try to test with the latest versions of every components and report.
Great! Looking forward to your results :D
To be honest, we haven't used luarocks in our apps yet.
Thanks!
-agentzh
from lua-nginx-module.
Hi Agentzh,
I tested with latest LuaRocks 2.0.4.1, nginx 1.0.4 and today's snapshot of Lua-nginx-module and the problem is still here (although I now find the error log much better looking, thank you :) )
2011/06/29 20:31:39 [error] 12547#0: *8 lua handler aborted: runtime error: /usr/local/share/lua/5.1/luarocks/path.lua:244: stack overflow, client: 123.456.789.123, server: example.com, request: "GET /info.lua HTTP/1.1", host: "example.com"
Hope this helps, don't hesitate to ask for more info if you need.
Thanks.
from lua-nginx-module.
On Thu, Jun 30, 2011 at 2:38 AM, golgote
[email protected]
wrote:
Hi Agentzh,
I tested with latest LuaRocks 2.0.4.1, nginx 1.0.4 and today's snapshot of Lua-nginx-module and the problem is still here (although I now find the error log much better looking, thank you :) )2011/06/29 20:31:39 [error] 12547#0: *8 lua handler aborted: runtime error: /usr/local/share/lua/5.1/luarocks/path.lua:244: stack overflow, client: 123.456.789.123, server: example.com, request: "GET /info.lua HTTP/1.1", host: "example.com"
Thanks for the info. We'll look into this in the near future :)
Thanks!
-agentzh
from lua-nginx-module.
I looked into this today, and could not reproduce this with the latest version of LuaRocks (2.0.4.1) and ngx_lua (v0.2.1rc3), on either Linux or Mac OS X. Here records my experiences:
http://openresty.org/#UsingLuaRocks
Please tell us if it works for you too or if I'm doing something different from you :)
from lua-nginx-module.
Okay...I've reproduced this problem by disabling lua_code_cache.
from lua-nginx-module.
I think I've already fixed this issue in git master, could you please try it out on your side? Thanks!
from lua-nginx-module.
consider it resolved.
from lua-nginx-module.
Hi Agentzh, I cannot test right now, but I'll let you know if I find any other issues related as soon as I can.
Thanks for the fix.
from lua-nginx-module.
On Thu, Aug 11, 2011 at 7:27 PM, golgote
[email protected]
wrote:
Hi Agentzh, I cannot test right now, but I'll let you know if I find any other issues related as soon as I can.
Thanks for the fix.
Looking forward to your results ;)
Best,
-agentzh
from lua-nginx-module.
Related Issues (20)
- ngx.say not work
- init_by_lua during Nginx config test HOT 3
- Using outer scope required modules inside an ngx.timer.at handler HOT 4
- when header_filter_by_lua_file run failed. HOT 1
- OpenResty keepalive connection appears to be hung HOT 6
- unexpected phase error when `ngx.send_header()` trigger `if_unmodified` 412 logic HOT 2
- nginx: [emerg] dlopen() "/etc/nginx/ngx_http_naxsi_module.so" failed (/etc/nginx/ngx_http_naxsi_module.so: undefined symbol: pcre_exec) in /etc/nginx/nginx.conf:9 nginx: configuration file /etc/nginx/nginx.conf test failed
- nginx: [emerg] dlopen() "/usr/local/src/nginx-1.26.1/objs/ngx_http_naxsi_module.so" failed (/usr/local/src/nginx-1.26.1/objs/ngx_http_naxsi_module.so: undefined symbol: pcre_exec) in /etc/nginx/nginx.conf:9 HOT 2
- Nginx + LibreSSL (undefined symbol: SSL_client_hello_get0_ext) HOT 3
- Possible to support `tcpsock:receive` in `balancer_by_lua` context?
- `ngx.req.set_body_data` API does not work in `balancer_by_lua` phase HOT 1
- errlog get_logs doesnt get error logs in privileged agent and visa versa HOT 3
- Core dumps with Lua nginx module and OCSP enabled on ingress-nginx HOT 2
- attempt to redefine .. in cdef HOT 1
- New module release HOT 2
- bug: memory leak when collecting response body chunks HOT 1
- ngx_http_lua_module 0.10.27 HOT 12
- Cannot remove headers set with add_header and variable value from map in http block HOT 2
- unreachable code in ngx_http_lua_util HOT 1
- possible multiple redundant comparison of functions return codes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lua-nginx-module.