Aerospike Lua Protobuf pb.so: undefined symbol: lua_settop

,

I try to run simple lua udf in docker and keep getting this error:

ERROR lua create error: error loading module 'protobuf.pb' from file '/usr/local/lib/lua/5.1/protobuf/pb.so':
        /usr/local/lib/lua/5.1/protobuf/pb.so: undefined symbol: lua_settop

I searched over the whole interner and tried everything I was able to understand how to apply but nothing helped. I can successfully build an image, register my modules but when I run simple command it just fails with the error above:

Here is Dockerfile where I test it

FROM rockylinux:8.9
# install requirements
RUN dnf update -y  && \
    dnf install -y git gcc make findutils wget unzip readline-devel python3 python3-pip && \
    ln -sf /usr/bin/python3 /usr/bin/python
## install aerospile
RUN mkdir -p aerospike \
    && wget -qO- "https://download.aerospike.com/artifacts/aerospike-server-enterprise/6.3.0.5/aerospike-server-enterprise_6.3.0.5_tools-8.4.0_el8_$(uname -m).tgz" | tar -xvzf - -C ./aerospike --strip-components=1 \
    && cd ./aerospike && ./asinstall && cd ../ && rm -rf ./aerospike
# https://aerospike.com/developer/udf/knowing_lua#lua-version
ARG LUA_VERSION=5.1.4
# Use latest
ARG LUAROCKS_VERSION=3.11.1

# install lua
RUN mkdir -p lua && \
    wget -qO- https://www.lua.org/ftp/lua-${LUA_VERSION}.tar.gz | tar -xvzf - -C ./lua --strip-components=1 && \
    cd ./lua && CFLAGS="-fPIC -Wall -Wextra" LIBFLAGS="-shared" make -j $(nproc) linux && make -j $(nproc) install && \
    cd ../ && rm -rf ./lua && \
    lua -v && \
    # install luarocks
    mkdir -p ./luarocks && \
    wget -qO- luarocks https://luarocks.org/releases/luarocks-${LUAROCKS_VERSION}.tar.gz | tar -xvzf - -C ./luarocks --strip-components=1 && \
    cd luarocks && ./configure && make -j $(nproc) && make -j $(nproc) install && cd .. && rm -rf luarocks && \
    luarocks && \
    # install protobuf
    luarocks install protobuf  && \
    luarocks install lua-protobuf && \
    pip3 install protobuf && \
    dnf install -y protobuf-compiler && \
    # clean up
    dnf clean all

COPY ./proto /proto
COPY ./udf /udf

ENTRYPOINT ["asd"]
CMD ["--foreground"]

and the lua module

local protobuf = require 'protobuf'

function count(recs)
  return recs :
  map(function(rec)
    return 1
  end) :
  aggregate(0, function(count, rec)
    return count + 1
  end)
end

when I execute this function, it fails with the error above

aql> REGISTER MODULE '/udf/myudf.lua'
OK, 1 module added.

aql> AGGREGATE myudf.count() ON test

Any ideas how to get it working?

Here is the same question on SO

Asked one more related question Aerospike lua protobuf