Zend_Http_Client_Adapter_Exception - Upload on S3

Hello,
I installed Omeka 2.3 and I configured in config the S3 Storage with a bucket in Ireland.
When I try to create an item with image file to upload, the webinterface send me this:

Zend_Http_Client_Adapter_Exception

Error writing request to server

exception 'Zend_Http_Client_Adapter_Exception' with message 'Error writing request to server' in /var/www/Omeka/application/libraries/Zend/Http/Client/Adapter/Socket.php:303
Stack trace:
#0 /var/www/Omeka/application/libraries/Zend/Http/Client.php(1079): Zend_Http_Client_Adapter_Socket->write('PUT', Object(Zend_Uri_Http), '1.1', Array, Resource id #46)
#1 /var/www/Omeka/application/libraries/Omeka/Http/Client.php(36): Zend_Http_Client->request('PUT')
#2 /var/www/Omeka/application/libraries/Zend/Service/Amazon/S3.php(693): Omeka_Http_Client->request('PUT')
#3 /var/www/Omeka/application/libraries/Zend/Service/Amazon/S3.php(465): Zend_Service_Amazon_S3->_makeRequest('PUT', 'biblioteca-dioc...', NULL, Array, Resource id #46)
#4 /var/www/Omeka/application/libraries/Zend/Service/Amazon/S3.php(541): Zend_Service_Amazon_S3->putObject('biblioteca-dioc...', Resource id #46, Array)
#5 /var/www/Omeka/application/libraries/Omeka/Storage/Adapter/ZendS3.php(97): Zend_Service_Amazon_S3->putFileStream('/tmp/e8443ece50...', 'biblioteca-dioc...', Array)
#6 [internal function]: Omeka_Storage_Adapter_ZendS3->store('/tmp/e8443ece50...', 'original/e8443e...')
#7 /var/www/Omeka/application/libraries/Omeka/Storage.php(67): call_user_func_array(Array, Array)
#8 /var/www/Omeka/application/models/File.php(424): Omeka_Storage->__call('store', Array)
#9 /var/www/Omeka/application/models/File.php(424): Omeka_Storage->store('/tmp/e8443ece50...', 'original/e8443e...')
#10 /var/www/Omeka/application/models/Job/FileProcessUpload.php(23): File->storeFiles()
#11 /var/www/Omeka/application/libraries/Omeka/Job/Dispatcher/Adapter/Synchronous.php(25): Job_FileProcessUpload->perform()
#12 /var/www/Omeka/application/libraries/Omeka/Job/Dispatcher/Default.php(136): Omeka_Job_Dispatcher_Adapter_Synchronous->send('{"className":"J...', Array)
#13 /var/www/Omeka/application/models/File.php(203): Omeka_Job_Dispatcher_Default->send('Job_FileProcess...', Array)
#14 [internal function]: File->afterSave(Array)
#15 /var/www/Omeka/application/libraries/Omeka/Record/AbstractRecord.php(277): call_user_func(Array, Array)
#16 /var/www/Omeka/application/libraries/Omeka/Record/AbstractRecord.php(550): Omeka_Record_AbstractRecord->runCallbacks('afterSave', Array)
#17 /var/www/Omeka/application/models/Item.php(335): Omeka_Record_AbstractRecord->save()
#18 /var/www/Omeka/application/models/Item.php(248): Item->saveFiles()
#19 [internal function]: Item->afterSave(Array)
#20 /var/www/Omeka/application/libraries/Omeka/Record/AbstractRecord.php(277): call_user_func(Array, Array)
#21 /var/www/Omeka/application/libraries/Omeka/Record/AbstractRecord.php(550): Omeka_Record_AbstractRecord->runCallbacks('afterSave', Array)
#22 /var/www/Omeka/application/libraries/Omeka/Controller/AbstractActionController.php(188): Omeka_Record_AbstractRecord->save(false)
#23 /var/www/Omeka/application/controllers/ItemsController.php(151): Omeka_Controller_AbstractActionController->addAction()
#24 /var/www/Omeka/application/libraries/Zend/Controller/Action.php(516): ItemsController->addAction()
#25 /var/www/Omeka/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('addAction')
#26 /var/www/Omeka/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#27 /var/www/Omeka/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(105): Zend_Controller_Front->dispatch()
#28 /var/www/Omeka/application/libraries/Zend/Application.php(382): Zend_Application_Bootstrap_Bootstrap->run()
#29 /var/www/Omeka/application/libraries/Omeka/Application.php(79): Zend_Application->run()
#30 /var/www/Omeka/admin/index.php(28): Omeka_Application->run()
#31 {main}

In the apache error log I find this:

PHP Notice: stream_copy_to_stream(): send of 8192 bytes failed with errno=32 Broken pipe in /var/www/Omeka/application/libraries/Zend/Http/Client/Adapter/Socket.php on line 301, referer: http://ipaddress/admin/items/add

have you idea how to solve it?
Thanks

It's possible that the Zend S3 code has issues with buckets that aren't in the "standard" AWS regions. What's the name of the bucket you're trying to use?

My suspects was right,
I created a new bucket in US Standard,
changed config.ini and it work.

So the problem is the region.
How is possible specify the region in the config.ini?

The Zend class accept the parameter region.

Zend's S3 code accepts a region paramter, but as I remember, it actually doesn't do anything with it.

The Omeka storage class for S3 does accept an "endpoint" option that sets which S3 endpoint is being used. This is effectively the way you set a non-standard region, by specifying the endpoint URL for the region your bucket is located in.

My first config.ini was with europe endpoint, but pmeka send me an error:

Zend_Uri_Exception

Illegal scheme supplied, only alphanumeric characters are permitted

exception 'Zend_Uri_Exception' with message 'Illegal scheme supplied, only alphanumeric characters are permitted' in /var/www/Omeka/application/libraries/Zend/Uri.php:111
Stack trace:
#0 /var/www/Omeka/application/libraries/Zend/Service/Amazon/S3.php(79): Zend_Uri::factory('s3-eu-west-1.am...')
#1 /var/www/Omeka/application/libraries/Omeka/Storage/Adapter/ZendS3.php(64): Zend_Service_Amazon_S3->setEndpoint('s3-eu-west-1.am...')
#2 /var/www/Omeka/application/libraries/Omeka/Storage.php(122): Omeka_Storage_Adapter_ZendS3->__construct(Array)
#3 /var/www/Omeka/application/libraries/Omeka/Storage.php(94): Omeka_Storage->setAdapter('Omeka_Storage_A...', Array)
#4 /var/www/Omeka/application/libraries/Omeka/Storage.php(43): Omeka_Storage->setOptions(Array)
#5 /var/www/Omeka/application/libraries/Omeka/Application/Resource/Storage.php(34): Omeka_Storage->__construct(Array)
#6 /var/www/Omeka/application/libraries/Zend/Application/Bootstrap/BootstrapAbstract.php(695): Omeka_Application_Resource_Storage->init()
#7 /var/www/Omeka/application/libraries/Zend/Application/Bootstrap/BootstrapAbstract.php(638): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('storage')
#8 /var/www/Omeka/application/libraries/Zend/Application/Bootstrap/BootstrapAbstract.php(598): Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap(NULL)
#9 /var/www/Omeka/application/libraries/Zend/Application.php(371): Zend_Application_Bootstrap_BootstrapAbstract->bootstrap(NULL)
#10 /var/www/Omeka/application/libraries/Omeka/Application.php(51): Zend_Application->bootstrap()
#11 /var/www/Omeka/index.php(23): Omeka_Application->initialize()
#12 {main}

Finally I solved my problem.
The endpoint must be specified with https
https://s3-eu-west-1.amazonaws.com
not like this aws url
http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region

Yes, the Zend code underlying this requires an absolute URL, starting with the http:// or https://.