Bug #23251 See Comments

DB error when trying to add new categories

Version: 3.5.11 Reporter: Paul Vance

After a recent update to 3.5.11 I’m getting this error when trying to add categories to category groups I’ve created:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ee_m_CategoryField_category_fields.field_settings' in 'field list':
SELECT ee_m_CategoryField_category_fields.field_id as ee_m_CategoryField__field_id, ee_m_CategoryField_category_fields.site_id as ee_m_CategoryField__site_id, ee_m_CategoryField_category_fields.group_id as ee_m_CategoryField__group_id, ee_m_CategoryField_category_fields.field_name as ee_m_CategoryField__field_name, ee_m_CategoryField_category_fields.field_label as ee_m_CategoryField__field_label, ee_m_CategoryField_category_fields.field_type as ee_m_CategoryField__field_type, ee_m_CategoryField_category_fields.field_list_items as ee_m_CategoryField__field_list_items, ee_m_CategoryField_category_fields.field_maxl as ee_m_CategoryField__field_maxl, ee_m_CategoryField_category_fields.field_ta_rows as ee_m_CategoryField__field_ta_rows, ee_m_CategoryField_category_fields.field_default_fmt as ee_m_CategoryField__field_default_fmt, ee_m_CategoryField_category_fields.field_show_fmt as ee_m_CategoryField__field_show_fmt, ee_m_CategoryField_category_fields.field_text_direction as ee_m_CategoryField__field_text_direction, ee_m_CategoryField_category_fields.field_required as ee_m_CategoryField__field_required, ee_m_CategoryField_category_fields.field_order as ee_m_CategoryField__field_order, ee_m_CategoryField_category_fields.field_settings as ee_m_CategoryField__field_settings FROM (`exp_category_fields` as ee_m_CategoryField_category_fields) WHERE `ee_m_CategoryField_category_fields`.`group_id` = '2' LIMIT 18446744073709551615

ee/legacy/database/drivers/mysqli/mysqli_connection.php:122


#0 ee/legacy/database/drivers/mysqli/mysqli_driver.php(137): CI_DB_mysqli_connection->query('SELECT ee_m_Cat...')
#1 ee/legacy/database/DB_driver.php(297): CI_DB_mysqli_driver->_execute('SELECT ee_m_Cat...')
#2 ee/legacy/database/DB_driver.php(203): CI_DB_driver->simple_query('SELECT ee_m_Cat...')
#3 ee/legacy/database/DB_active_rec.php(1219): CI_DB_driver->query('SELECT ee_m_Cat...')
#4 ee/EllisLab/ExpressionEngine/Service/Model/Query/Select.php(45): CI_DB_active_record->get()
#5 ee/EllisLab/ExpressionEngine/Service/Model/DataStore.php(294): EllisLab\ExpressionEngine\Service\Model\Query\Select->run()
#6 ee/EllisLab/ExpressionEngine/Service/Model/DataStore.php(240): EllisLab\ExpressionEngine\Service\Model\DataStore->runQuery('Select', Object(EllisLab\ExpressionEngine\Service\Model\Query\Builder))
#7 ee/EllisLab/ExpressionEngine/Service/Model/Query/Builder.php(156): EllisLab\ExpressionEngine\Service\Model\DataStore->selectQuery(Object(EllisLab\ExpressionEngine\Service\Model\Query\Builder))
#8 ee/EllisLab/ExpressionEngine/Service/Model/Query/Builder.php(75): EllisLab\ExpressionEngine\Service\Model\Query\Builder->fetch()
#9 ee/EllisLab/ExpressionEngine/Service/Model/Association/Association.php(263): EllisLab\ExpressionEngine\Service\Model\Query\Builder->all()
#10 ee/EllisLab/ExpressionEngine/Service/Model/Association/Association.php(131): EllisLab\ExpressionEngine\Service\Model\Association\Association->reload()
#11 ee/EllisLab/ExpressionEngine/Service/Model/Association/ToMany.php(33): EllisLab\ExpressionEngine\Service\Model\Association\Association->get()
#12 ee/EllisLab/ExpressionEngine/Service/Model/Model.php(180): EllisLab\ExpressionEngine\Service\Model\Association\ToMany->get()
#13 ee/EllisLab/ExpressionEngine/Service/Model/Mixin/Relationship.php(115): EllisLab\ExpressionEngine\Service\Model\Model->__get('CategoryFields')
#14 ee/EllisLab/ExpressionEngine/Service/Model/Model.php(160): EllisLab\ExpressionEngine\Service\Model\Mixin\Relationship->runAssociationAction(Array, Array)
#15 ee/EllisLab/ExpressionEngine/Controller/Channels/Cat.php(993): EllisLab\ExpressionEngine\Service\Model\Model->__call('getCategoryFiel...', Array)
#16 ee/EllisLab/ExpressionEngine/Controller/Channels/Cat.php(993): EllisLab\ExpressionEngine\Model\Category\CategoryGroup->getCategoryFields()
#17 [internal function]: EllisLab\ExpressionEngine\Controller\Channels\Cat->field('2')
#18 ee/EllisLab/ExpressionEngine/Core/Core.php(189): call_user_func_array(Array, Array)
#19 ee/EllisLab/ExpressionEngine/Core/Core.php(94): EllisLab\ExpressionEngine\Core\Core->runController(Array)
#20 ee/EllisLab/ExpressionEngine/Boot/boot.php(151): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
#21 html/publish.php(143): require_once('...')
#21 html/publish.php(143): require_once('...')
  • It looks like your update was incomplete, as that column was added in v3.3.3. Some possible causes:

    • Updating the files but not running the updater.
    • Updating a staging server, then deploy the changes to production without running the update utility on the production database.
    • Deploying a config file from staging that has already been updated before running the update on production (the config would indicate the update had already occurred and production would skip it).

    Please double check that you have run the update utility on the production server from its current database version, and let me know if that resolves your issue.

    Derek Jones
    21st October, 2017 at 12:27pm
  • Yes, the update utility was run for sure. I got the success message at the end and removed the installer directory before logging in.

    Paul Vance
    23rd October, 2017 at 10:52pm
  • What about the other possibilities mentioned, any of them possibly apply? Do you have a dev/staging environment in addition to production for instance?

    You would still get a success message if your config file had a newer version stored than the production database was in, but it would never have run the 3.3.3 update, for instance. If you’d like to try, you can set your version in your config back to the last version you were running before running the update, and try it again. Make sure to backup your database of course before trying.

    Derek Jones
    23rd October, 2017 at 10:58pm
  • I reset the version in the config, ran the update again and that seems to have done the trick. Thanks Derek - your support here was outstanding.

    Paul Vance
    24th October, 2017 at 9:15am
  • Glad it was that simple, Paul, thanks for posting the detailed error, that definitely helped!

    Derek Jones
    24th October, 2017 at 9:57am

You must be signed in to comment on a bug report.

ExpressionEngine News

#eecms, #events, #releases