Azure / azure-storage-php

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

SSL: Connection reset by peer on getBlob() #173

Open NavyCoat opened 5 years ago

NavyCoat commented 5 years ago

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

Blob

Which version of the SDK was used?

1.2.0

What's the PHP/OS version?

7.2 / Ubuntu 18

What problem was encountered?

Exception throw while executing this line: $blob = $this->proxy->getBlob($this->container, $filename);

I'm using DefaultEndpointsProtocol=https

Fatal error: Uncaught RuntimeException: Error creating resource: [message] fopen(): SSL: Connection reset by peer
[file] /vagrant/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
[line] 323
[message] fopen(https://storage.blob.core.windows.net/priv/image.jpg): failed to open stream: HTTP request failed! 
[file] /vagrant/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
[line] 323 in /vagrant/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 52

Steps to reproduce the issue?

Try to receive over 20 blobs, I almost always get this error for at least one resource.

Have you found a mitigation/solution?

Nope 😞

katmsft commented 5 years ago

Hi,

This issue is currently being investigated. Please stay tuned.

NavyCoat commented 5 years ago

Thanks @katmsfT

Today I get a problem with sending data.

GuzzleHttp\Exception\RequestException: Error creating resource: [message] fopen(): SSL: Connection reset by peer
[file] /vagrant/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
[line] 323
[message] fopen(https://storage.blob.core.windows.net/priv-pdf/9abfb248c7b2379dad1b9d122b73c733): failed to open stream: HTTP request failed!
[file] /vagrant/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
[line] 323

/vagrant/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:52
/vagrant/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php:67
/vagrant/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:52
/vagrant/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php:37
/vagrant/vendor/guzzlehttp/guzzle/src/Middleware.php:36
/vagrant/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php:70
/vagrant/vendor/guzzlehttp/guzzle/src/Middleware.php:60
/vagrant/vendor/guzzlehttp/guzzle/src/HandlerStack.php:67
/vagrant/vendor/guzzlehttp/guzzle/src/Client.php:277
/vagrant/vendor/guzzlehttp/guzzle/src/Client.php:99
/vagrant/vendor/microsoft/azure-storage-common/src/Common/Internal/ServiceRestProxy.php:373
/vagrant/vendor/microsoft/azure-storage-common/src/Common/Middlewares/MiddlewareBase.php:62
/vagrant/vendor/microsoft/azure-storage-common/src/Common/Internal/ServiceRestProxy.php:385
/vagrant/vendor/microsoft/azure-storage-blob/src/Blob/BlobRestProxy.php:3730
/vagrant/vendor/microsoft/azure-storage-blob/src/Blob/BlobRestProxy.php:3656
katmsft commented 5 years ago

There are several retry scenarios that are missing in the retry middleware, including the SSL connection reset and failed to open stream scenarios. This has been added to our backlog. Also, don't hesitiate if you want to raise a PR regarding this issue, we welcome community contributions.

Vandersteen commented 4 years ago

What is the status on this one ?

Imperatorn commented 3 years ago

Also got a similar problem today when trying to put BlockBlob :(

TomBertie commented 3 years ago

This is really irritating, is there any view on when a fix will be in place?

katmsft commented 3 years ago

This repository do welcome community contribution. Feel free to email and discuss a potential contribution to enhance the retry logic if you are interested!

paaaaaaaaaa commented 2 years ago

All of a sudden I starting seeing this issue a lot. It's like there is some serious network issue happening at the storage account. Retries work but that is just papering over the cracks.

I have found a solution that appears to be working for me, although it could be complete coincidence. I have set my storage account to use a minimum TLS version of 1.2.

image