Intermesh / groupoffice

Group Office groupware and CRM
https://www.group-office.com
Other
194 stars 47 forks source link

6.8.39 Error when updating with mysql db server #1134

Closed thomasgg23 closed 7 months ago

thomasgg23 commented 7 months ago

There seems to be an error when updating to 6.8.39 an having a mysql server db running ubuntu 22.04 (no fresh install). Switching to mariadb did the trick, update performed without an error.

Update Log: Skipping module kanban because it's not available. [core/core] Excuting query: delete from core_acl_group_changes; core/core updated from 372 to 373 [core/core] Excuting query: alter table core_acl_group_changes change grantModSeq modSeq int not null; core/core updated from 373 to 374 [core/core] Excuting query: alter table core_acl_group_changes add granted boolean not null; core/core updated from 374 to 375 [core/core] Excuting query: alter table core_acl_group_changes drop column revokeModSeq; core/core updated from 375 to 376 [core/core] Excuting query: create index if not exists aclId2 on core_acl_group_changes (aclId, groupId, modSeq); 0: Database exception Query: create index if not exists aclId2 on core_acl_group_changes (aclId, groupId, modSeq); Package: core Module: core Module installed version: 376 Module source version: 377 ABORTING: Please contact support

koekie71 commented 7 months ago

I have the same thing with Debian 12 and MySQL 8.0.36. Commented two updates to the database in updates.php to finish it:

$updates['202403181539'][] = "create index if not exists aclId2 on core_acl_group_changes(aclId, groupId, modSeq);";

$updates['202403181539'][] = "alter table core_acl_group_changes add constraint group foreign key (groupId) references core_group (id) on delete cascade on update cascade";

gmcpaul commented 7 months ago

Hi, i have the same problem here... but uncommenting the mentioned lines did not help fully...

had to comment out these lines:

// $updates['202403181539'][] = "create index if not exists aclId2 on core_acl_group_changes (aclId, groupId, modSeq);";

// $updates['202403181539'][] = "drop index aclId on core_acl_group_changes;";

// $updates['202403181539'][] = "drop index group on core_acl_group_changes;";

// $updates['202403181539'][] = "alter table core_acl_group_changes add constraint group foreign key (groupId) references core_group (id) on delete cascade on update cascade";

but is that a proper fix?

derjoachim commented 7 months ago

I think that it should suffice to change this:

$updates['202403181539'][] = "create index if not exists aclId2 on core_acl_group_changes (aclId, groupId, modSeq);";

into this:

$updates['202403181539'][] = "create index aclId2 on core_acl_group_changes (aclId, groupId, modSeq);";

Apparently MySQL does not support the IF NOT EXISTS bit on creating indexes.

[edit]: I am reading some conflicting information on whether DROP INDEX IF EXISTS is supported my MySQL8, You may want to try adding the IF EXISTS option to lines 1550 and 1552. If that does not work, just replace the queries with empty strings, e.g. $updates['202403181539'][] = "";

gmcpaul commented 7 months ago

@derjoachim thanks for the quick reply... i did your mentioned changes in the updates.php and restarted the update procedure...

got following output: Session writing closed go\core\db\DbException in /usr/share/groupoffice/go/core/db/Statement.php at line 188: Database exception, DEBUG: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'forcepasswordchange' for key 'core_auth_method.PRIMARY', Full SQL: INSERT INTO core_auth_method ( id, moduleId, sortOrder ) VALUES ( 'forcepasswordchange', 1, 5 ) Previous: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'forcepasswordchange' for key 'core_auth_method.PRIMARY'

0 /usr/share/groupoffice/go/core/orm/Property.php(1777): go\core\db\Statement->execute()

1 /usr/share/groupoffice/go/core/orm/Property.php(1847): go\core\orm\Property->insertTableRecord()

2 /usr/share/groupoffice/go/core/orm/Property.php(1321): go\core\orm\Property->saveTable()

3 /usr/share/groupoffice/go/core/orm/Property.php(1281): go\core\orm\Property->saveTables()

4 /usr/share/groupoffice/go/core/orm/Entity.php(424): go\core\orm\Property->internalSave()

5 /usr/share/groupoffice/go/core/orm/Entity.php(352): go\core\orm\Entity->internalSave()

6 /usr/share/groupoffice/go/core/auth/BaseAuthenticator.php(51): go\core\orm\Entity->save()

7 /usr/share/groupoffice/go/core/install/updates.php(1567): go\core\auth\BaseAuthenticator::register()

8 [internal function]: go\core\Installer->{closure}()

9 /usr/share/groupoffice/go/core/Installer.php(730): call_user_func()

10 /usr/share/groupoffice/go/core/Installer.php(514): go\core\Installer->upgradeModules()

11 /usr/share/groupoffice/install/upgrade.php(119): go\core\Installer->upgrade()

12 {main}

Validation error in go\core\auth\Method::core_auth_method.PRIMARY: 11 = The property must be unique go\core\auth\Method::internalSave() returned false go\core\auth\Method::internalSave() returned false Rolling back save operation for go\core\auth\Method Exception in /usr/share/groupoffice/go/core/auth/BaseAuthenticator.php at line 52: Could not register authenticator!array ( 'core_auth_method.PRIMARY' => array ( 'code' => 11, 'description' => 'The property must be unique', ), )

0 /usr/share/groupoffice/go/core/install/updates.php(1567): go\core\auth\BaseAuthenticator::register()

1 [internal function]: go\core\Installer->{closure}()

2 /usr/share/groupoffice/go/core/Installer.php(730): call_user_func()

3 /usr/share/groupoffice/go/core/Installer.php(514): go\core\Installer->upgradeModules()

4 /usr/share/groupoffice/install/upgrade.php(119): go\core\Installer->upgrade()

5 {main}

not shure if that was caused from the error before?

br

derjoachim commented 7 months ago

This was discussed internally. Well patch it later today.

mschering commented 7 months ago

A new release will come today.

gmcpaul commented 7 months ago

update to latest version worked flawlessly, thanks!