Missing dependency for ngx_http_lua_module.so in nginx-extras

Bug #1661819 reported by Alexander Mashin on 2017-02-04
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Nginx
Undecided
Thomas Ward
Stable
Undecided
Thomas Ward

Bug Description

I installed the binary package `nginx-extras`. Below is the output of `nginx -V`.

Unfortunately, it wouldn't load the module `ngx_http_lua_module.so` with the error `[emerg] 10575#10575: dlopen() "/usr/share/nginx/modules/ngx_http_lua_module.so" failed (/usr/share/nginx/modules/ngx_http_lua_module.so: undefined symbol: ndk_set_var_value) in /etc/nginx/nginx.conf:5`.
```
nginx -V
nginx version: nginx/1.10.2
built with OpenSSL 1.0.2g 1 Mar 2016
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-Mpk2o_/nginx-1.10.2=. -fPIE -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_flv_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_mp4_module --with-http_perl_module=dynamic --with-http_random_index_module --with-http_secure_link_module --with-http_sub_module --with-http_xslt_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-stream=dynamic --with-stream_ssl_module --add-dynamic-module=/build/nginx-Mpk2o_/nginx-1.10.2/debian/modules/headers-more-nginx-module --add-dynamic-module=/build/nginx-Mpk2o_/nginx-1.10.2/debian/modules/nginx-auth-pam --add-dynamic-module=/build/nginx-Mpk2o_/nginx-1.10.2/debian/modules/nginx-cache-purge --add-dynamic-module=/build/nginx-Mpk2o_/nginx-1.10.2/debian/modules/nginx-dav-ext-module --add-dynamic-module=/build/nginx-Mpk2o_/nginx-1.10.2/debian/modules/nginx-development-kit --add-dynamic-module=/build/nginx-Mpk2o_/nginx-1.10.2/debian/modules/nginx-echo --add-dynamic-module=/build/nginx-Mpk2o_/nginx-1.10.2/debian/modules/ngx-fancyindex --add-dynamic-module=/build/nginx-Mpk2o_/nginx-1.10.2/debian/modules/nchan --add-dynamic-module=/build/nginx-Mpk2o_/nginx-1.10.2/debian/modules/nginx-lua --add-dynamic-module=/build/nginx-Mpk2o_/nginx-1.10.2/debian/modules/nginx-upload-progress --add-dynamic-module=/build/nginx-Mpk2o_/nginx-1.10.2/debian/modules/nginx-upstream-fair --add-dynamic-module=/build/nginx-Mpk2o_/nginx-1.10.2/debian/modules/ngx_http_substitutions_filter_module
```

Thomas Ward (teward) wrote :

Dynamic modules are not in the Ubuntu repositories - are you using a PPA?

Thomas Ward (teward) wrote :

Invalid against Ubuntu as it is from the PPA. Valid for the Nginx project here on Launchpad though.

Changed in nginx:
assignee: nobody → Thomas Ward (teward)
Changed in nginx (Ubuntu):
status: New → Invalid
tags: added: ppa stable
Thomas Ward (teward) wrote :

I can't confirm this in Xenial, let me test my Yakkety system.

Can you give an example of your configs that caused this, please? Maybe even a dummy test script for Lua that I can check?

Thomas Ward (teward) wrote :

Also provide details about your system please. Including your architecture that your system is (or alternatively just include `uname -a

Thomas Ward (teward) wrote :

I've tested this binary from the PPA on a Yakkety VM and a Yakkety LXC container. I could not replicate this issue.

Changed in nginx:
status: New → Incomplete
no longer affects: nginx (Ubuntu)
Alexander Mashin (alex-mashin) wrote :

This is the minimal configuration that causes the error:
```
# For Lua balancer:
load_module "modules/ngx_http_lua_module.so";

# Create it and grant sufficient rights:
user www-data;

pid /var/run/nginx.pid;

http {
}
```
Nginx fails trying to dynamically load ngx_http_lua_module, before any lua scrips.

`uname -a` returns:
```Linux nas 4.8.0-37-generic #39-Ubuntu SMP Thu Jan 26 02:27:07 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
```
The server runs Ubuntu Server 16.10.

Alexander Mashin (alex-mashin) wrote :

This morning I upgraded nginx-extras with `apt-get dist-upgrade`. The problem persists. nginx configuration now is as follows:
`nginx -V`:
```
nginx version: nginx/1.10.3
built with OpenSSL 1.0.2g 1 Mar 2016
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-Mpuecc/nginx-1.10.3=. -fPIE -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_flv_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_mp4_module --with-http_perl_module=dynamic --with-http_random_index_module --with-http_secure_link_module --with-http_sub_module --with-http_xslt_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-stream=dynamic --with-stream_ssl_module --add-dynamic-module=/build/nginx-Mpuecc/nginx-1.10.3/debian/modules/headers-more-nginx-module --add-dynamic-module=/build/nginx-Mpuecc/nginx-1.10.3/debian/modules/nginx-auth-pam --add-dynamic-module=/build/nginx-Mpuecc/nginx-1.10.3/debian/modules/nginx-cache-purge --add-dynamic-module=/build/nginx-Mpuecc/nginx-1.10.3/debian/modules/nginx-dav-ext-module --add-dynamic-module=/build/nginx-Mpuecc/nginx-1.10.3/debian/modules/nginx-development-kit --add-dynamic-module=/build/nginx-Mpuecc/nginx-1.10.3/debian/modules/nginx-echo --add-dynamic-module=/build/nginx-Mpuecc/nginx-1.10.3/debian/modules/ngx-fancyindex --add-dynamic-module=/build/nginx-Mpuecc/nginx-1.10.3/debian/modules/nchan --add-dynamic-module=/build/nginx-Mpuecc/nginx-1.10.3/debian/modules/nginx-lua --add-dynamic-module=/build/nginx-Mpuecc/nginx-1.10.3/debian/modules/nginx-upload-progress --add-dynamic-module=/build/nginx-Mpuecc/nginx-1.10.3/debian/modules/nginx-upstream-fair --add-dynamic-module=/build/nginx-Mpuecc/nginx-1.10.3/debian/modules/ngx_http_substitutions_filter_module
```

Alexander Mashin (alex-mashin) wrote :

It seems to me that the module `ngx_set_misc` is not compiled into nginx or bundled with nginx-extras package, and `ngx_http_lua_module.so` depends on it.

Jordan Mavoungou (baku-fr) wrote :

Same issue for me while upgrading from 1.10.1-3 to 1.10.3-0.

I tried to compile ngx_set_misc dynamically and put it among the nginx modules but I'm still having issues. After including the compiled ngx_http_set_misc_module.so I'm still having this issue and can't enable mod-http-lua.

nginx: [emerg] dlopen() "/usr/share/nginx/modules/ngx_http_set_misc_module.so" failed (/usr/share/nginx/modules/ngx_http_set_misc_module.so: undefined symbol: ndk_http_module) in /etc/nginx/modules-enabled/50-mod-http-lua.conf:1

Emanuele Rocca (ema) wrote :

Try loading the ndk module:

load_module modules/ndk_http_module.so;
load_module modules/ngx_http_lua_module.so;

Alexander Mashin (alex-mashin) wrote :

Thank you, it helped.

Jordan Mavoungou (baku-fr) wrote :

Thank you, it worked for me as well.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers