emilio
emilio

Reputation: 11

nodejs azure createBlockBlobFromLocalFile timeout

I'm trying to upload an mp4 video file to Azure. I am working with Node.js.

If the file is small it works fine, but if it is big (more than 10 mb) it gives me this error:

ESOCKETTIMEDOUT

this is the function I use:

blobService.createBlockBlobFromLocalFile(container, file.name, file.path, options,
                    function (error, result, response) {
                        try {
                            if (error) {
                                console.log('***** ERROR file NOT uploaded! ' + JSON.stringify(error));
                                reject(error);
                            }
                            if (!response.isSuccessful) {
                                reject({error: 'Failed to create blob.'});
                            }
                            console.log('***** createBlockBlobFromLocalFile FILE uploaded! ');
                            resolve();
                        } catch (error) {
                            console.log('***** ERROR file NOT uploaded! ' + JSON.stringify(error));
                            reject(error);
                        }
                    })

Please can someone help me?

Thank you so much. Emi

Upvotes: 1

Views: 741

Answers (2)

emilio
emilio

Reputation: 11

As suggested by Sandeep br I applied retry filter on client library side and it worked with a file of 116 MB.

var blobService = azure.createBlobService(
        azureContainer.Credentials.storageAccount,
        azureContainer.Credentials.accessKey
        ).withFilter(retryOperations);

Thank you very much !

Upvotes: 0

sandeep br
sandeep br

Reputation: 11

The socket timeout usually happens when network is poor or network in heavy usage. Try to add retry filter on client library side.

Refer : https://azure.github.io/azure-storage-node/ExponentialRetryPolicyFilter.html

Refer the similar discussion over the GitHub .

Upvotes: 1

Related Questions