Open soerenmartius opened 8 years ago
I reckon this is caused by missing musl libc in alpine linux
Yeah, Alpine version has problems with lua_code_cache
set to off
. This is caused not by missing musl libc, but, on the contrary, by the fact that musl libc is used instead of glibc when building OpenResty for Alpine, as Alpine in general uses musl libc instead of glibc. I'm not sure about the cause of this lua_code_cache
behavior, but I've run into it too. I suspect this is a bug in musl or a musl/glibc compatibility problem. Also, it's hard to build OpenResty profiling tools with musl libc.
That's why I recommended using Debian flavor in the Usage during development section. Probably I need to emphasize it more in the readme.
That said, we've had no issues caused by musl libc in production.
The only real fix I see now is to build OpenResty with glibc in Alpine flavor too, but that would substantially increase the image size. I'm not sure it's worth it, given that you can use Debian version for development.
Thanks for quick reply @skozin. Making it a bit more clear in the documentation would be nice. But also i did run into issues on production. The logs showed me syntax error but the script was correct though. It even popped up with errors on lines which didn't exist.
So you're not using lua_code_cache off
in production, and still get the similar problems?
Sorry for late reply. Yes exactly. Also sometimes I run into syntax errors altough the syntax is correct. If i switch to debian it is working correctly
I inherited from your alpine version dockerfile and ran into issues.
Setting up a new container works as expected, also it uses my custom nginx.conf
nginx.conf
example.lua
ngx.print('<H1>Hello World.</H1>');
However. Setting lua_code_cache to off won't work on alpine linux. The usual warning
won't come up as expected. Also, if i change the code in example.lua it won't show me the new content but it comes up with an syntax exception in the logs and crashes. Although the syntax i am using is fine.
If i switched to the debian version and it all works as expected. Something seems to be broken with alpine linux version.