Bug 240274 - www/nginx: Unable to start when built with LUA support
Summary: www/nginx: Unable to start when built with LUA support
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jochen Neumeister
URL:
Keywords:
Depends on: 240438
Blocks:
  Show dependency treegraph
 
Reported: 2019-09-02 11:59 UTC by Thomas Steen Rasmussen / Tykling
Modified: 2019-09-17 03:00 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (joneum)


Attachments
www_nginx_Makefile_extmod.patch (637 bytes, patch)
2019-09-17 03:00 UTC, Phillip R. Jaenke
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Steen Rasmussen / Tykling 2019-09-02 11:59:15 UTC
For a while now I have been getting this warning whenever I start nginx when it is build with the LUA option:


[tykling@mail ~]$ sudo service nginx start
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
[tykling@mail ~]$ 


The maintainer is aware of this warning, I reported it back in February by email.

Recently (since ports r508962 I think) I am still getting the warning but nginx now refuses to start:

[tykling@staging3 ~]$ sudo service nginx start
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
nginx: [error] lua_load_resty_core failed to load the resty.core module from https://github.com/openresty/lua-resty-core; ensure you are using an OpenResty release from https://openresty.org/en/download.html (rc: 2, reason: module 'resty.core' not found:
        no field package.preload['resty.core']
        no file './resty/core.lua'
        no file '/usr/local/share/luajit-2.0.5/resty/core.lua'
        no file '/usr/local/share/lua/5.1/resty/core.lua'
        no file '/usr/local/share/lua/5.1/resty/core/init.lua'
        no file './resty/core.so'
        no file '/usr/local/lib/lua/5.1/resty/core.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file './resty.so'
        no file '/usr/local/lib/lua/5.1/resty.so'
        no file '/usr/local/lib/lua/5.1/loadall.so')
[tykling@staging3 ~]$ 


This is preventing me from upgrading nginx to solve the recent vulnerabilities https://vuxml.freebsd.org/freebsd/87679fcb-be60-11e9-9051-4c72b94353b5.html
Comment 1 commit-hook freebsd_committer 2019-09-12 08:50:32 UTC
A commit references this bug:

Author: joneum
Date: Thu Sep 12 08:49:53 UTC 2019
New revision: 511862
URL: https://svnweb.freebsd.org/changeset/ports/511862

Log:
  The lua module for nginx is intended to be used with Openrestys luajit branch.

  PR:		240438 240274
  Sponsored by:	Netzkommune GmbH

Changes:
  head/www/nginx/Makefile.extmod
Comment 2 Thomas Steen Rasmussen / Tykling 2019-09-13 07:54:53 UTC
Hello,

Thank you. My poudriere has built the new nginx package but it didn't seem to do anything, I still get the same error:

[tsr@webproxy3 ~]$ pkg info | grep nginx
nginx-1.16.1_2,2               Robust and small WWW server
[tsr@webproxy3 ~]$ pkg info | grep lua  
luajit-openresty-2.1.20190626  Just-In-Time Compiler for Lua (OpenResty branch)
[tsr@webproxy3 ~]$ sudo service nginx restart
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Stopping nginx.
Waiting for PIDS: 66697.
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
nginx: [error] lua_load_resty_core failed to load the resty.core module from https://github.com/openresty/lua-resty-core; ensure you are using an OpenResty release from https://openresty.org/en/download.html (rc: 2, reason: module 'resty.core' not found:
        no field package.preload['resty.core']
        no file './resty/core.lua'
        no file '/usr/local/share/luajit-2.1.0-beta3/resty/core.lua'
        no file '/usr/local/share/lua/5.1/resty/core.lua'
        no file '/usr/local/share/lua/5.1/resty/core/init.lua'
        no file './resty/core.so'
        no file '/usr/local/lib/lua/5.1/resty/core.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file './resty.so'
        no file '/usr/local/lib/lua/5.1/resty.so'
        no file '/usr/local/lib/lua/5.1/loadall.so')
[tsr@webproxy3 ~]$
Comment 3 Christoph Lukas 2019-09-13 12:03:44 UTC
You also need the two ports in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240160
Comment 4 Phillip R. Jaenke 2019-09-17 03:00:54 UTC
Created attachment 207542 [details]
www_nginx_Makefile_extmod.patch

Please see attached patch. This will reduce the amount of incidental foot-shooting by approximately 100% by adding a dependency on www/lua-resty-core (which was added <looks> yesterday!) I have tested locally and it compiles cleanly with no issues AND keeps me from picking toes up off the floor.