Closed UnderGreen closed 8 years ago
@UnderGreen What operating system are you in? And what version of NDK are you using? Please provide as much details as possible. I'm pretty sure that I've tested the dynamic module versions of NDK and ngx_set_misc on Linux myself.
OS: Ubuntu Trusty 14.04.1 NDK: v0.3.0rc1
@UnderGreen Why don't you provide your nginx.conf and ./configure command line? BTW, NDK is at v0.3.0 formal now.
@UnderGreen Your error message could mean that your NDK module is either not loaded at all or your NDK module build is incomplete or bad.
@UnderGreen I've just tested the latest versions of NDK and ngx_set_misc on my side (Linux x86_64) and it starts up successfully and also passes the whole test suite.
The command that I'm using:
./configure --add-dynamic-module=/path/to/ngx_devel_kit \
--add-dynamic-module=/path/to/set-misc-nginx-module
And in my nginx.conf:
load_module ../../work/nginx/modules/ndk_http_module.so;
load_module ../../work/nginx/modules/ngx_http_set_misc_module.so;
@UnderGreen BTW, ensure that you build your NDK dynamic module together with your ngx_set_misc module. Do not build these two dynamic modules separately. Since ngx_set_misc enables the upstream_list feature in NDK which is usually not built by default.
@agentzh, you can look at my nginx debian package code here: https://github.com/UnderGreen/nginx-dev-steroidz
Sorry, I don't have the time for that. You should provide the relevant details here instead. Minimal and standalone example, that can reproduce the issue on my side. Since I cannot reproduce it on my side, my hunch is that it might be just your own configuration mistake or something like that.
@agentzh It's super obvious and straight forward what it's doing, just look at .gitmodules
and debian/rules
, if you want I can answer any questions you have about it, if that would help.
Not sure if that was an accident, but @UnderGreen it's all about module load order. Oh yes, this matters. Ugh.
Thanks for the help @agentzh !
@akatrevorjay: How did you solve that issue ?
Could you post an excerpt of a working nginx.conf
example ?
Despite having added the following lines at the top of nginx.conf
, I get an error:
load_module /path/to/modules/ndk_http_module.so;
load_module /path/to/modules/ngx_http_set_misc_module.so;
$ sudo nginx -t
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_get_upstream_list) in /etc/nginx/nginx.conf:2
nginx: configuration file /etc/nginx/nginx.conf test failed
Installed from PPA
$ nginx -V
nginx version: nginx/1.14.0
built with OpenSSL 1.0.2g 1 Mar 2016
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -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-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 --with-stream_ssl_preread_module --add-dynamic-module=/build/nginx-ph1UVS/nginx-1.14.0/debian/modules/http-headers-more-filter --add-dynamic-module=/build/nginx-ph1UVS/nginx-1.14.0/debian/modules/http-auth-pam --add-dynamic-module=/build/nginx-ph1UVS/nginx-1.14.0/debian/modules/http-cache-purge --add-dynamic-module=/build/nginx-ph1UVS/nginx-1.14.0/debian/modules/http-dav-ext --add-dynamic-module=/build/nginx-ph1UVS/nginx-1.14.0/debian/modules/http-ndk --add-dynamic-module=/build/nginx-ph1UVS/nginx-1.14.0/debian/modules/http-echo --add-dynamic-module=/build/nginx-ph1UVS/nginx-1.14.0/debian/modules/http-fancyindex --add-dynamic-module=/build/nginx-ph1UVS/nginx-1.14.0/debian/modules/nchan --add-dynamic-module=/build/nginx-ph1UVS/nginx-1.14.0/debian/modules/http-lua --add-dynamic-module=/build/nginx-ph1UVS/nginx-1.14.0/debian/modules/rtmp --add-dynamic-module=/build/nginx-ph1UVS/nginx-1.14.0/debian/modules/http-uploadprogress --add-dynamic-module=/build/nginx-ph1UVS/nginx-1.14.0/debian/modules/http-upstream-fair --add-dynamic-module=/build/nginx-ph1UVS/nginx-1.14.0/debian/modules/http-subs-filter
$ apt-cache show libnginx-mod-http-ndk | grep Version
Version: 1.14.0-0+xenial1
@kael iirc, it was the order of the modules being loaded
(provided you're loading all required mods)
I have problem with this module. Nginx compiled as a debian standart package with few extra modules, like set misc. Version of set misc 0.30 and 0.31. I built this and NDK module as a dynamic. NDK module loading before Set Misc, and I see problem: