Zend and MySQL errors

Hi,

I’m having trouble with an Omeka Classic (2.6.1) installation. Every time I try to edit and save an item with a file, I get the following error: “Files cannot be attached to an item that is not persistent in the database!”

And attempting to create a new item, I get a Zend error with the following stack trace:

Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Column 'id' cannot be null in /home/zwhalen/public_html/maps/application/libraries/Zend/Db/Statement/Mysqli.php:214
Stack trace:
#0 /home/zwhalen/public_html/maps/application/libraries/Zend/Db/Statement.php(303): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /home/zwhalen/public_html/maps/application/libraries/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#2 /home/zwhalen/public_html/maps/application/libraries/Omeka/Db.php(79): Zend_Db_Adapter_Abstract->query('INSERT INTO `om...', Array)
#3 /home/zwhalen/public_html/maps/application/libraries/Omeka/Db.php(255): Omeka_Db->__call('query', Array)
#4 /home/zwhalen/public_html/maps/application/libraries/Omeka/Record/AbstractRecord.php(541): Omeka_Db->insert('omek_items', Array)
#5 /home/zwhalen/public_html/maps/application/libraries/Omeka/Controller/AbstractActionController.php(188): Omeka_Record_AbstractRecord->save(false)
#6 /home/zwhalen/public_html/maps/application/controllers/ItemsController.php(148): Omeka_Controller_AbstractActionController->addAction()
#7 /home/zwhalen/public_html/maps/application/libraries/Zend/Controller/Action.php(516): ItemsController->addAction()
#8 /home/zwhalen/public_html/maps/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('addAction')
#9 /home/zwhalen/public_html/maps/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#10 /home/zwhalen/public_html/maps/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(105): Zend_Controller_Front->dispatch()
#11 /home/zwhalen/public_html/maps/application/libraries/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()
#12 /home/zwhalen/public_html/maps/application/libraries/Omeka/Application.php(73): Zend_Application->run()
#13 /home/zwhalen/public_html/maps/admin/index.php(28): Omeka_Application->run()
#14 {main}

Any idea how I can troubleshoot this further?

Thanks,
Zach

It almost looks like your items table doesn’t have the AUTO_INCREMENT property on its id column. Did something “interesting” happen with the database for this installation?