﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
1297	Javascript Engine:IoT tutorial not working	florinpatan@…		"Hello,



I'm following the IoT tutorial from here: https://www.nginx.com/blog/nginx-plus-iot-load-balancing-mqtt/ 

However, it seems that I cannot produce a valid configuration for nginx.

I'm validating the configuration with nginx -t but it seems that it's failing silently.


{{{
Step 11/12 : RUN /usr/sbin/nginx -t -c /etc/nginx/config/nginx.conf
 ---> Running in c7cde3c91ccc
nginx: configuration file /etc/nginx/config/nginx.conf test failed
The command '/bin/sh -c /usr/sbin/nginx -t -c /etc/nginx/config/nginx.conf' returned a non-zero code: 1
}}}

This issue is 100% reproducible, I've created the following project for it: https://github.com/dlsniper/nginx-js-issue which you can clone and reproduce it.

I've tried to identify from where the issue might come from and I can tell you that removing the following line:

{{{
js_include mqtt.js;
}}}

from mqtt.conf will result in the container successfully being built.

I've tried to reduce the JS file to just this:

{{{
function getClientId(s) {
    return s.OK;
}

function setClientId(s) {
    return ""-"";
}
}}}

and the configuration would still fail.

I've also tried to clone the JS module at various different revisions, without luck.

Am I doing something wrong? If so, can you please explain what as I can't see anything else that I can try and do at this point.

Please let me know if you need any further details.

Thank you for your time and help."	defect	closed	blocker		nginx-module	1.12.x	invalid			Linux f8a42a2b6a07 4.10.0-24-generic #28-Ubuntu SMP Wed Jun 14 08:14:34 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux	"nginx version: nginx/1.12.0
built by gcc 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2) 
built with OpenSSL 1.0.2l  25 May 2017
TLS SNI support enabled
configure arguments: --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/run/nginx.pid --with-pcre=../pcre-8.40 --with-zlib=../zlib-1.2.11 --with-http_ssl_module --with-http_v2_module --with-file-aio --with-threads --with-http_auth_request_module --with-stream --with-mail=dynamic --add-module=/tmp/njs/nginx"
