Omeka_Storage_Exception on shared host

I have a Omeka_Storage_Exception on a shared host when I want to add a mp3 or mp4 file to an item. Adding larger images or pdf work just fine.

I read that it has to do with imagemagick not being able to convert to thumbnails, as one explanation. Anybody had this? Solved this?

<3

Here is the stack trace:

exception 'Omeka_Storage_Exception' with message 'Unable to store file.' in /home/designfi/www/omeka.times-of-waste.ch/application/libraries/Omeka/Storage/Adapter/Filesystem.php:119<br />
Stack trace:<br />
#0 [internal function]: Omeka_Storage_Adapter_Filesystem->store('/tmp//fullsize_...', 'fullsize/67c58c...')<br />
#1 /home/designfi/www/omeka.times-of-waste.ch/application/libraries/Omeka/Storage.php(67): call_user_func_array(Array, Array)<br />
#2 /home/designfi/www/omeka.times-of-waste.ch/application/models/File.php(429): Omeka_Storage->__call('store', Array)<br />
#3 /home/designfi/www/omeka.times-of-waste.ch/application/models/File.php(429): Omeka_Storage->store('/tmp//fullsize_...', 'fullsize/67c58c...')<br />
#4 /home/designfi/www/omeka.times-of-waste.ch/application/models/Job/FileProcessUpload.php(23): File->storeFiles()<br />
#5 /home/designfi/www/omeka.times-of-waste.ch/application/libraries/Omeka/Job/Dispatcher/Adapter/Synchronous.php(25): Job_FileProcessUpload->perform()<br />
#6 /home/designfi/www/omeka.times-of-waste.ch/application/libraries/Omeka/Job/Dispatcher/Default.php(136): Omeka_Job_Dispatcher_Adapter_Synchronous->send('{"className":"J...', Array)<br />
#7 /home/designfi/www/omeka.times-of-waste.ch/application/models/File.php(203): Omeka_Job_Dispatcher_Default->send('Job_FileProcess...', Array)<br />
#8 [internal function]: File->afterSave(Array)<br />
#9 /home/designfi/www/omeka.times-of-waste.ch/application/libraries/Omeka/Record/AbstractRecord.php(277): call_user_func(Array, Array)<br />
#10 /home/designfi/www/omeka.times-of-waste.ch/application/libraries/Omeka/Record/AbstractRecord.php(550): Omeka_Record_AbstractRecord->runCallbacks('afterSave', Array)<br />
#11 /home/designfi/www/omeka.times-of-waste.ch/application/models/Item.php(335): Omeka_Record_AbstractRecord->save()<br />
#12 /home/designfi/www/omeka.times-of-waste.ch/application/models/Builder/Item.php(204): Item->saveFiles()<br />
#13 /home/designfi/www/omeka.times-of-waste.ch/application/libraries/globals.php(567): Builder_Item->addFiles('Upload', 'file', Array)<br />
#14 /home/designfi/www/omeka.times-of-waste.ch/application/models/Item.php(320): insert_files_for_item(Object(Item), 'Upload', 'file', Array)<br />
#15 /home/designfi/www/omeka.times-of-waste.ch/application/models/Item.php(230): Item->_uploadFiles()<br />
#16 [internal function]: Item->beforeSave(Array)<br />
#17 /home/designfi/www/omeka.times-of-waste.ch/application/libraries/Omeka/Record/AbstractRecord.php(277): call_user_func(Array, Array)<br />
#18 /home/designfi/www/omeka.times-of-waste.ch/application/libraries/Omeka/Record/AbstractRecord.php(531): Omeka_Record_AbstractRecord->runCallbacks('beforeSave', Array)<br />
#19 /home/designfi/www/omeka.times-of-waste.ch/application/libraries/Omeka/Controller/AbstractActionController.php(229): Omeka_Record_AbstractRecord->save(false)<br />
#20 /home/designfi/www/omeka.times-of-waste.ch/application/controllers/ItemsController.php(91): Omeka_Controller_AbstractActionController->editAction()<br />
#21 /home/designfi/www/omeka.times-of-waste.ch/application/libraries/Zend/Controller/Action.php(516): ItemsController->editAction()<br />
#22 /home/designfi/www/omeka.times-of-waste.ch/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('editAction')<br />
#23 /home/designfi/www/omeka.times-of-waste.ch/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))<br />
#24 /home/designfi/www/omeka.times-of-waste.ch/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(105): Zend_Controller_Front->dispatch()<br />
#25 /home/designfi/www/omeka.times-of-waste.ch/application/libraries/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()<br />
#26 /home/designfi/www/omeka.times-of-waste.ch/application/libraries/Omeka/Application.php(79): Zend_Application->run()<br />
#27 /home/designfi/www/omeka.times-of-waste.ch/admin/index.php(28): Omeka_Application->run()<br />
#28 {main}

I can't say that I've seen this combo. My first guess would have been permissions on the directories, but since you are successful with other, larger file types, that seems to rule out that guess.

Another guess is that those file types aren't allowed under Omeka's Security settings. I would have expected a different error, but maybe there's a new twist at work. You could try disabling file validation there, and see if it makes a difference.

Deep down, it looks like the issue is that the PHP rename function fails silently when trying to move the file to Omeka's storage system. Beyond that, it's hard to see what's happening. The server logs might indicate more than Omeka's logs do. Depending on how the hosting company has set things up, they might be able to point you to where to find those, or indicate something that they see.

Hello Patrick

Thank you very much for the extensive answer. Unfortunately I have mere ftp access. But we hopefully move to a host where I am in complete control.

I disabled the file validation, as you suggested. Unfortunately the error persists. I tend to think it has to do with image magick. So far, no success. And since I'm locked to ftp only there is only so far I can do.

Thanks again :)

If you can ask your hosting company what version of imagemagick they are using, that might help. It's possible that it's a version that doesn't do well with those file types, which would indeed explain the issue. Newer versions should be okay, so that's another route to investigate.

Hello Patrick

I managed to resolve the problem. I followed to link by mebrett here.

the fileDerivatives.strategy = "Omeka_File_Derivative_Strategy_Imagick" did it for me. The GD also worked fine, except for handling less fileformats - ie no preview for pdfs.

Thanks for your support! You got a paypal.me address?