Bug 277145 - www/nginx: Nginx 1.24.0 startup issue following lua-resty-core v0.1.28 upgrade
Summary: www/nginx: Nginx 1.24.0 startup issue following lua-resty-core v0.1.28 upgrade
Status: Closed FIXED
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:
Blocks:
 
Reported: 2024-02-18 17:27 UTC by Christos Chatzaras
Modified: 2024-08-20 13:54 UTC (History)
5 users (show)

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


Attachments
Patch to update ngx_http_lua_module version (2.34 KB, patch)
2024-02-18 20:21 UTC, Christos Chatzaras
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christos Chatzaras 2024-02-18 17:27:44 UTC
After updating the lua-resty-core library to version 0.1.28, I encountered a critical startup issue with Nginx version 1.24.0. The error message indicates a failure to load the 'resty.core' module, as outlined below:

nginx: [alert] failed to load the 'resty.core' module (https://github.com/openresty/lua-resty-core); ensure you are using an OpenResty release from https://openresty.org/en/download.html (reason: /usr/local/share/lua/5.1/resty/core/base.lua:24: ngx_http_lua_module 0.10.26 required) in /usr/local/etc/nginx/nginx.conf:1044

The error suggests that the current version of the ngx_http_lua_module (v0.10.25) is incompatible with the latest lua-resty-core update, which requires ngx_http_lua_module version 0.10.26.

To address this compatibility issue I recommend updating the Nginx port's Makefile.extmod to use the compatible version of the ngx_http_lua_module.

Current Configuration Line:

openresty:lua-nginx-module:v0.10.25:lua

Suggested Change:

openresty:lua-nginx-module:v0.10.26:lua
Comment 1 Ryan Steinmetz freebsd_committer freebsd_triage 2024-02-18 18:38:46 UTC
Add osa@
Comment 2 Sergey A. Osokin freebsd_committer freebsd_triage 2024-02-18 18:47:59 UTC
(In reply to Ryan Steinmetz from comment #1)

Hi Ryan,

I'd recommend to update third-party lua module to its recent version.

Thank you.
Comment 3 Ryan Steinmetz freebsd_committer freebsd_triage 2024-02-18 19:00:49 UTC
(In reply to Sergey A. Osokin from comment #2)

Agreed.  Pending joneum@.
Comment 4 Christos Chatzaras 2024-02-18 20:21:51 UTC
Created attachment 248577 [details]
Patch to update ngx_http_lua_module version
Comment 5 commit-hook freebsd_committer freebsd_triage 2024-02-21 19:21:50 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=51f2e5e1228ddfa53ac91a51f1b68273d1bce45c

commit 51f2e5e1228ddfa53ac91a51f1b68273d1bce45c
Author:     Christos Chatzaras <chris@cretaforce.gr>
AuthorDate: 2024-02-21 19:14:26 +0000
Commit:     Florian Smeets <flo@FreeBSD.org>
CommitDate: 2024-02-21 19:21:20 +0000

    www/nginx: Fix nginx with LUA after lua-resty-core update

    In f08bfacc8fd6 lua-resty-core was updated this requires an updated
    version of openresty-lua-nginx-module.

    To prevent further people from bricking their nginx update the
    openresty-lua-nginx-module 3rd party module to 0.10.26.

    Otherwise people will find an nginx that does not start anymore with
    the following error message:

    nginx: [alert] failed to load the 'resty.core' module
    (https://github.com/openresty/lua-resty-core); ensure you are using an
    OpenResty release from https://openresty.org/en/download.html (reason:
    /usr/local/share/lua/5.1/resty/core/base.lua:24: ngx_http_lua_module
    0.10.26 required) in /usr/local/etc/nginx/nginx.conf:1044

    PR:             277145
    Approved by:    portmgr (blanket, just fix it)

 www/nginx/Makefile        | 2 +-
 www/nginx/Makefile.extmod | 2 +-
 www/nginx/distinfo        | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)
Comment 6 Florian Smeets freebsd_committer freebsd_triage 2024-02-21 19:25:15 UTC
I ran into this myself yesterday evening. I just committed the fix. Thanks.
Comment 7 Eirik Oeverby 2024-02-22 13:25:57 UTC
(In reply to Florian Smeets from comment #6)
Thanks a lot for getting the patch in!

Can you think of a way to prevent this from happening again? It was quite unpleasant for us (took a bit to find out what was actually going on) and it's not the first time this precise issue has cropped up. I suspect it can only be verified by actually spinning up the nginx binary with an appropriate configuration, but could the nginx port pick up the correct version from the lua-* ports?
Comment 8 Ryan Steinmetz freebsd_committer freebsd_triage 2024-02-22 14:18:46 UTC
(In reply to Eirik Oeverby from comment #7)

joneum@,

Can I have future approval for updates to the ngx_http_lua_module to ensure these are always in sync?
Comment 9 commit-hook freebsd_committer freebsd_triage 2024-08-20 13:54:08 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d08dcf215d0bae3642cb0837f3272070188908f2

commit d08dcf215d0bae3642cb0837f3272070188908f2
Author:     Ryan Steinmetz <zi@FreeBSD.org>
AuthorDate: 2024-08-20 13:50:13 +0000
Commit:     Ryan Steinmetz <zi@FreeBSD.org>
CommitDate: 2024-08-20 13:53:15 +0000

    www/(nginx|nginx-devel|lua-resty-core): Document lua module dependencies/alternate maintainers

    PR:             280882, 277145

 www/lua-resty-core/Makefile     | 2 ++
 www/nginx-devel/Makefile.extmod | 1 +
 www/nginx/Makefile.extmod       | 1 +
 3 files changed, 4 insertions(+)