failed to run balancer_by_lua*: balancer_by_lua:2: module 'ngx.balancer' not found:

rnmx18 nginx-forum at forum.nginx.org
Thu Oct 26 17:21:25 UTC 2017


Hi,

I am getting the following error when I try to use balancer_by_lua with
ngx.balancer in my NGINX configuration.

2017/10/26 08:13:38 [error] 22447#22447: *10 failed to run balancer_by_lua*:
balancer_by_lua:2: module 'ngx.balancer' not found:
        no field package.preload['ngx.balancer']
        no file '/home/rajesh/lua-resty-http-master/lib/ngx/balancer.lua'
        no file
'/home/rajesh/lua-resty-balancer-master/lib/ngx/balancer.lua'
        no file './ngx/balancer.lua'
        no file '/usr/local/share/luajit-2.0.5/ngx/balancer.lua'
        no file '/usr/local/share/lua/5.1/ngx/balancer.lua'
        no file '/usr/local/share/lua/5.1/ngx/balancer/init.lua'
        no file '/home/rajesh/lua-resty-balancer-master/ngx/balancer.so'
        no file './ngx/balancer.so'
        no file '/usr/local/lib/lua/5.1/ngx/balancer.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file '/home/rajesh/lua-resty-balancer-master/ngx.so'
        no file './ngx.so'
        no file '/usr/local/lib/lua/5.1/ngx.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
        [C]: in function 'require'
        balancer_by_lua:2: in function <balancer_by_lua:1> while connecting
to upstream, client: 192.168.1.3, server: myserver.com, request: "GET
/images/6314.jpeg HTTP/1.1"


The upstream config snippet is as follows:
    upstream backends {
        server 0.0.0.1;
        balancer_by_lua_block {
            local b = require "ngx.balancer"
            .....


[root at localhost rajesh]# /usr/sbin/nginx -V
nginx version: nginx/1.12.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) 
built with OpenSSL 1.0.2l  25 May 2017
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --with-openssl-opt=-fPIC
--with-openssl=/home/rajesh/nginx_prod_build_test/openssl-1.0.2l
--sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules
--conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid
--lock-path=/var/run/lock/subsys/nginx --user=nginx --group=nginx
--with-http_ssl_module --with-http_realip_module --with-http_addition_module
--with-http_sub_module --with-http_dav_module --with-http_flv_module
--with-http_mp4_module --with-http_gunzip_module
--with-http_gzip_static_module --with-http_random_index_module
--with-http_secure_link_module --with-http_degradation_module
--with-http_slice_module --with-http_stub_status_module
--with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic
--with-http_geoip_module=dynamic --with-http_perl_module=dynamic
--with-threads --with-stream=dynamic --with-stream_ssl_module
--with-http_auth_request_module --with-mail=dynamic --with-mail_ssl_module
--with-file-aio --with-pcre --with-pcre-jit --with-google_perftools_module
--with-http_v2_module
--add-module=/home/rajesh/nginx_prod_build_test/headers-more-nginx-module-0.32
--with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches
-m64 -mtune=generic -O2 -fPIC -g -pipe -Wno-error -fstack-protector
-std=c++11 -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
--param=ssp-buffer-size=4 -grecord-gcc-switches
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic'
--with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
-Wl,-E -Wl,-rpath,/usr/local/lib' --with-debug
--add-module=/home/rajesh/nginx-upstream-carp-master
--add-module=/home/rajesh/ngx_devel_kit-0.3.0
--add-module=/home/rajesh/lua-nginx-module-0.10.11rc2

Any inputs regarding the reason for this error, and how to resolve this?

Thanks
Rajesh

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,277076,277076#msg-277076



More information about the nginx mailing list