ExpressionEngine / ExpressionEngine

ExpressionEngine is a flexible, feature-rich, free open-source content management platform that empowers hundreds of thousands of individuals and organizations around the world to easily manage their web site.
https://expressionengine.com
Other
455 stars 124 forks source link

Field 'cp_homepage_channel' doesn't have a default value when attempting to update to 7.4.1 #4076

Closed tyssen closed 6 months ago

tyssen commented 7 months ago

Description of the problem Running an update from 7.3.15 to 7.4.1 on my local version of the site running under DDEV on MacOS I'm getting:

We stopped on Preflight check.
SQLSTATE[HY000]: General error: 1364 Field 'cp_homepage_channel' doesn't have a default value:
INSERT INTO exp_role_settings
(role_id, search_flood_control)
VALUES (5, '10')

Stack trace

#0 /var/www/html/cms/ee/legacy/database/drivers/mysqli/mysqli_driver.php(112): CI_DB_mysqli_connection->query('INSERT INTO exp...')
#1 /var/www/html/cms/ee/legacy/database/DB_driver.php(262): CI_DB_mysqli_driver->_execute('INSERT INTO exp...')
#2 /var/www/html/cms/ee/legacy/database/DB_driver.php(177): CI_DB_driver->simple_query('INSERT INTO exp...')
#3 /var/www/html/cms/ee/installer/updates/ud_7_04_00.php(433): CI_DB_driver->query('INSERT INTO exp...')
#4 /var/www/html/cms/ee/installer/updates/ud_7_04_00.php(49): ExpressionEngine\Updater\Version_7_4_0\Updater->ensureBuiltinRoles()
#5 /var/www/html/cms/ee/updater/ExpressionEngine/Updater/Service/Updater/DatabaseUpdater.php(92): ExpressionEngine\Updater\Version_7_4_0\Updater->do_update()
#6 [internal function]: ExpressionEngine\Updater\Service\Updater\DatabaseUpdater->runUpdateFile('ud_7_04_00.php')
#7 /var/www/html/cms/ee/updater/ExpressionEngine/Updater/Service/Updater/SteppableTrait.php(94): call_user_func_array(Array, Array)
#8 /var/www/html/cms/ee/updater/ExpressionEngine/Updater/Service/Updater/Runner.php(153): ExpressionEngine\Updater\Service\Updater\DatabaseUpdater->runStep('runUpdateFile')
#9 [internal function]: ExpressionEngine\Updater\Service\Updater\Runner->updateDatabase()
#10 /var/www/html/cms/ee/updater/ExpressionEngine/Updater/Service/Updater/SteppableTrait.php(94): call_user_func_array(Array, Array)
#11 /var/www/html/cms/ee/updater/ExpressionEngine/Updater/Service/Updater/Runner.php(316): ExpressionEngine\Updater\Service\Updater\Runner->runStepParent('updateDatabase')
#12 /var/www/html/cms/ee/updater/ExpressionEngine/Updater/Controller/Updater/Updater.php(34): ExpressionEngine\Updater\Service\Updater\Runner->runStep('updateDatabase')
#13 /var/www/html/cms/ee/updater/boot.php(96): ExpressionEngine\Updater\Controller\Updater\Updater->run()
#14 /var/www/html/cms/ee/updater/boot.php(70): routeRequest('updater', 'updater', 'run')
#15 /var/www/html/public_html/admin.php(144): require_once('/var/www/html/c...')
#16 {main}

Environment Details:

tyssen commented 7 months ago

Just tried running the same update on a staging enviroment which is a Linux server running PHP and MySQL both at 8.0.30 and it passed successfully. So it's only the DDEV update that fails.

intoeetive commented 7 months ago

@tyssen has that site been updated from very old EE version in its turn as well?

I see only a short period back in 2015 when that column might not have a default values - and I don't really know if that version was released at all

The MySQL definition for the column is as below, and adjusting it prior to running update script should fix the things for you/

`cp_homepage_channel` int(10) unsigned NOT NULL DEFAULT '0'