openresty / openresty/lua-resty-core

"ngx_http_lua_module 0.10.15 required" issue when starting Openresty

Open
#329 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
853
Forks
286
Avg merge
35m
Merged PRs (30d)
1

Description

I am able to compile Openresty for PPC platforms but unable to start the same due the following issue :

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: /usr/binos/openresty/lualib/resty/core/base.lua:23: ngx_http_lua_module 0.10.15 required)

OpenResty version : openresty/1.15.8.3
OS version : Linux ztp_RP_1 4.9.238 #1 SMP Mon Oct 12 17:19:38 UTC 2020 ppc ppc ppc GNU/Linux
Since, Nginx doesn't even start so nothing to share with Nginx error logs here.

The base.lua seems to be failing around this check :

if subsystem == 'http' then
    if not ngx.config
       or not ngx.config.ngx_lua_version
       or ngx.config.ngx_lua_version ~= 10015
    then
        error("ngx_http_lua_module 0.10.15 required")
    end

I broke the three conditions to see the variable's status here and I found that ngx.config.ngx_lua_version is not set to anything. As per my finding till now, the variable should have been set in build/ngx_lua-0.10.15/src/ngx_http_lua_config.c.
I am unsure why this is not set properly.

Please, note that we do compile the same Openresty for other type of platforms(ARM/X86_64) and it does come up fine.
Also, Kindly note the flags used for building Luajit for this:

else ifneq ($(filter $(PPC_ALL_TARGETS),$(TARGET)),)
        $(Nx)HOST_CC := \
               $($(Nx)LUAJIT_HOST_CC) \
               -m32 \
               -DLJ_HASJIT=0 \
               -LJ_ABI_SOFTFP=1 \
               -DLUAJIT_TARGET=LUAJIT_ARCH_PPC \
               -LJ_TARGET_PPC=1 \

             $(Nx)DASM_ARCH := ppc

             $(Nx)DASM_FLAGS := -D FFI -D FPU -D HFABI -D VER=

             $(Nx)DASM_DASC := vm_ppc.dasc

Any kind of help here would be much appreciated!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lualib/resty/core/base.lua and the reported ngx_http_lua_config.c under build/ngx_lua-0.10.15, then inspect the PPC Luajit build flags and reproduce the OpenResty startup failure. Done means ngx.config.ngx_lua_version is set correctly and OpenResty starts on the PPC platform without the ngx_http_lua_module version error.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.