Upload connection aborted

Archived from the Transloadit support forum. Originally posted on April 22, 2014; details may be outdated, see our docs for current behavior. Original thread

Can I get the definitive on the full meaning and situation behind these errors? This is the most commonly occurring one for us.

G

Hi Gavin,

This is the involved code

C.REQUEST_ABORTED = {
  httpCode: 200,
  message: 'The upload connection was closed or timed out before receiving all data.'
};

It is only called by two places in our api. The first one is a sanity check that sees if there were any bytes transmitted in 2 minutes:

    if (assembly.bytesReceived === 0) {
      assembly.requestAbort();
    }
  }, 120 * 1000);

The second one is if node-formidable (our multipart handler) sends the aborted event (https://github.com/felixge/node-formidable):

Emitted when the request was aborted by the user. Right now this can be due to a ‘timeout’ or ‘close’ event on the socket. In the future there will be a separate ‘timeout’ event (needs a change in the node core).

So our server is still online (otherwise it could not create the REQUEST_ABORTED, and another processes would mark it as ASSEMBLY_CRASHED after a TTL of no activity has passed), but the client stopped sending data.

How often does this happen, and are your customers typically on mobile by any chance? Because one possible scenario is that they are in the train, switching cell-towers every x minutes, dropping and re-establishing their connection x as many times.
That would tear down any steaming uploads. The bigger the uploaded files, the more likely they are interrupted by the fragile nature of the networks that are mobile.

The way to defeat this is having retries / resumable uploads. We’re in the process of creating an open protocol for that (tus.io) but more research & time is required before this will find it’s way back to our main product.

Let me know if this helps and if you have more questions.

Best,
Kevin

Thank you for the most thorough response.

In fact our users are all on desktops on varying degrees of broadband scattered throughout the US.

We’ll keep an eye open,

G

Alright sounds good, Gavin.

Closing this then for the time being.