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
S3 multipart upload always fails silently (v2) #674
Comments
Thanks for reporting this. It may take us some time to look into it and try to reproduce the issue. If we have any follow up questions, we'll let you know. |
Also, if you have the time and desire to try out the multipart uploader in Version 3, that would help us determine if the issue is isolated to just Version 2. The V3 docs for this feature are here. |
Ended up using the Ruby SDK to upload the original 7G file. It worked the first time, though apparently without concurrency. Just tested PHP SDK v3 on a different server with PHP 5.5. With the region an empty string, I got: With the region set explicitly to the default value, the script exits with a fatal error: I'm not calling promise() directly. Just using basic upload from: http://docs.aws.amazon.com/aws-sdk-php/v3/guide/service/s3-multipart-upload.html |
Thanks for giving that a shot. We'll have to do some research into this. |
We're also seeing the |
It is also happening to v3 and with pretty small files (in my case 3KB file). Exception: |
@teseo can you post the full exception message? |
Exception message:
Exception Trace:
|
@teseo It looks like one of the parts did not upload successfully within the configured retry limits on your client. You can keep track of upload state and retry the unsuccessful uploads: $source = '/path/to/large/file.zip';
$uploader = new MultipartUploader($s3Client, $source, [
'bucket' => 'your-bucket',
'key' => 'my-file.zip',
]);
do {
try {
$result = $uploader->upload();
} catch (MultipartUploadException $e) {
$uploader = new MultipartUploader($s3Client, $source, [
'state' => $e->getState(),
]);
}
} while (!isset($result)); It sounds like you're using a multipart upload for very small files, which would make your code more complex than it needs to be. If you're not sure whether an object is large enough to warrant a multipart upload, you could try using the |
Hello Jeskew, Thank you very much for the responses. My current code looks like this:
|
I can see int the S3Client upload method the next:
When I used it and I was passing the path to a large file, it understood I tried to send a text file with the location of the large file as content. |
I can also see that MultipartUploader extends from AbstractUploader class and this class uses the method determineSource to manipulate the $source variable like this:
Without determining what source it is. I don't know if this is for a reason or is a bug. |
@teseo The multipart uploader will accept a path for backwards-compatibility reasons, but there was no such BC concern on |
@jeskew from your response, what would be the ideal way to upload a few Gigs file, through |
@teseo You should call |
I still get the same results with 2.8.19: the last set of parts does not upload, and the operation ends with no error. |
Ah I didn't realize you were still on v2. |
@jeskew passing fopen to S3Client worked perfectly for me. It could be great to specify in the documentation fopen('/path-to-file.ext') insteand of '/path-to-file.ext' when calling S3Client. Thanks for your support! |
After doing some more research, I was unable to reproduce the error exactly as described, but I did observe a multipart upload entering a "hanging" state wherein a curl_multi_select call would never resolve. (Something similar is described in this SO post.) I was unable to force the v3 multipart uploader to trigger a similar error after extensive testing, and the
|
Closing, as there hasn't been any recent activity and all signs point to the initial diagnosis (something going on with curl_multi) being correct. The "hanging" described above only happened after I downgraded to PHP 5.4 and went away when I reinstalled a current version of PHP, so that could be tried if the issue pops up again. Please feel free to reopen if you have any questions or concerns. |
Trying to upload a 7G file to S3 using SDK v2.8.12 on PHP 5.4.40. File uploads less than 5G work great, but multipart uploads have never worked. They always end with no message or error at all (bypassing
register_shutdown_function
), usually just before the upload should complete.Appears to be a problem with cURL multi. Usually, execution ends just before uploading the last group of parts.
I have full S3 access.
Code is nothing special:
The text was updated successfully, but these errors were encountered: