Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed update to 9.2.7 from 8.5.15 #11993

Open
hissy opened this issue Mar 18, 2024 · 2 comments
Open

Failed update to 9.2.7 from 8.5.15 #11993

hissy opened this issue Mar 18, 2024 · 2 comments
Labels
Type:Bug Existing functionality not performing as expected.

Comments

@hissy
Copy link
Contributor

hissy commented Mar 18, 2024

Affected Version of Concrete CMS

9.x

Description

I've failed update to 9.2.7 from 8.5.15. Here is the output when I run c5:update :

** Executing migration: 20191029175713
Refreshing schema for Concrete\Core\Entity\Attribute\Key\ExpressKey...
Refreshing schema for Concrete\Core\Entity\Board\Board...
Refreshing schema for Concrete\Core\Entity\Board\BoardPermissionAssignment...
Refreshing schema for Concrete\Core\Entity\Board\Instance...
Refreshing schema for Concrete\Core\Entity\Board\InstanceItem...
Refreshing schema for Concrete\Core\Entity\Board\InstanceItemBatch...
Refreshing schema for Concrete\Core\Entity\Board\Item...
Refreshing schema for Concrete\Core\Entity\Board\ItemCategory...
Refreshing schema for Concrete\Core\Entity\Board\ItemTag...
Refreshing schema for Concrete\Core\Entity\Board\InstanceSlot...
Refreshing schema for Concrete\Core\Entity\Board\InstanceSlotRule...
Refreshing schema for Concrete\Core\Entity\Board\Template...
Refreshing schema for Concrete\Core\Entity\Board\SlotTemplate...
Refreshing schema for Concrete\Core\Entity\Board\DataSource\DataSource...
Refreshing schema for Concrete\Core\Entity\Board\DataSource\ConfiguredDataSource...
Refreshing schema for Concrete\Core\Entity\Board\DataSource\Configuration\Configuration...
Refreshing schema for Concrete\Core\Entity\Board\DataSource\Configuration\PageConfiguration...
Refreshing schema for Concrete\Core\Entity\Board\DataSource\Configuration\CalendarEventConfiguration...
Refreshing schema for Concrete\Core\Entity\Page\Container...
Refreshing schema for Concrete\Core\Entity\Page\Container\Instance...
Refreshing schema for Concrete\Core\Entity\Page\Container\InstanceArea...
Refreshing schema for Concrete\Core\Entity\Summary\Template...
Refreshing schema for Concrete\Core\Entity\Summary\Category...
Refreshing schema for Concrete\Core\Entity\Summary\Field...
Refreshing schema for Concrete\Core\Entity\Summary\TemplateField...
Refreshing schema for Concrete\Core\Entity\Page\Summary\CustomPageTemplateCollection...
Refreshing schema for Concrete\Core\Entity\Page\Summary\PageTemplate...
Refreshing schema for Concrete\Core\Entity\Calendar\CalendarEvent...
Refreshing schema for Concrete\Core\Entity\Calendar\Summary\CalendarEventTemplate...
Installing boards and containers upgrade XML...

In HandleMessageMiddleware.php line 130:
                                                                                                                                                                                 
  Handling "Concrete\Core\User\Group\Command\AddGroupCommand" failed: An exception occurred while executing 'INSERT INTO `Groups` (gName, gDescription, pkgID, gAuthorID) VALUE  
  S (?, ?, ?, ?)' with params ["Administrators", "", 0, 0]:                                                                                                                      
                                                                                                                                                                                 
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'gAuthorID' in 'field list'

The error message says failed to add value in the unknown column gAuthorID .
Group table doesn't have gAuthorID column in 8.5.x.

It seems @bitterdev added it in the migration file 20210215183900
(see 66cf8e6) but this file has already been removed. I don't know why.

Also, the migration class 20191029175713 doesn’t exist in 8.5.x.
https://github.com/concretecms/concretecms/tree/8.5.15/concrete/src/Updater/Migrations/Migrations

How to reproduce

I believe everyone can reproduce this error in terms of the code base, but this is the first time I have received this error.
I'll try to reproduce it by updating from clean installed 8.5.15 later.

Possible Solution

Add gAuthorID column before adding any groups.

Additional Context

I've succeeded in updating my client's website after running an alter table query. It's easy to get the query by running c5:compare-schema command.

concrete/bin/concrete c5:compare-schema | grep gAuthorID
26: ALTER TABLE `Groups` ADD gThumbnailFID INT UNSIGNED DEFAULT 0 NOT NULL, ADD gPetitionForPublicEntry TINYINT(1) DEFAULT '0' NOT NULL, ADD gOverrideGroupTypeSettings TINYINT(1) DEFAULT '0' NOT NULL, ADD gtID INT UNSIGNED DEFAULT 0 NOT NULL, ADD gDefaultRoleID INT UNSIGNED DEFAULT 0 NOT NULL, ADD gAuthorID INT UNSIGNED DEFAULT 0 NOT NULL
@hissy hissy added the Type:Bug Existing functionality not performing as expected. label Mar 18, 2024
@hissy
Copy link
Contributor Author

hissy commented Mar 18, 2024

Update: this client manually changed the "Administrators" group's name. This is the way how to reproduce the issue.

@aembler
Copy link
Member

aembler commented Apr 2, 2024

I think the simplest fix for this would be to add "Group" to the line of DB entities to refresh in this command prior to importing the boards_containers XML

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type:Bug Existing functionality not performing as expected.
Projects
None yet
Development

No branches or pull requests

2 participants