<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-GB">Sorry I’m tiered – it isn’t about extensions but general device timeout…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">Users <users-bounces@lists.genieacs.com> on behalf of Simon Ryf <simon.ryf@dualstack.ch><br>
<b>Reply-To: </b>Community support for GenieACS users <users@lists.genieacs.com><br>
<b>Date: </b>Thursday, 31 January 2019 at 22:22<br>
<b>To: </b>Community support for GenieACS users <users@lists.genieacs.com><br>
<b>Subject: </b>Re: Extensions timeout<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><span lang="EN-GB">Dan and Zaid – do you know that you’re still having a “bug” when using Node >=8.x on that?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><a href="https://nodejs.org/api/http.html#http_server_keepalivetimeout">https://nodejs.org/api/http.html#http_server_keepalivetimeout</a><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">you need to fix that in server.js I can give you the code I’ve added for that.<o:p></o:p></p>
<p class="MsoNormal">I’m not really a Node dev and therefore I didn’t yet made a pull request…<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Cheers<o:p></o:p></p>
<p class="MsoNormal">Simon<o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">Users <users-bounces@lists.genieacs.com> on behalf of Dan Morphis <dan@milkcarton.com><br>
<b>Reply-To: </b>Community support for GenieACS users <users@lists.genieacs.com><br>
<b>Date: </b>Thursday, 31 January 2019 at 20:54<br>
<b>To: </b>Community support for GenieACS users <users@lists.genieacs.com><br>
<b>Subject: </b>Re: Extensions timeout</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">You can increase the extension timeout by adding "EXT_TIMEOUT": 30000, to the genieacs/config/config.json file. Timeout is in milliseconds.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">-dan<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">On Tue, Jan 29, 2019 at 11:27 PM Mirek Lauš <<a href="mailto:mirek@laus.cz" target="_blank">mirek@laus.cz</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal">Hello Genieacs users,<br>
<br>
my extensions sometimes results in timeout without a reason giving a NodeJS<br>
error in the log:<br>
<br>
> 1: node::Abort(void) [/usr/local/bin/node]<br>
> 2: node::PlatformInit(void) [/usr/local/bin/node]<br>
> 3: node::Start(int, char**) [/usr/local/bin/node]<br>
> 4: _start [/usr/local/bin/node]<br>
<br>
My extension is called from Provision script:<br>
<br>
> let genieacsId = declare("DeviceID.ID", {value: 1}).value[0];<br>
> let externalIp = declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress", {value: 1}).value[0];<br>
> let connReqUrl = declare("InternetGatewayDevice.ManagementServer.ConnectionRequestURL", {value: 1}).value[0];<br>
> <br>
> let args = {id: genieacsId, url: connReqUrl, ip: externalIp};<br>
> <br>
> log('remoteCallback call script');<br>
> <br>
> let resp = ext('remote', 'remoteCallback', JSON.stringify(args));<br>
> log('remote response ' + genieacsId + ': ' + resp);<br>
<br>
And the extension:<br>
<br>
> const API_URL = '<a href="https://remote.url/api/genieacs" target="_blank">https://remote.url/api/genieacs</a>';<br>
> const url = require("url");<br>
> const http = require(API_URL.split(":", 1)[0]);<br>
> <br>
> const logger = require('../../lib/logger');<br>
> <br>
> function remoteCallback(args, callback) {<br>
> <br>
> let params = JSON.parse(args[0]);<br>
> <br>
> const uri = API_URL + "/<a href="http://callback.pl?id=" target="_blank">callback.pl?id=</a>" +
<a href="http://params.id" target="_blank">params.id</a> + "&url=" + params.url + "&ip=" + params.ip;<br>
> <br>
> let options = url.parse(uri);<br>
> options.headers = { accept: 'application/json', "content-type": 'application/json' };<br>
> <br>
> <a href="http://logger.info" target="_blank">logger.info</a>({message: 'post callback ' +
<a href="http://params.id" target="_blank">params.id</a>});<br>
> <br>
> let request = http.get(options, function (response) {<br>
> <br>
> if (response.statusCode == 404) {<br>
> return callback(null, null);<br>
> }<br>
> <br>
> if (response.statusCode >= 400) {<br>
> return callback(new Error("Unexpected error. Response Code: " +<br>
> response.statusCode + '. Status Message: ' + response.statusMessage + '. t: ' + typeof response.statusCode));<br>
> }<br>
> <br>
> let data = "";<br>
> <br>
> response.on("data", function(d) {<br>
> data = data + d.toString();<br>
> });<br>
> <br>
> response.on("end", function () {<br>
> <a href="http://logger.info" target="_blank">logger.info</a>({message: 'post callback response: ' + data});<br>
> return callback(null,data);<br>
> });<br>
> <br>
> });<br>
> <br>
> request.on("error", function (err) {<br>
> <a href="http://logger.info" target="_blank">logger.info</a>({message: 'post callback error: ' + err});<br>
> callback(err);<br>
> });<br>
> <br>
> }<br>
> <br>
> exports.remoteCallback = remoteCallback;<br>
<br>
<br>
How to debug this?<br>
<br>
Regards<br>
Mirek<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.genieacs.com" target="_blank">Users@lists.genieacs.com</a><br>
<a href="http://lists.genieacs.com/mailman/listinfo/users" target="_blank">http://lists.genieacs.com/mailman/listinfo/users</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</body>
</html>