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

putStream Error: read ECONNRESET #296

Open
dylanjha opened this issue Jan 9, 2016 · 0 comments
Open

putStream Error: read ECONNRESET #296

dylanjha opened this issue Jan 9, 2016 · 0 comments

Comments

@dylanjha
Copy link

dylanjha commented Jan 9, 2016

Love knox ❤️

var http = require("http");
var https = require("https");

//use either http or https, depending on url protocol
http.get(url, function (res) {
  var headers = {
    'Content-Length': res.headers['content-length'],
    'Content-Type': res.headers['content-type'],
    'x-amz-acl': 'public-read'
  };
  var s3Req = s3Client.putStream(res, "/file-path", headers, function (error, res) {
    if(error) {
      return console.log("Error", error);
    } else {
      res.resume();
      res.on("end", function() {
        console.log("ENDED");
      });
      res.on("error", function() {
        console.log("Error");
      });
    }
  });
  s3Req.on("error", function(error) {
    console.log("s3Req Error", error);
  });
});

I'm using this script to backfill a bunch of URLs to s3. This script works fine for uploading the first ~1,100 but I ultimately need to do about ~80,000

Once it uploads the first 1,000 it throws this error:

events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: read ECONNRESET
  at exports._errnoException (util.js:746:11)
  at TCP.onread (net.js:550:26)

I'm fairly new to node so please forgive me if I'm missing something obvious here.

I found these issues here that I think are related #259 #198 but after struggling with it and trying different things I didn't come to a solution.

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

1 participant