node.js - Sudden ECONNRESET error -


i have nodejs/express app downloads csv , parses it. must have changed on external website download file, of calls returning error - after making request.

[2017-09-12t14:55:26.032z] { error: read econnreset     @ exports._errnoexception (util.js:1026:11)     @ tcp.onread (net.js:564:26) code: 'econnreset', errno: 'econnreset', syscall: 'read' } [2017-09-12t14:55:26.033z] { error: socket hang     @ createhanguperror (_http_client.js:252:15)     @ socket.socketonend (_http_client.js:344:23)     @ emitnone (events.js:91:20)     @ socket.emit (events.js:185:7)     @ endreadablent (_stream_readable.js:974:12)     @ _combinedtickcallback (internal/process/next_tick.js:74:11) 

however when copy , paste csv link chrome browser, downloads file (although after small delay). it's 1 of downloads chrome can't how big file until file downloaded. tested on couple of machines, , link works no problems. exact same link, there no login popups or that.

the link contains username , password.

can think of have changed on external website causing this? how work around it? tried increasing timeout on request doesn't - doesn't feel timeout issue anyway since econnreset error appears immediately.

my request code:

console.log("url:" + myurl) var writestream = fs.createwritestream(racksdownloadpath.concat(aname).concat('.csv'));     writestream.on('finish', function() {         console.log(aname.concat(' downloaded'));         loadcsv(aname);     })     request({         method: 'get',         uri: myurl,         body: $.param(fd)     }).pipe(writestream) 


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -