CSV Import - given destination is not writable

Our CSV Import plugin has suddenly stopped working. When attempting to view the Import options page (before importing begins) we receive the below error. I know the plugin attempts creation, editing, and deletion of a temporary file /tmp/test.1 before throwing the error. The file is indeed created in the /tmp directory but it doesn’t seem to be editable and it remains afterwards.

drwxrwxrwt. 12 root root 12288 Feb 14 15:31 tmp

I cannot figure out what changed or more importantly how to get the files writing again.

Zend_File_Transfer_Exception
The given destination is not writable /tmp
exception 'Zend_File_Transfer_Exception' with message 'The given destination is not writable /tmp' in /var/www/vhosts/vm/transcribe/application/libraries/Zend/File/Transfer/Adapter/Abstract.php:1043
Stack trace:
#0 /var/www/vhosts/vm/transcribe/application/libraries/Zend/Form/Element/File.php(512): Zend_File_Transfer_Adapter_Abstract->setDestination('/tmp', 'csv_file')
#1 /var/www/vhosts/vm/transcribe/application/libraries/Zend/Form/Element.php(382): Zend_Form_Element_File->setDestination('/tmp')
#2 /var/www/vhosts/vm/transcribe/application/libraries/Zend/Form/Element.php(260): Zend_Form_Element->setOptions(Array)
#3 /var/www/vhosts/vm/transcribe/application/libraries/Zend/Form.php(1134): Zend_Form_Element->__construct('csv_file', Array)
#4 /var/www/vhosts/vm/transcribe/application/libraries/Zend/Form.php(1043): Zend_Form->createElement('file', 'csv_file', Array)
#5 /var/www/vhosts/vm/transcribe/plugins/CsvImportPlus/libraries/CsvImportPlus/Form/Main.php(228): Zend_Form->addElement('file', 'csv_file', Array)
#6 /var/www/vhosts/vm/transcribe/plugins/CsvImportPlus/libraries/CsvImportPlus/Form/Main.php(36): CsvImportPlus_Form_Main->_addFileElement()
#7 /var/www/vhosts/vm/transcribe/application/libraries/Zend/Form.php(239): CsvImportPlus_Form_Main->init()
#8 /var/www/vhosts/vm/transcribe/plugins/CsvImportPlus/controllers/IndexController.php(572): Zend_Form->__construct(Array)
#9 /var/www/vhosts/vm/transcribe/plugins/CsvImportPlus/controllers/IndexController.php(28): CsvImportPlus_IndexController->_getMainForm()
#10 /var/www/vhosts/vm/transcribe/application/libraries/Zend/Controller/Action.php(516): CsvImportPlus_IndexController->indexAction()
#11 /var/www/vhosts/vm/transcribe/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('indexAction')
#12 /var/www/vhosts/vm/transcribe/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#13 /var/www/vhosts/vm/transcribe/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(105): Zend_Controller_Front->dispatch()
#14 /var/www/vhosts/vm/transcribe/application/libraries/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()
#15 /var/www/vhosts/vm/transcribe/application/libraries/Omeka/Application.php(79): Zend_Application->run()
#16 /var/www/vhosts/vm/transcribe/admin/index.php(28): Omeka_Application->run()
#17 {main}>Preformatted text

The dot at the end of that mode on /tmp is a likely explanation: it means there’s an SELinux ACL or context set on /tmp. That goes above and beyond the “basic” permissions. Try ls -Z to see what it is.

Hi John,

Thanks for the response. Yes the system uses SELinux. The system where the problem has arisen is our development server.

# ls -Z /
drwxrwxrwt. root root system_u:object_r:tmp_t:s0       tmp

And for comparison on our still working properly production server

# ls -Z /
drwxrwxrwt. root root system_u:object_r:tmp_t:s0       tmp

Since it is development I ran
# setenforce 0
but the error message remains unchanged. I am really stumped!

I think I have it narrowed down to /tmp related and probably a size or clearing problem. I can get the plugin to work consistently right after a server reboot. I’m thinking /tmp is running out of space so that’s what I am looking into now.

Ah, being out of space would be a good reason too. I’ve definitely seen that before, and it lines up with you seeing that the file seems to be created but not usable.

In the end it was a space issue. Thanks for your help John!