Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Error: socket hang up #73

Open
NickHeiner opened this Issue · 22 comments
@NickHeiner

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

image

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

@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)
            }
        });
    }
@pifantastic
Owner

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

@NickHeiner

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.

@pifantastic
Owner

hmm, good point about knox. There is this issue: Automattic/knox#116

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

@NickHeiner

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

@NickHeiner

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

@dylang

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.

@jansepar

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

@katowulf

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

@rhymeswithcycle

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

@geedew

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

@bradhouse

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

@tjwebb

+1 same problem. only uploading a couple dozen files

@lucasdavila

+1 this intermittent error happens with node v0.10.22 and grunt grunt-s3@0.2.0-alpha.2, grunt-s3@0.2.0-alpha.3 (on mac os x maveriks).

@rvera

+1 still happening

@filR

+1

@jahed

+1

@cperryk

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.