Skip to content

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

Open
@sammydeveille

Description

@sammydeveille

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions