locked
Connection reset when trying to download a blob larger then 32kb RRS feed

  • Question

  • Hi,

    I am using Azure storage API for Node.js (version 0.10.3) to download blobs.

    When trying to download a blob that is larger then 32kb, I get a node error of ECONNRESET. This is a problem with Node, when I downgrade Node to version 0.8.22, the operation takes 2 minutes but no error is thrown.

    Since I don't want to run Node in it's old version, I was wondering if there is Azure solution to this problem.

    It is surprising that downloading 31 kb takes milliseconds while downloading 32 kb takes minutes.

    Thanks,

    Ilona

    Wednesday, August 20, 2014 6:41 AM

Answers

  • Update: 

    The problem was with the write stream I was using, it was probably limited to 32 kb in some way.

    If anyone encounters this problem, I now use the node module MemoryStream https://www.npmjs.org/package/memorystream and the problem is solved.

    Thanks for the help

    Ilona

    • Marked as answer by ilobelo Sunday, August 24, 2014 10:36 AM
    Sunday, August 24, 2014 10:35 AM

All replies

  • Hello ilobelo,

    The error 'ECONNRESET' is most likely a connection problem. The error indicates that the client machine closed the TCP socket connection.
    There could be several reasons for the connection reset when downloading a blob from the storage using API.

    a. Timeouts, generally by default the download operation has a time limit of 90 seconds. If the blobs is not downloaded within this time it will reset connection.
    b. The Interenet connection is slow.

    Here are a couple of things that you can try to fix this issue.

    a. Try to add a BlobRequestOptions suggested within your code to increase the timeout. I am not aware of how this can be done within Jsnode.
    However, you can refer to the reply from Jeff Irwin posted on Wednesday, March 07, 2012 5:50 PM from this thread:

    http://social.msdn.microsoft.com/Forums/en-US/c0b89f4b-70d6-48f3-992b-81f5929558cd/blob-download-throws-transport-connection-closed-exception?forum=windowsazuredata

    b. Try to add a simple handler. You can refer to the response from 'Samson' on Jul 23 '13 at 8:38  from the thread below:

    http://stackoverflow.com/questions/17245881/node-js-econnreset
    Thanks,
    Syed Irfan Hussain

    Wednesday, August 20, 2014 10:21 AM
  • Thanks for the answer, the first solution (timeout) did not solve the problem,

    I don't think it's the issue since the file is only 32kb.

    I cannot implement the second suggestion, I don't open a connection manually, the API does that: 

    var blobService = azure.createBlobService('name',key);blobService.getBlobToStream(container, blobName, writer, {disableContentMD5Validation: true, timeoutIntervalInMs: 600000},  function(err, result,response) {  debugger;  if (err)    console.log(err);  else    console.log("success");});

    Also, what trying to use getBlobToLocalFile method, the file downloads completely in one second.

    Thanks!



    • Edited by ilobelo Thursday, August 21, 2014 7:10 AM
    Thursday, August 21, 2014 7:05 AM
  • Hello ilobelo,

    Thank you for your response. I am sorry that the two methods did not work for you. Ideally, it should not fail as its just a 32kb file.
    Please make sure that the JsNode website and the Blobs are on the same data Center. You can also create affinity groups. You can refer this article for more information on affinity groups:

    http://msdn.microsoft.com/en-us/library/azure/gg715317.aspx

    If this does not fix the issue. We might have a look at the backend logs. I suggest that you contact Windows Azure Techinical Support to look into this further.
    You can follow the link below to contact Support:

    http://azure.microsoft.com/en-us/support/options/

    Thanks,
    Syed Irfan Hussain

    Friday, August 22, 2014 2:33 PM
  • Update: 

    The problem was with the write stream I was using, it was probably limited to 32 kb in some way.

    If anyone encounters this problem, I now use the node module MemoryStream https://www.npmjs.org/package/memorystream and the problem is solved.

    Thanks for the help

    Ilona

    • Marked as answer by ilobelo Sunday, August 24, 2014 10:36 AM
    Sunday, August 24, 2014 10:35 AM