Open udf2457 opened 5 years ago
Thanks for feedback! We have built-in retry middlewares see https://github.com/Azure/azure-storage-php/blob/master/azure-storage-common/src/Common/Middlewares/RetryMiddleware.php and https://github.com/Azure/azure-storage-php/blob/master/azure-storage-common/src/Common/Middlewares/RetryMiddlewareFactory.php
The built-in retry logic supports retrying with customized retry count, timeout, and it should retry for server errors (5xx) and network errors (like the cURL you mentioned). The retry decider is defined here:
You can inherit RetryMiddlewareFactory
and overload the createRetryDecider
method to customize the logic.
I agree that cURL 56 is kind of network error and should be retried, and also curious about why it doesn't get retired. If it's not, that's a bug we should fix.
@XiaoningLiu any update on this?
@BenWalters Can you share your error logs?
@XiaoningLiu
"class": "GuzzleHttp\\Exception\\RequestException",
"message": "cURL error 56: OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104 (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)",
"code": 0,
"file": "/var/www/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:201",
"trace": [
"/var/www/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:155",
"/var/www/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:105",
"/var/www/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php:201",
"/var/www/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php:130",
"/var/www/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php:145",
"/var/www/vendor/guzzlehttp/promises/src/Promise.php:248",
"/var/www/vendor/guzzlehttp/promises/src/Promise.php:224",
"/var/www/vendor/guzzlehttp/promises/src/Promise.php:269",
"/var/www/vendor/guzzlehttp/promises/src/Promise.php:226",
"/var/www/vendor/guzzlehttp/promises/src/Promise.php:62",
"/var/www/vendor/microsoft/azure-storage-blob/src/Blob/BlobRestProxy.php:3018",
"/var/www/vendor/league/flysystem-azure-blob-storage/src/AzureBlobStorageAdapter.php:237",
"/var/www/vendor/league/flysystem-azure-blob-storage/src/AzureBlobStorageAdapter.php:152",
"/var/www/vendor/league/flysystem/src/Filesystem.php:57",
"/var/www/vendor/league/flysystem/src/Filesystem.php:98",
"/var/www/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php:231",
That's using
Track this in next release.
Thanks @XiaoningLiu, what are you proposing as a solution?
Will add retry RequestException mentioned in default retry policy.
@XiaoningLiu thanks, do you have any idea of the root cause of the failure in the first instance?
No. Looks like a network or SSL error which is reported from curl underlayer.
@XiaoningLiu sorry for the questions! I've been working with MS Azure Support in an attempt to better understand this issue and pin point where the problem is. Retrying is a 'get out of jail free' way of handling this problem. But it can mask underlaying issues. Do you believe this could be a provide with the Storage service? (FYI, our application is hosting on Azure WebApps)
Not sure but pretty less possbility it's an issue from Storage service. I don't see other reported issues to Stoage service like that.
@XiaoningLiu Any news on this one?
Not yet. It's still in our backlog and has been triaged in last time. We will keep monitor this and plan with other requests. In the same time, contribtion is welcome.
Also frequently receive this error.. its not an enhancement but a critical error please treat it as such... no point using cloud services if they fail on medium size files... use PHP Laravel Forge "microsoft/azure-storage-blob": "1.5.1",
At the moment there seems to be very little (if any ?) retry logic. Retry logic is somewhat critical when dealing with cloud services, therefore I would urge you not to ignore it when coding (it should be there from the start, not an afterthought).
For example, it is not uncommon to see
azure-storage-php
failing with:From the cURL website:
This is therefore a prime example of why correct retry logic is so critical.
If I am uploading large files,
azure-storage-php
failing without retrying is pretty useless.Also
ServiceException
does not report the cURL example shown above ?? The cURL exception is unhandled by theazure-storage-php
code.