Azure / azure-storage-php

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

Guzzle exception not being converted to ServiceException in `sendConcurrentAsync` #257

Open psdesse opened 4 years ago

psdesse commented 4 years ago

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

blob

Which version of the SDK was used?

microsoft/azure-storage-blob 1.5.1 (and previous version)

What's the PHP/OS version?

Debian 10 PHP 7.3.19

What problem was encountered?

When using a storage container that have an immutable policy and trying to override a big blob (more that 100MB to trigger the multiple async upload), the call to createBlockBlob raises a Guzzle exception whereas we would have expected a MicrosoftAzure\Storage\Common\Exceptions\ServiceException.

Steps to reproduce the issue?

  1. Create a blob that is bigger than 100MB
  2. Add an immutable policy on your container
  3. Call create again with createBlockBlob
  4. A Guzzle exception is raised and not a ServiceException

Have you found a mitigation/solution?

We have made a fork to fix the issue on the Azure library. Our fix is in azure-storage-common/src/Common/Internal/ServiceRestProxy.php:245. When using the function sendConcurrentAsync the error handling code is different from the error handling code in sendAsync. We updated the promise reject callback to to the same as in sendAsync.

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

N/A

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

N/A

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

katmsft commented 4 years ago

This is added to our backlog, thanks for raising the feature request.