Mysqli prepare error: Unknown column 'id' in 'field list'

Hello, I just upgraded to Omeka v2.8 from v.2.x I’m not sure which exactly it was, as I have inherited the website.

When I enter my email address in the ‘forgot password’ (I don’t know the password) I get the follwoing error:


Omeka has encountered an error

Zend_Db_Statement_Mysqli_Exception

    Mysqli prepare error: Unknown column 'id' in 'field list'

Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: Unknown column 'id' in 'field list' in /mnt/docroot/html/pickardspapers.gla.ac.uk/www/application/libraries/Zend/Db/Statement/Mysqli.php:77
Stack trace:
#0 /mnt/docroot/html/pickardspapers.gla.ac.uk/www/application/libraries/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare()
#1 /mnt/docroot/html/pickardspapers.gla.ac.uk/www/application/libraries/Zend/Db/Adapter/Mysqli.php(388): Zend_Db_Statement->__construct()
#2 /mnt/docroot/html/pickardspapers.gla.ac.uk/www/application/libraries/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Adapter_Mysqli->prepare()
#3 /mnt/docroot/html/pickardspapers.gla.ac.uk/www/application/libraries/Omeka/Db.php(80): Zend_Db_Adapter_Abstract->query()
#4 /mnt/docroot/html/pickardspapers.gla.ac.uk/www/application/libraries/Omeka/Db.php(257): Omeka_Db->__call()
#5 /mnt/docroot/html/pickardspapers.gla.ac.uk/www/application/libraries/Omeka/Record/AbstractRecord.php(541): Omeka_Db->insert()
#6 /mnt/docroot/html/pickardspapers.gla.ac.uk/www/application/controllers/UsersController.php(91): Omeka_Record_AbstractRecord->save()
#7 /mnt/docroot/html/pickardspapers.gla.ac.uk/www/application/libraries/Zend/Controller/Action.php(516): UsersController->forgotPasswordAction()
#8 /mnt/docroot/html/pickardspapers.gla.ac.uk/www/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch()
#9 /mnt/docroot/html/pickardspapers.gla.ac.uk/www/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch()
#10 /mnt/docroot/html/pickardspapers.gla.ac.uk/www/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(105): Zend_Controller_Front->dispatch()
#11 /mnt/docroot/html/pickardspapers.gla.ac.uk/www/application/libraries/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()
#12 /mnt/docroot/html/pickardspapers.gla.ac.uk/www/application/libraries/Omeka/Application.php(73): Zend_Application->run()
#13 /mnt/docroot/html/pickardspapers.gla.ac.uk/www/admin/index.php(28): Omeka_Application->run()
#14 {main}

The email exists (if I input an email that doesn’t exist I get a different error). I did do the admin/upgrade/, so the database is upgraded. What can the issue be?

This error is indicating an issue with your database: it’s saying that the users_activations table is missing the “id” column.

The users_activations table has had an id column essentially forever, so if it’s missing that might have been a manual change to your database at some point? I don’t really have any other explanations.

Hello, I’m still stuck with this. I made some progress by adding a ‘id’ column to the users_activations table. That made me possible to get a reset link sent to me. Unfortunately when I click on the reset link I then get this error:

Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given 
in /var/www/html/pickardspapers.gla.ac.uk/www/application/libraries/Omeka/Record/AbstractRecord.php:183 
Stack trace: 
#0 /var/www/html/pickardspapers.gla.ac.uk/www/application/controllers/UsersController.php(134): Omeka_Record_AbstractRecord->__get() 
#1 /var/www/html/pickardspapers.gla.ac.uk/www/application/libraries/Zend/Controller/Action.php(516): UsersController->activateAction() 
#2 /var/www/html/pickardspapers.gla.ac.uk/www/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch() 
#3 /var/www/html/pickardspapers.gla.ac.uk/www/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch() 
#4 /var/www/html/pickardspapers.gla.ac.uk/www/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(106): Zend_Controller_Front->dispatch() 
#5 /var/www/html/pickardspapers.gla.ac.uk/www/application/libraries/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run() 
#6 /var/www/html/pickardspapers.gla.ac.uk/www/application/libraries/Omeka/Application.php(73): Zend_Application->run() 
#7 /var/www/html/pickardspapers.gla.ac.uk/www/admin/index.php(28): Omeka_Application->run() 
#8 {main} 
thrown in /var/www/html/pickardspapers.gla.ac.uk/www/application/libraries/Omeka/Record/AbstractRecord.php on line 183

Is there a way to change the users’ passwords on the users table? I tried with both MD5 and SHA-1 hashes and I am still not able to log-in to the /admin, as it says that the password is not valid. Even a ‘test’ password would do.

This is the error I get when registering for a new user via the ‘register’ button:

Fatal error: Declaration of GuestUserToken::beforeSave() must be compatible with Omeka_Record_AbstractRecord::beforeSave($args) in /var/www/html/pickardspapers.gla.ac.uk/www/plugins/GuestUser/models/GuestUserToken.php on line 12

What version of Omeka are you using? You said 2.8 before, but the line numbers on your error report don’t match up with version 2.8.

Thank you, and well spotted. I did upgrade to 2.8 last month, and now I’m upgrading to the latest version (3.1.2). I though it’d be the same. Can I just change the password in the database? What kind of hash / salt do I need? MD5 and SHA-1 don’t seem to work.

I’ve solved by installing a new Omeka Classic somewhere else and copy-pasting my user details between the databases. Problem solved.