Getting this error when upgrading from 3.5.15 to 4.3.6.

Any ideas?

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ee_m_MemberGroup_member_groups.can_manage_consents' in 'field list':

SELECT ee_m_MemberGroup_member_groups.group_id as ee_m_MemberGroup__group_id, ee_m_MemberGroup_member_groups.site_id as ee_m_MemberGroup__site_id, ee_m_MemberGroup_member_groups.group_title as ee_m_MemberGroup__group_title, ee_m_MemberGroup_member_groups.group_description as ee_m_MemberGroup__group_description, ee_m_MemberGroup_member_groups.is_locked as ee_m_MemberGroup__is_locked, ee_m_MemberGroup_member_groups.menu_set_id as ee_m_MemberGroup__menu_set_id, ee_m_MemberGroup_member_groups.can_view_offline_system as ee_m_MemberGroup__can_view_offline_system, ee_m_MemberGroup_member_groups.can_view_online_system as ee_m_MemberGroup__can_view_online_system, ee_m_MemberGroup_member_groups.can_access_cp as ee_m_MemberGroup__can_access_cp, ee_m_MemberGroup_member_groups.can_access_footer_report_bug as ee_m_MemberGroup__can_access_footer_report_bug, ee_m_MemberGroup_member_groups.can_access_footer_new_ticket as ee_m_MemberGroup__can_access_footer_new_ticket, ee_m_MemberGroup_member_groups.can_access_footer_user_guide as ee_m_MemberGroup__can_access_footer_user_guide, ee_m_MemberGroup_member_groups.can_view_homepage_news as ee_m_MemberGroup__can_view_homepage_news, ee_m_MemberGroup_member_groups.can_access_files as ee_m_MemberGroup__can_access_files, ee_m_MemberGroup_member_groups.can_access_design as ee_m_MemberGroup__can_access_design, ee_m_MemberGroup_member_groups.can_access_addons as ee_m_MemberGroup__can_access_addons, ee_m_MemberGroup_member_groups.can_access_members as ee_m_MemberGroup__can_access_members, ee_m_MemberGroup_member_groups.can_access_sys_prefs as ee_m_MemberGroup__can_access_sys_prefs, ee_m_MemberGroup_member_groups.can_access_comm as ee_m_MemberGroup__can_access_comm, ee_m_MemberGroup_member_groups.can_access_utilities as ee_m_MemberGroup__can_access_utilities, ee_m_MemberGroup_member_groups.can_access_data as ee_m_MemberGroup__can_access_data, ee_m_MemberGroup_member_groups.can_access_logs as ee_m_MemberGroup__can_access_logs, ee_m_MemberGroup_member_groups.can_admin_design as ee_m_MemberGroup__can_admin_design, ee_m_MemberGroup_member_groups.can_delete_members as ee_m_MemberGroup__can_delete_members, ee_m_MemberGroup_member_groups.can_admin_mbr_groups as ee_m_MemberGroup__can_admin_mbr_groups, ee_m_MemberGroup_member_groups.can_admin_mbr_templates as ee_m_MemberGroup__can_admin_mbr_templates, ee_m_MemberGroup_member_groups.can_ban_users as ee_m_MemberGroup__can_ban_users, ee_m_MemberGroup_member_groups.can_admin_addons as ee_m_MemberGroup__can_admin_addons, ee_m_MemberGroup_member_groups.can_edit_categories as ee_m_MemberGroup__can_edit_categories, ee_m_MemberGroup_member_groups.can_delete_categories as ee_m_MemberGroup__can_delete_categories, ee_m_MemberGroup_member_groups.can_view_other_entries as ee_m_MemberGroup__can_view_other_entries, ee_m_MemberGroup_member_groups.can_edit_other_entries as ee_m_MemberGroup__can_edit_other_entries, ee_m_MemberGroup_member_groups.can_assign_post_authors as ee_m_MemberGroup__can_assign_post_authors, ee_m_MemberGroup_member_groups.can_create_entries as ee_m_MemberGroup__can_create_entries, ee_m_MemberGroup_member_groups.can_edit_self_entries as ee_m_MemberGroup__can_edit_self_entries, ee_m_MemberGroup_member_groups.can_delete_self_entries as ee_m_MemberGroup__can_delete_self_entries, ee_m_MemberGroup_member_groups.can_delete_all_entries as ee_m_MemberGroup__can_delete_all_entries, ee_m_MemberGroup_member_groups.can_view_other_comments as ee_m_MemberGroup__can_view_other_comments, ee_m_MemberGroup_member_groups.can_edit_own_comments as ee_m_MemberGroup__can_edit_own_comments, ee_m_MemberGroup_member_groups.can_delete_own_comments as ee_m_MemberGroup__can_delete_own_comments, ee_m_MemberGroup_member_groups.can_edit_all_comments as ee_m_MemberGroup__can_edit_all_comments, ee_m_MemberGroup_member_groups.can_delete_all_comments as ee_m_MemberGroup__can_delete_all_comments, ee_m_MemberGroup_member_groups.can_moderate_comments as ee_m_MemberGroup__can_moderate_comments, ee_m_MemberGroup_member_groups.can_send_cached_email as ee_m_MemberGroup__can_send_cached_email, ee_m_MemberGroup_member_groups.can_email_member_groups as ee_m_MemberGroup__can_email_member_groups, ee_m_MemberGroup_member_groups.can_email_from_profile as ee_m_MemberGroup__can_email_from_profile, ee_m_MemberGroup_member_groups.can_view_profiles as ee_m_MemberGroup__can_view_profiles, ee_m_MemberGroup_member_groups.can_edit_html_buttons as ee_m_MemberGroup__can_edit_html_buttons, ee_m_MemberGroup_member_groups.can_delete_self as ee_m_MemberGroup__can_delete_self, ee_m_MemberGroup_member_groups.mbr_delete_notify_emails as ee_m_MemberGroup__mbr_delete_notify_emails, ee_m_MemberGroup_member_groups.can_post_comments as ee_m_MemberGroup__can_post_comments, ee_m_MemberGroup_member_groups.exclude_from_moderation as ee_m_MemberGroup__exclude_from_moderation, ee_m_MemberGroup_member_groups.can_search as ee_m_MemberGroup__can_search, ee_m_MemberGroup_member_groups.search_flood_control as ee_m_MemberGroup__search_flood_control, ee_m_MemberGroup_member_groups.can_send_private_messages as ee_m_MemberGroup__can_send_private_messages, ee_m_MemberGroup_member_groups.prv_msg_send_limit as ee_m_MemberGroup__prv_msg_send_limit, ee_m_MemberGroup_member_groups.prv_msg_storage_limit as ee_m_MemberGroup__prv_msg_storage_limit, ee_m_MemberGroup_member_groups.can_attach_in_private_messages as ee_m_MemberGroup__can_attach_i....

  • Happening to me as well. – Travis Smith Dec 1 at 0:47
  • Ellislab helped me out with a bug fix. Here's what they supplied me and it worked. – benb Dec 2 at 22:24

Is this a rehearsed upgrade or your first time?

EE should be creating that column when running the upgrade script for 4.3.0.

Rehearse the upgrade on a separate instance of your application. Also verify that that column exists, and that it is being created properly by the installer script here:

/system/ee/installer/updates/ud_4_03_00.php:238

My guess is that the installer failed on that upgrade step, and you continued on without reverting and figuring out what died on that step.

  • Thanks for your help. This happened on the first time I ran the upgrade. I've tried a couple more times with same result. Also the update stalled at 4.0.0 so I haven't been able to get to the 4.3.0 steps yet. – benb Nov 26 at 23:44
  • That would be your answer then. The file set you have for the CMS is at 4.3.6, but the database architecture is for at the highest, 4.0.0. So you'll have to solve why it stalls upgrading at 4.0.0. Feel free to create a new question, as we will need details on your install (do you have thousands of channel layouts? hundreds of member groups?) to help further. – jrothafer Nov 26 at 23:51
  • 1
    Thanks for that. Am going to re-set, try again and report back. – benb Nov 27 at 0:11

The 4.0.0 upgrade script looks at the "member" model (which includes member group permissions) to determine what member fields it needs to deal with to upgrade from 3.5.X.

However, the default member group model was modified in 4.3 to include a check for "can_manage_consents" but that doesn't exist in the member_group table yet. So the 4.0.0 installer should have been modified to take that into account. But it wasn't.

If you create the column in the exp_member_groups table yourself, it should solve the issue.

can_manage_consents char(1) NOT NULL DEFAULT 'n',

Ellislab helped me out with a bug fix. Here's what they supplied me and it worked.

<?php

/** * This source file is part of the open source project * ExpressionEngine (https://expressionengine.com) * * @link https://expressionengine.com/ * @copyright Copyright (c) 2003-2018, EllisLab, Inc. (https://ellislab.com) * @license https://expressionengine.com/license Licensed under Apache License, Version 2.0 */

namespace EllisLab\ExpressionEngine\Updater\Version_4_0_1;

/** * Update */ class Updater {

var $version_suffix = '';

/**
 * Do Update
 *
 * @return TRUE
 */
public function do_update()
{
    $steps = new \ProgressIterator(
        array(
            'removeOrhpanedLayouts',
            'resyncLayouts'
        )
    );

    foreach ($steps as $k => $v)
    {
        $this->$v();
    }

    return TRUE;
}

private function removeOrhpanedLayouts()
{
    // This field addition ported from ud_4_03_00 because otherwise model throws mysql error

    ee()->smartforge->add_column(
        'member_groups',
        array(
            'can_manage_consents' => array(
                'type'       => 'CHAR',
                'constraint' => 1,
                'default'    => 'n',
                'null'       => FALSE,
            )
        )
    );


    $channel_ids = ee('Model')->get('Channel')
        ->fields('channel_id')
        ->all()
        ->getIds();

    if ( ! empty($channel_ids))
    {
        ee('Model')->get('ChannelLayout')
            ->filter('channel_id', 'NOT IN', $channel_ids)
            ->delete();
    }
}

private function resyncLayouts()
{
    // Fix for running this update routine in a >= 4.1 context, preview_url
    // column must be present to access Channel model below
    ee()->smartforge->add_column(
        'channels',
        array(
            'preview_url' => array(
                'type'    => 'VARCHAR(100)',
                'null'    => TRUE,
            )
        )
    );

    ee('Model')->get('ChannelLayout')
        ->with('Channel')
        ->all()
        ->synchronize();
}

} // END CLASS

// EOF

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.