4

I am using the npm package busboy to parse a multipart form request and a write stream to write the sent file to disc.

This works fine with small files, but when I try with a larger file (7MB) it seems that only about 5MB is written to disc and then it seems that things stall and it never finishes and no error is thrown. This works locally but when running on ECS is where the problem occurs.

The node server is running in a docker container on ECS

  pipeline(fileStream, fs.createWriteStream(filePath), (err) => {
    if (err) {
      console.log("Pipeline failed", err);
    } else {
      console.log("Pipleline complete");
    }
  });

Any ideas??

pizzarob
  • 11,711
  • 6
  • 48
  • 69

1 Answers1

2

I recently solved this by finding the HTTP status codes that were "behind the scenes" by enabling access logging. In my case it was a 413 status code.

There's several steps to set this up, and it changes from time to time. Check the docs here for the current steps & config: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html#enable-access-logging

Dan Levy
  • 1,214
  • 11
  • 14