Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: socket hang up #73

Open
NickHeiner opened this issue Jun 5, 2013 · 24 comments
Open

Error: socket hang up #73

NickHeiner opened this issue Jun 5, 2013 · 24 comments

Comments

@NickHeiner
Copy link

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

image

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

@NickHeiner
Copy link
Author

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
Copy link
Owner

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

@NickHeiner
Copy link
Author

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
Copy link
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
Copy link
Author

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

@NickHeiner
Copy link
Author

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

@dylang
Copy link

dylang commented Jun 12, 2013

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
Copy link

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

@katowulf
Copy link

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

@michaelmulley
Copy link

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

@geedew
Copy link
Contributor

geedew commented Jul 3, 2013

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

@bradleydwyer
Copy link

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

@tjwebb
Copy link

tjwebb commented Aug 18, 2013

+1 same problem. only uploading a couple dozen files

@lucasdavila
Copy link

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

@rvera
Copy link

rvera commented Apr 14, 2014

+1 still happening

@YourDeveloperFriend
Copy link

+1

8 similar comments
@filR
Copy link

filR commented Jun 3, 2014

+1

@jahed
Copy link

jahed commented Jun 3, 2014

+1

@mtharrison
Copy link

+1

@cperryk
Copy link

cperryk commented Jun 12, 2014

+1

@joshparolin
Copy link

+1

@jackryon
Copy link

+1

@voidabhi
Copy link

+1

@jd327
Copy link

jd327 commented Oct 10, 2015

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests