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

Multipart Upload failed #762

Closed
fkizewski opened this issue Sep 14, 2015 · 7 comments
Closed

Multipart Upload failed #762

fkizewski opened this issue Sep 14, 2015 · 7 comments

Comments

@fkizewski
Copy link

Hi all.

I've just started to use this sdk.
I would like to upload large file on my bucket, so i use multipart upload described here: http://docs.aws.amazon.com/aws-sdk-php/v3/guide/service/s3-multipart-upload.html

This is my source code:

<?php
require 'vendor/autoload.php';

use Aws\S3\S3Client;
use Aws\S3\MultipartUploader;
use Aws\Exception\MultipartUploadException;

$s3Client = new S3Client([
    'version'     => 'latest',
    'region'      => 'eu-west-1',
    'credentials' => [
        'key'    => 'myKey',
        'secret' => 'mySecret'
    ]
]);

$source = fopen('/var/www/bigfile.mp4', 'rb');
$uploader = new MultipartUploader($s3Client, $source, [
    'bucket' => 'mydestbucket',
    'key'    => 'tmp/bigfile.mp4'
]);

do {
    try {
        $result = $uploader->upload();
    } catch (MultipartUploadException $e) {
        $uploader = new MultipartUploader($s3Client, $source, [
            'state' => $e->getState(),
        ]);
    }
} while (!isset($result));
?>

The size of my file is 9.8GB. Sometimes the upload is done with succes, but very often it's fails.
The exception is:

Fatal error: Uncaught exception 'GuzzleHttp\Promise\RejectionException' with message 'The promise was rejected with reason: Invoking the wait callback did not resolve the promise' in /var/www/vendor/guzzlehttp/promises/src/functions.php:106 Stack trace: #0 /var/www/vendor/guzzlehttp/promises/src/functions.php(490): GuzzleHttp\Promise\exception_for('Invoking the wa...') #1 /var/www/vendor/guzzlehttp/promises/src/Promise.php(199): GuzzleHttp\Promise\{closure}('Invoking the wa...') #2 /var/www/vendor/guzzlehttp/promises/src/Promise.php(152): GuzzleHttp\Promise\Promise::callHandler(2, 'Invoking the wa...', Array) #3 /var/www/vendor/guzzlehttp/promises/src/TaskQueue.php(60): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}() #4 /var/www/vendor/guzzlehttp/promises/src/Promise.php(228): GuzzleHttp\Promise\TaskQueue->run() #5 /var/www/vendor/guzzlehttp/promises/src/Promise.php(261): GuzzleHttp\Promise\Promise->waitIfPending() #6 /va in /var/www/vendor/guzzlehttp/promises/src/functions.php on line 106

Could you please help me to resolve this problem. I think it's from the sdk.
Thanks.
Regards Fabrice

@jeskew
Copy link
Contributor

jeskew commented Sep 14, 2015

What version of the SDK are you using?

@fkizewski
Copy link
Author

Sorry, i forget to put it: 3.3.5

@jeskew
Copy link
Contributor

jeskew commented Sep 15, 2015

Any information you can provide about your execution environment would be helpful. I'm unable to reproduce using the default HTTP handler with the following stack:

SDK: 3.3.5
PHP: 5.6.12
Guzzle: 6.1.0
cURL 7.43.0
OSX: 10.10.5

@jeskew jeskew added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. v3 labels Sep 15, 2015
@fkizewski
Copy link
Author

Hi Jonathan.
Thanks to try to help me.

I've just find my error: because it's a stream, it's necessary to rewind the stream into the exception! So now all is ok.

Please close this issue.

Best regards, Fabrice

@jeskew jeskew removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Sep 18, 2015
@jeskew
Copy link
Contributor

jeskew commented Sep 18, 2015

Well, I think the error message could use some work. Let me see if I can surface the exact issue more explicitly.

@fkizewski
Copy link
Author

This is a good idea to be more clear :)

@jeskew
Copy link
Contributor

jeskew commented Oct 15, 2015

The underlying issue was resolved upstream in https://github.com/guzzle/promises/releases/tag/1.0.3 .

Please feel free to reopen if you have any questions or concerns.

@jeskew jeskew closed this as completed Oct 15, 2015
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

2 participants