Update from 4.2.4 -> 4.5

Hey guys,

updating my instance from 4.2.4 to 4.5 I get this error:

-------------------------------------------------------- Import task(s) — Importing from smw.vocab.json … … MediaWiki:Smw import schema …[2024-11-26T17:23:09.823172+01:00] exception.ERROR: [bc7a8df58af1e31e9d1f5531] [no req] Wikimedia\Rdbms\DBUnexpectedError: Cannot execute Wikimedia\Rdbms\Database::runOnTransactionIdleCallbacks critical section while session state is out of sync. A critical section from Wikimedia\Rdbms\Database::runOnTransactionIdleCallbacks has failed #0 /var/www/extdata/html/bluespice/w/vendor/wikimedia/request-timeout/src/CriticalSectionScope.php(44): Wikimedia\Rdbms\Database->Wikimedia\Rdbms{closure}() #1 /var/www/extdata/html/bluespice/w/includes/libs/rdbms/database/Database.php(2412): Wikimedia\RequestTimeout\CriticalSectionScope->__destruct() #2 /var/www/extdata/html/bluespice/w/includes/libs/rdbms/database/DBConnRef.php(103): Wikimedia\Rdbms\Database->onTransactionCommitOrIdle() #3 /var/www/extdata/html/bluespice/w/includes/libs/rdbms/database/DBConnRef.php(628): Wikimedia\Rdbms\DBConnRef->__call() #4 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/MediaWiki/Connection/Database.php(784): Wikimedia\Rdbms\DBConnRef->onTransactionCommitOrIdle() #5 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/Importer/ContentCreators/TextContentCreator.php(143): SMW\MediaWiki\Connection\Database->onTransactionCommitOrIdle() #6 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/Importer/ContentCreators/DispatchingContentCreator.php(75): SMW\Importer\ContentCreators\TextContentCreator->create() #7 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/Importer/Importer.php(142): SMW\Importer\ContentCreators\DispatchingContentCreator->create() #8 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/Importer/Importer.php(120): SMW\Importer\Importer->doImport() #9 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/MediaWiki/Hooks.php(1510): SMW\Importer\Importer->runImport() #10 /var/www/extdata/html/bluespice/w/includes/HookContainer/HookContainer.php(338): SMW\MediaWiki\Hooks->onAfterCreateTablesComplete() #11 /var/www/extdata/html/bluespice/w/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook() #12 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/MediaWiki/HookDispatcher.php(308): MediaWiki\HookContainer\HookContainer->run() #13 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/SQLStore/Installer.php(279): SMW\MediaWiki\HookDispatcher->onInstallerAfterCreateTablesComplete() #14 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/SQLStore/SQLStore.php(456): SMW\SQLStore\Installer->install() #15 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/Store.php(490): SMW\SQLStore\SQLStore->setup() #16 /var/www/extdata/html/bluespice/w/includes/installer/DatabaseUpdater.php(547): SMW\Store::setupStore() #17 /var/www/extdata/html/bluespice/w/includes/installer/DatabaseUpdater.php(515): DatabaseUpdater->runUpdates() #18 /var/www/extdata/html/bluespice/w/maintenance/update.php(209): DatabaseUpdater->doUpdates() #19 /var/www/extdata/html/bluespice/w/maintenance/includes/MaintenanceRunner.php(309): UpdateMediaWiki->execute() #20 /var/www/extdata/html/bluespice/w/maintenance/doMaintenance.php(85): MediaWiki\Maintenance\MaintenanceRunner->run() #21 /var/www/extdata/html/bluespice/w/maintenance/update.php(319): require_once(‘…’) #22 {main} {“exception”:“[object] (Wikimedia\Rdbms\DBUnexpectedError(code: 0): Cannot execute Wikimedia\Rdbms\Database::runOnTransactionIdleCallbacks critical section while session state is out of sync.\n\nA critical section from Wikimedia\Rdbms\Database::runOnTransactionIdleCallbacks has failed\n#0 /var/www/extdata/html/bluespice/w/vendor/wikimedia/request-timeout/src/CriticalSectionScope.php(44): Wikimedia\Rdbms\Database->Wikimedia\Rdbms\{closure}()\n#1 /var/www/extdata/html/bluespice/w/includes/libs/rdbms/database/Database.php(2412): Wikimedia\RequestTimeout\CriticalSectionScope->__destruct()\n#2 /var/www/extdata/html/bluespice/w/includes/libs/rdbms/database/DBConnRef.php(103): Wikimedia\Rdbms\Database->onTransactionCommitOrIdle()\n#3 /var/www/extdata/html/bluespice/w/includes/libs/rdbms/database/DBConnRef.php(628): Wikimedia\Rdbms\DBConnRef->__call()\n#4 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/MediaWiki/Connection/Database.php(784): Wikimedia\Rdbms\DBConnRef->onTransactionCommitOrIdle()\n#5 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/Importer/ContentCreators/TextContentCreator.php(143): SMW\MediaWiki\Connection\Database->onTransactionCommitOrIdle()\n#6 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/Importer/ContentCreators/DispatchingContentCreator.php(75): SMW\Importer\ContentCreators\TextContentCreator->create()\n#7 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/Importer/Importer.php(142): SMW\Importer\ContentCreators\DispatchingContentCreator->create()\n#8 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/Importer/Importer.php(120): SMW\Importer\Importer->doImport()\n#9 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/MediaWiki/Hooks.php(1510): SMW\Importer\Importer->runImport()\n#10 /var/www/extdata/html/bluespice/w/includes/HookContainer/HookContainer.php(338): SMW\MediaWiki\Hooks->onAfterCreateTablesComplete()\n#11 /var/www/extdata/html/bluespice/w/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook()\n#12 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/MediaWiki/HookDispatcher.php(308): MediaWiki\HookContainer\HookContainer->run()\n#13 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/SQLStore/Installer.php(279): SMW\MediaWiki\HookDispatcher->onInstallerAfterCreateTablesComplete()\n#14 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/SQLStore/SQLStore.php(456): SMW\SQLStore\Installer->install()\n#15 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/Store.php(490): SMW\SQLStore\SQLStore->setup()\n#16 /var/www/extdata/html/bluespice/w/includes/installer/DatabaseUpdater.php(547): SMW\Store::setupStore()\n#17 /var/www/extdata/html/bluespice/w/includes/installer/DatabaseUpdater.php(515): DatabaseUpdater->runUpdates()\n#18 /var/www/extdata/html/bluespice/w/maintenance/update.php(209): DatabaseUpdater->doUpdates()\n#19 /var/www/extdata/html/bluespice/w/maintenance/includes/MaintenanceRunner.php(309): UpdateMediaWiki->execute()\n#20 /var/www/extdata/html/bluespice/w/maintenance/doMaintenance.php(85): MediaWiki\Maintenance\MaintenanceRunner->run()\n#21 /var/www/extdata/html/bluespice/w/maintenance/update.php(319): require_once(‘…’)\n#22 {main} at /var/www/extdata/html/bluespice/w/includes/libs/rdbms/database/Database.php:3622)”,“exception_url”:“[no req]”,“reqId”:“bc7a8df58af1e31e9d1f5531”,“caught_by”:“mwe_handler”} {“host”:“srvcsirtappt0006”,“wiki”:“wdbprod”,“mwversion”:“1.39.8”,“reqId”:“bc7a8df58af1e31e9d1f5531”,“cli_argv”:“maintenance/update.php”}

I am on Ubuntu 22 with php 8.0

Can someone help me with this?

regards
Daniel

Hi Daniel,
a bit more details on your update steps might help, especially the update package you are using. Here you have an error when working with semantic mediawiki related databases, hence I think there are two directions to try:
1, restart your web server and php services, try to get rid of potential cache issues or stuck transactions;
2, manually run the semantic mediawiki maintenance scripts:

php extensions/SemanticMediaWiki/maintenance/setupStore.php
php extensions/SemanticMediaWiki/maintenance/rebuildData.php -v

then retry php maintenance/update.php. Hope you can get your BlueSpice 4.5.x running soon = )

Hi @huaj1ng

Thanks for your steps. On the second step, rebuilding the data I get this error now:

Rebuilding semantic data … … selecting 1 to 1256 IDs … PHP Warning: Undefined array key “implicit” in /var/www/extdata/html/bluespice/w/includes/user/UserGroupManager.php on line 271 [fe7f361bcd8f7be99f0685d2] [no req] TypeError from line 271 of /var/www/extdata/html/bluespice/w/includes/user/UserGroupManager.php: MediaWiki\User\UserGroupManager::getUserImplicitGroups(): Return value must be of type array, null returned Backtrace: #0 /var/www/extdata/html/bluespice/w/includes/user/UserGroupManager.php(303): MediaWiki\User\UserGroupManager->getUserImplicitGroups() #1 /var/www/extdata/html/bluespice/w/includes/user/User.php(2973): MediaWiki\User\UserGroupManager->getUserEffectiveGroups() #2 /var/www/extdata/html/bluespice/w/includes/Permissions/PermissionManager.php(1295): User->getEffectiveGroups() #3 /var/www/extdata/html/bluespice/w/includes/Permissions/PermissionManager.php(1244): MediaWiki\Permissions\PermissionManager->getUserPermissions() #4 /var/www/extdata/html/bluespice/w/includes/Permissions/PermissionManager.php(817): MediaWiki\Permissions\PermissionManager->userHasRight() #5 /var/www/extdata/html/bluespice/w/includes/Permissions/PermissionManager.php(409): MediaWiki\Permissions\PermissionManager->checkQuickPermissions() #6 /var/www/extdata/html/bluespice/w/includes/Permissions/PermissionManager.php(243): MediaWiki\Permissions\PermissionManager->getPermissionErrorsInternal() #7 /var/www/extdata/html/bluespice/w/extensions/BlueSpicePageAssignments/src/Assignment/Group.php(57): MediaWiki\Permissions\PermissionManager->userCan() #8 /var/www/extdata/html/bluespice/w/extensions/BlueSpicePageAssignments/src/TitleTarget.php(99): BlueSpice\PageAssignments\Assignment\Group->getUserIds() #9 /var/www/extdata/html/bluespice/w/extensions/BlueSpicePageAssignments/src/PageAssignmentsPropertyValueProvider.php(102): BlueSpice\PageAssignments\TitleTarget->getAssignedUserIDs() #10 [internal function]: BlueSpice\PageAssignments\PageAssignmentsPropertyValueProvider->addAnnotation() #11 /var/www/extdata/html/bluespice/w/extensions/SemanticExtraSpecialProperties/src/PropertyAnnotators/LocalPropertyAnnotator.php(75): call_user_func_array() #12 /var/www/extdata/html/bluespice/w/extensions/SemanticExtraSpecialProperties/src/PropertyAnnotators/LocalPropertyAnnotator.php(58): SESP\PropertyAnnotators\LocalPropertyAnnotator->callOnLocalDef() #13 /var/www/extdata/html/bluespice/w/extensions/SemanticExtraSpecialProperties/src/ExtraPropertyAnnotator.php(70): SESP\PropertyAnnotators\LocalPropertyAnnotator->addAnnotation() #14 /var/www/extdata/html/bluespice/w/extensions/SemanticExtraSpecialProperties/src/HookRegistry.php(178): SESP\ExtraPropertyAnnotator->addAnnotation() #15 /var/www/extdata/html/bluespice/w/includes/HookContainer/HookContainer.php(329): SESP\HookRegistry->SESP{closure}() #16 /var/www/extdata/html/bluespice/w/includes/HookContainer/HookContainer.php(132): MediaWiki\HookContainer\HookContainer->callLegacyHook() #17 /var/www/extdata/html/bluespice/w/includes/Hooks.php(137): MediaWiki\HookContainer\HookContainer->run() #18 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/Store.php(230): Hooks::run() #19 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/DataUpdater.php(418): SMW\Store->updateData() #20 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/DataUpdater.php(297): SMW\DataUpdater->updateData() #21 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/DataUpdater.php(197): SMW\DataUpdater->runUpdate() #22 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/ParserData.php(469): SMW\DataUpdater->doUpdate() #23 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/MediaWiki/Jobs/UpdateJob.php(303): SMW\ParserData->updateStore() #24 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/MediaWiki/Jobs/UpdateJob.php(216): SMW\MediaWiki\Jobs\UpdateJob->updateStore() #25 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/MediaWiki/Jobs/UpdateJob.php(137): SMW\MediaWiki\Jobs\UpdateJob->parse_content() #26 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/MediaWiki/Jobs/UpdateJob.php(94): SMW\MediaWiki\Jobs\UpdateJob->doUpdate() #27 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/SQLStore/Rebuilder/Rebuilder.php(239): SMW\MediaWiki\Jobs\UpdateJob->run() #28 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/Maintenance/DataRebuilder.php(466): SMW\SQLStore\Rebuilder\Rebuilder->rebuild() #29 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/Maintenance/DataRebuilder.php(383): SMW\Maintenance\DataRebuilder->doUpdateById() #30 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/src/Maintenance/DataRebuilder.php(222): SMW\Maintenance\DataRebuilder->rebuildAll() #31 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/maintenance/rebuildData.php(198): SMW\Maintenance\DataRebuilder->rebuild() #32 /var/www/extdata/html/bluespice/w/maintenance/doMaintenance.php(107): SMW\Maintenance\rebuildData->execute() #33 /var/www/extdata/html/bluespice/w/extensions/SemanticMediaWiki/maintenance/rebuildData.php(294): require_once(string) #34 {main}

seemes to be any user or permission problem. Any ideas?

Hello Daniel,

I would like to confirm whether line 316, 358, 403 of the script /var/www/extdata/html/bluespice/w/includes/user/UserGroupManager.php ends with ?? [];, for example line 316 should be

return $this->userGroupCache[$userKey][self::CACHE_IMPLICIT] ?? [];

The error in your recent feedback MediaWiki\User\UserGroupManager::getUserImplicitGroups(): Return value must be of type array, null returned
is a known one, which should be fixed by the bluespice patch /var/www/extdata/html/bluespice/w/_bluespice/patches/includes/user/UserGroupManager.php.diff

If you find that your code is not yet patched, please run script /var/www/extdata/html/bluespice/w/_bluespice/pre-autoload-dump.sh to apply the patches.

Please let me know if this helps to make rebuildData.php work = )