Aws-sdk-js: S3 upload() Function Has Requests Cancelled During Upload

Created on 15 Jul 2015  路  4Comments  路  Source: aws/aws-sdk-js

I recently downloaded the latest version of the JavaScript in the browser AWS SDK. I've been trying to implement the S3 upload() method (which uses concurrent upload streams). On larger files, usually files > 50 MB, the multiple PUT requests that the function initiates are cancelled a few seconds after they are started. I've tried using two different releases from the 2.1.XX family of builds (2.1.35 and 2.1.38) and have encountered the same error.

I've attached three items to this post. The first image shows the multiple PUT requests being cancelled a few seconds after they are made (the uploaded file is a 142 MB .MOV file). I've also included two images that show what my code related to the upload looks like. The first shows the upload() method being implemented in a larger function that uploads my video. The second shows the parameters being generated - which are then injected into the upload() method.

I've noticed the putObject() method (which does not use concurrent upload streams) to be more reliable in the 2.1.XX family of builds, although it also has issue, albeit much more rarely, of having the PUT request cancelled. I had been using version 2.0.11 where I've had little issue with the putObject() method. I believe the upload() method wasn't available in this previous build.

puts_cancelled
upload_function
generate_parameters

guidance

Most helpful comment

Found the problem after some digging. I didn't have <ExposeHeader>ETag</ExposeHeader> set in my bucket's CORS permissions. For some reason, this didn't cause an issue with putObject() in version 2.0.11, but did cause the requests to be cancelled in the newer builds.

All 4 comments

@pihish I tried to reproduce the issue with both v2.1.35 and v2.1.38 of the SDK and large (> 1 GB) files. I have not been able to reproduce it on Chrome 43.0+ and Firefox 38.1+. Which browser version are you using? This looks like it may be a transient network issue or more likely a browser issue.

@AdityaManohar I am able to use putObject() to upload the same files on the same test build with version 2.0.11 so I don't think it's related to network interference or browser version (I am running the latest stable release of Chrome on a Windows 7 machine). Would it help if I gave you temp credentials to the test server so you can test it in my environment first hand?

Found the problem after some digging. I didn't have <ExposeHeader>ETag</ExposeHeader> set in my bucket's CORS permissions. For some reason, this didn't cause an issue with putObject() in version 2.0.11, but did cause the requests to be cancelled in the newer builds.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

Was this page helpful?
0 / 5 - 0 ratings