Azure / azure-storage-php

Microsoft Azure Storage Library for PHP
MIT License
217 stars 198 forks source link

Exceptions while uploading big file >1G #306

Closed pimjansen closed 2 years ago

pimjansen commented 3 years ago

Which service(blob, file, queue, table) does this issue concern?

blob

Which version of the SDK was used?

1.5.2

What's the PHP/OS version?

root@4f741507c90e:/app# lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 10 (buster) Release: 10 Codename: buster Env: Docker

What problem was encountered?

cURL error 56: OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104 (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

Steps to reproduce the issue?

We are using flysystem-azure-adapter. After investigating there it seems that the proxy works fine but the SDK throws an error. I am trying to upload a file (1.5G) which causes the error. Smaller files work correct

Have you found a mitigation/solution?

No

Is there a failing request ID related to this problem returned by server? What is it?

No

What is the storage account name and time frame of your last reproduce? (UTC YYYY/MM/DD hh:mm:ss)

oerknalblobstorage approx: 2021/08/20 14:37 UTC

(If you think some of the information should not be shared publicly, you can e-mail the main Microsoft contributors of the repository instead.)


After doing my own debugging on the SDK itself it seems that some chunks fail to process. At the end when one of the chunks has failed all is returns as an error. Seems that chunks that fail also do not retry?

Fulfilled: 67
Fulfilled: 63
Fulfilled: 69
Fulfilled: 68
Denied: 76
GuzzleHttp\Exception\RequestException: cURL error 56: OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104 (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in /app/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:201
Stack trace:
#0 /app/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(155): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 /app/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(105): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlMultiHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))

# Checked it with below:
$eachPromise = new EachPromise($promises, [
    'concurrency' => $options->getNumberOfConcurrency(),
    'fulfilled' => function ($response, $index) use ($statusCode) {
        echo 'Fulfilled: '.$index.PHP_EOL;
        //the promise is fulfilled, evaluate the response
        self::throwIfError(
            $response,
            $statusCode
        );
    },
    'rejected' => function ($reason, $index) {
        echo 'Denied: '.$index.PHP_EOL;
        echo $reason.PHP_EOL;
        //Still rejected even if the retry logic has been applied.
        //Throwing exception.
        throw $reason;
    }
]);