<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[jsreportonline connect ECONNREFUSED &#x2F; socket hang up]]></title><description><![CDATA[<p>One of my reports has a lot of data and it therefore may take 30 sec or more to process in jsreportonline.   Because of that, I've moved the report rendering to a worker process in AWS Lambda that, when complete, saves the report into my S3 bucket.  Here is my code:</p>
<pre><code class="language-js">    try {

        // Code to get report data goes here .....
        // let reportData = ....
        
        // Call JSReport Engine, which returns a promise
        const res = await jsReportClient.render(
                {
                    template: { &quot;shortid&quot;: jsReportShortId},
                    data: reportData,
                    options: { reports: { save: false } }
                }, 
                { 
                    timeout: 180000 
                });
        
        // Save PDF report
        renderedPDF = await res.body();
        
        // Code to save to S3 goes here .....

    }
    catch (err) {
        
        // Show error
        console.log(&quot;Error getting report from JSReport Online API endpoint&quot;);
        console.log(err);

        // Otherwise, just close out callback
        callback(null, 'Error Callback');
    }
</code></pre>
<p>For the report in question, sometimes this works without any issue.  However, other times I get the following error:</p>
<pre><code>2020-01-20 06:01:41.033 Error: connect ECONNREFUSED 127.0.0.1:16784
    at /var/task/processJSReport/node_modules/jsreport-client/lib/client.js:62:29
    at /var/task/processJSReport/node_modules/jsreport-client/lib/client.js:115:40
    at ConcatStream.&lt;anonymous&gt; (/var/task/processJSReport/node_modules/concat-stream/index.js:36:43)
    at ConcatStream.emit (events.js:215:7)
    at ConcatStream.emit (domain.js:476:20)
    at finishMaybe (/var/task/processJSReport/node_modules/readable-stream/lib/_stream_writable.js:630:14)
    at afterWrite (/var/task/processJSReport/node_modules/readable-stream/lib/_stream_writable.js:492:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  remoteStack: 'Error: connect ECONNREFUSED 127.0.0.1:16784\n' +
    '    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)'
}
</code></pre>
<p>I've also received the following error:</p>
<pre><code>2020-01-20 06:26:21.052 Error: socket hang up
    at /var/task/processJSReport/node_modules/jsreport-client/lib/client.js:62:29
    at /var/task/processJSReport/node_modules/jsreport-client/lib/client.js:115:40
    at ConcatStream.&lt;anonymous&gt; (/var/task/processJSReport/node_modules/concat-stream/index.js:36:43)
    at ConcatStream.emit (events.js:215:7)
    at ConcatStream.emit (domain.js:476:20)
    at finishMaybe (/var/task/processJSReport/node_modules/readable-stream/lib/_stream_writable.js:630:14)
    at afterWrite (/var/task/processJSReport/node_modules/readable-stream/lib/_stream_writable.js:492:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  remoteStack: 'Error: socket hang up\n' +
    '    at createHangUpError (_http_client.js:342:15)\n' +
    '    at Socket.socketOnEnd (_http_client.js:437:23)\n' +
    '    at emitNone (events.js:111:20)\n' +
    '    at Socket.emit (events.js:208:7)\n' +
    '    at endReadableNT (_stream_readable.js:1064:12)\n' +
    '    at _combinedTickCallback (internal/process/next_tick.js:139:11)\n' +
    '    at process._tickCallback (internal/process/next_tick.js:181:9)'
}
</code></pre>
<p>Is there something that I must do to ensure that the report runs successfully each time?</p>
]]></description><link>https://forum.jsreport.net/topic/1418/jsreportonline-connect-econnrefused-socket-hang-up</link><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 16:04:24 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/1418.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 20 Jan 2020 06:19:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to jsreportonline connect ECONNREFUSED &#x2F; socket hang up on Mon, 20 Jan 2020 06:50:53 GMT]]></title><description><![CDATA[<p>One of my reports has a lot of data and it therefore may take 30 sec or more to process in jsreportonline.   Because of that, I've moved the report rendering to a worker process in AWS Lambda that, when complete, saves the report into my S3 bucket.  Here is my code:</p>
<pre><code class="language-js">    try {

        // Code to get report data goes here .....
        // let reportData = ....
        
        // Call JSReport Engine, which returns a promise
        const res = await jsReportClient.render(
                {
                    template: { &quot;shortid&quot;: jsReportShortId},
                    data: reportData,
                    options: { reports: { save: false } }
                }, 
                { 
                    timeout: 180000 
                });
        
        // Save PDF report
        renderedPDF = await res.body();
        
        // Code to save to S3 goes here .....

    }
    catch (err) {
        
        // Show error
        console.log(&quot;Error getting report from JSReport Online API endpoint&quot;);
        console.log(err);

        // Otherwise, just close out callback
        callback(null, 'Error Callback');
    }
</code></pre>
<p>For the report in question, sometimes this works without any issue.  However, other times I get the following error:</p>
<pre><code>2020-01-20 06:01:41.033 Error: connect ECONNREFUSED 127.0.0.1:16784
    at /var/task/processJSReport/node_modules/jsreport-client/lib/client.js:62:29
    at /var/task/processJSReport/node_modules/jsreport-client/lib/client.js:115:40
    at ConcatStream.&lt;anonymous&gt; (/var/task/processJSReport/node_modules/concat-stream/index.js:36:43)
    at ConcatStream.emit (events.js:215:7)
    at ConcatStream.emit (domain.js:476:20)
    at finishMaybe (/var/task/processJSReport/node_modules/readable-stream/lib/_stream_writable.js:630:14)
    at afterWrite (/var/task/processJSReport/node_modules/readable-stream/lib/_stream_writable.js:492:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  remoteStack: 'Error: connect ECONNREFUSED 127.0.0.1:16784\n' +
    '    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)'
}
</code></pre>
<p>I've also received the following error:</p>
<pre><code>2020-01-20 06:26:21.052 Error: socket hang up
    at /var/task/processJSReport/node_modules/jsreport-client/lib/client.js:62:29
    at /var/task/processJSReport/node_modules/jsreport-client/lib/client.js:115:40
    at ConcatStream.&lt;anonymous&gt; (/var/task/processJSReport/node_modules/concat-stream/index.js:36:43)
    at ConcatStream.emit (events.js:215:7)
    at ConcatStream.emit (domain.js:476:20)
    at finishMaybe (/var/task/processJSReport/node_modules/readable-stream/lib/_stream_writable.js:630:14)
    at afterWrite (/var/task/processJSReport/node_modules/readable-stream/lib/_stream_writable.js:492:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  remoteStack: 'Error: socket hang up\n' +
    '    at createHangUpError (_http_client.js:342:15)\n' +
    '    at Socket.socketOnEnd (_http_client.js:437:23)\n' +
    '    at emitNone (events.js:111:20)\n' +
    '    at Socket.emit (events.js:208:7)\n' +
    '    at endReadableNT (_stream_readable.js:1064:12)\n' +
    '    at _combinedTickCallback (internal/process/next_tick.js:139:11)\n' +
    '    at process._tickCallback (internal/process/next_tick.js:181:9)'
}
</code></pre>
<p>Is there something that I must do to ensure that the report runs successfully each time?</p>
]]></description><link>https://forum.jsreport.net/post/6504</link><guid isPermaLink="true">https://forum.jsreport.net/post/6504</guid><dc:creator><![CDATA[Rogelio Arichabala]]></dc:creator><pubDate>Mon, 20 Jan 2020 06:50:53 GMT</pubDate></item><item><title><![CDATA[Reply to jsreportonline connect ECONNREFUSED &#x2F; socket hang up on Invalid Date]]></title><description><![CDATA[<blockquote>
<p>One of my reports has a lot of data and it therefore may take 30 sec or more to process in jsreportonline. Because of that, I've moved the report rendering to a worker process in AWS Lambda that, when complete, saves the report into my S3 bucket.</p>
</blockquote>
<p>I am not sure I get it right. You moved the rendering to the lambda, but the mentioned errors are from jsreportonline?<br />
You want to solve the jsreportonline issue and don't use lambda? Or you still use lambda in a combination with jsreportonline?<br />
Or you use just lambda and this error is from it? Please elaborate on the details.</p>
]]></description><link>https://forum.jsreport.net/post/6508</link><guid isPermaLink="true">https://forum.jsreport.net/post/6508</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to jsreportonline connect ECONNREFUSED &#x2F; socket hang up on Tue, 21 Jan 2020 01:29:58 GMT]]></title><description><![CDATA[<p>Sorry, let me clarify.  Let's forget about Lambda for now.  Basically, when I make the request to jsreportonline for the report in question, because of the amount of data, jsreportonline fails with one of the above errors.  The failure happens at the following line:</p>
<pre><code>const res = await jsReportClient.render(
</code></pre>
<p>The threshold seems to be somewhere around 30 seconds.  For the given report, if the data included in the <code>.render()</code> statement causes jsreportonline to process for around 30sec or more, the request fails and <code>.render()</code> throws one of the errors above.  If the data included causes jsreportonline to process for under 30 seconds, the SAME report renders without any issues.</p>
<p>Bottom line, long running requests into <code>.render()</code> (30 sec or more) seem to fail with one of the above two errors.  I assumed it was a timeout issue with <code>.render()</code> and that therefore, adding <code>{timeout:180000}</code> into the call would have fixed it.  However, that doesn't seem to have done anything.</p>
<p>I've been using lambda to make requests into jsreportonline by using <code>client.render()</code> without any issues for some time now.  I will continue to use lambda to make calls to jsreportonline.   However, it wasn't until recently, when one of my clients had a lot of data for this particular report that this issue arose.</p>
<p>Note, I've also tested this by running the same <code>client.render()</code> request, with the same large data set &amp; report, through a cloud9 AWS nodejs app and received the same error.  So it doesn't appear to be relevant to lambda.</p>
]]></description><link>https://forum.jsreport.net/post/6511</link><guid isPermaLink="true">https://forum.jsreport.net/post/6511</guid><dc:creator><![CDATA[Rogelio Arichabala]]></dc:creator><pubDate>Tue, 21 Jan 2020 01:29:58 GMT</pubDate></item><item><title><![CDATA[Reply to jsreportonline connect ECONNREFUSED &#x2F; socket hang up on Invalid Date]]></title><description><![CDATA[<p>Thank you for the details. Could you email me your jsreport online subdomain/tenant name?<br />
I would search our logs and check it out.<br />
<a href="mailto:jan.blaha@jsreport.net" rel="nofollow">jan.blaha@jsreport.net</a><br />
Thank you</p>
]]></description><link>https://forum.jsreport.net/post/6516</link><guid isPermaLink="true">https://forum.jsreport.net/post/6516</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>