grunt-s3 icon indicating copy to clipboard operation
grunt-s3 copied to clipboard

Error: socket hang up

Open NickHeiner opened this issue 11 years ago • 24 comments

I sometimes get socket errors when trying to push content to s3:

image

Why does this happen? It seems to be non-deterministic.

NickHeiner avatar Jun 05 '13 17:06 NickHeiner

As a hacky workaround, I've broken it up into smaller sets of files on each task. That seems to solve the problem.

    function makeSubTasks(dir) {
        grunt.file.expand(path.join(dir, '*')).forEach(function(dir) {
            grunt.config('s3.' + dir + '.upload', uploadsOfDir(dir));
        });
    }

    makeSubTasks(devRoot);

    // it's kinda shitty to have to do this on grunt.initConfig(), because
    // scanning all the files is slow and putting it there means that
    // we will do it every time the user types `grunt`
    function uploadsOfDir(dir) {

        var files = grunt.file.expand(path.join(dir, '**', '*.*'));

        return files.map(function(file) {
            return {
                src: file,
                dest: path.sep + file.split(path.sep).slice(1).join(path.sep)
            }
        });
    }

NickHeiner avatar Jun 05 '13 17:06 NickHeiner

Yeah, I've witnessed this too. I imagine it's just s3 being finicky. I've considered adding automatic retry to everything.

pifantastic avatar Jun 05 '13 17:06 pifantastic

Interesting. Is it possibly related to knox? s3 is supposed to be able to handle huge uploads, right? How can it be failing for < 500 files?

Automatic retrying sounds reasonable.

NickHeiner avatar Jun 05 '13 18:06 NickHeiner

hmm, good point about knox. There is this issue: https://github.com/LearnBoost/knox/issues/116

Have you tried grunt-s3 0.2.0-alpha.2? It uses a version of knox that has the fix from that issue.

pifantastic avatar Jun 05 '13 18:06 pifantastic

I have been using that version of grunt-s3, and I'm still getting the same issue.

NickHeiner avatar Jun 11 '13 19:06 NickHeiner

I think that this problem exists for node 0.10.6 but not 0.10.10.

NickHeiner avatar Jun 12 '13 19:06 NickHeiner

I can repeat the problem with grunt-s3 0.2.0-alpha.2 and Node 0.10.10. It doesn't happen all the time, just sometimes.

dylang avatar Jun 12 '13 21:06 dylang

This issue is happening constantly for me as well with a large amount of files.

jansepar avatar Jun 21 '13 00:06 jansepar

+1 Had not seen this error before a month ago, now it's happening on every upload.

katowulf avatar Jun 26 '13 17:06 katowulf

+1 happens intermittently but frequently with grunt-s3 0.2.0-alpha.2 and Node 0.10.11

michaelmulley avatar Jun 27 '13 15:06 michaelmulley

I think (theoretically) this is due to not calling .end() on the knox calls. I'm playing with fixing this too.

geedew avatar Jul 03 '13 15:07 geedew

Any updates/fixes for this one? It's happening consistently on uploading to S3 for me.

bradleydwyer avatar Jul 24 '13 16:07 bradleydwyer

+1 same problem. only uploading a couple dozen files

tjwebb avatar Aug 18 '13 02:08 tjwebb

+1 this intermittent error happens with node v0.10.22 and grunt [email protected], [email protected] (on mac os x maveriks).

lucasdavila avatar Jan 03 '14 13:01 lucasdavila

+1 still happening

rvera avatar Apr 14 '14 23:04 rvera

+1

YourDeveloperFriend avatar May 29 '14 22:05 YourDeveloperFriend

+1

filR avatar Jun 03 '14 00:06 filR

+1

jahed avatar Jun 03 '14 13:06 jahed

+1

mtharrison avatar Jun 10 '14 20:06 mtharrison

+1

cperryk avatar Jun 12 '14 03:06 cperryk

+1

joshparolin avatar Jun 13 '14 09:06 joshparolin

+1

jackryon avatar Jul 10 '14 17:07 jackryon

+1

voidabhi avatar Jul 13 '15 17:07 voidabhi

+1

jd327 avatar Oct 10 '15 21:10 jd327