DOCX recipe on server-less lambda socket hang up error



  • DOCX recipe on server-less lambda whenever data is larger than 1mb getting the following error

    {
    "errorType": "Error",
    "errorMessage": "socket hang up",
    "code": "ECONNRESET",
    "cause": {
    "errorType": "Error",
    "errorMessage": "socket hang up",
    "code": "ECONNRESET",
    "stack": [
    "Error: socket hang up",
    " at connResetException (internal/errors.js:570:14)",
    " at Socket.socketOnEnd (_http_client.js:440:23)",
    " at Socket.emit (events.js:228:7)",
    " at Socket.EventEmitter.emit (domain.js:475:20)",
    " at endReadableNT (_stream_readable.js:1185:12)",
    " at processTicksAndRejections (internal/process/task_queues.js:81:21)"
    ]
    },
    "isOperational": true,
    "weak": true,
    "logged": true,
    "stack": [
    "Error: socket hang up",
    " at connResetException (internal/errors.js:570:14)",
    " at Socket.socketOnEnd (_http_client.js:440:23)",
    " at Socket.emit (events.js:228:7)",
    " at Socket.EventEmitter.emit (domain.js:475:20)",
    " at endReadableNT (_stream_readable.js:1185:12)",
    " at processTicksAndRejections (internal/process/task_queues.js:81:21)"
    ]
    }



  • UPDATE, i changed configuration to below and it seems to work, please guide me if this is a right strategy
    "templatingEngines": {
    "timeout": 900000,
    "allowedModules": "*",
    "strategy": "in-process",
    "numberOfWorkers": 20
    },



  • This error likely signals OOM. You will likely have crashes with the in-process strategy as well when you increase the data.
    Fortunately, we have docx optimizations ready and we ship it along with the jsreport@2.7.0 in few days.

    You should be able to get the updated recipe already now using

    npm i jsreport-docx@2.5.0
    

Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.