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

Socket.php SSL3_WRITE_PENDING:bad write retry on Create() #31

Open
sammydeveille opened this issue May 6, 2016 · 1 comment
Open

Socket.php SSL3_WRITE_PENDING:bad write retry on Create() #31

sammydeveille opened this issue May 6, 2016 · 1 comment

Comments

@sammydeveille
Copy link

sammydeveille commented May 6, 2016

Hi,

Thought I would log this issue.

Here is the 'out-of-the-box' code I am using for uploading files:

$options = array('adapter' => ObjectStorage_Http_Client::SOCKET, 'timeout' => 10);
$objStorage = new ObjectStorage('', '', '', $options);

try {
   $newFile = $objStorage->with('RemoteFilePath')
                   ->setLocalFile($PathTolocalFile)
                   ->create();

   return $newFile->getUrl();
}
catch (Exception $e) {
   return $e->getMessage();
}

For some reason, uploading a file that is under 1Mb works. But any file with a size bigger than this, the ->create() request eventually times out, no exception is thrown and I keep getting these error in my log:

xxx.xxx.xxx.xx - [05/06/16 03:47:02] Warning: fwrite(): SSL operation failed with code 1. OpenSSL Error messages:
error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry (/var/www/vendor/softlayer/objectstorage/lib/ObjectStorage/Http/Adapter/Socket.php:132)

As those bindings are essentially a wrapper round curl, I then tested with CURL myself see if I could upload a file bigger than 1M to Softlayer Storage Container. It turns out it succeeded using CURL both on my dev machine and staging server!

curl -i -XPUT -H "X-Auth-Token: {{MyAuthToken}}" --data-binary "@BigFile.txt" https://lon02.objectstorage.softlayer.net/v1/{{MyAuthTokenKey}}/{{MyContainer}}/BigFile.txt

Have you ever come across this? Is this my machine?
Thanks

@vSaKv
Copy link

vSaKv commented May 31, 2016

I have the same issue. In fact it works fine on php 5.4.45, but php 5.5.x and up giving same time out.

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