Page MenuHomePhabricator

[PropertySuggester] MWException from line 167 of /workspace/src/includes/Hooks.php: Invalid callback PropertySuggester\Hooks::onCreateSchema in hooks for LoadExtensionSchemaUpdates
Closed, ResolvedPublic

Description

Using mediawiki/vendor the installer fails to find PropertySuggester\Hooks::onCreateSchema, I guess because of an autoloading issue. See P7166 :

Creating tables for enabled extensions
[549c7b872c52e917bbc0572f] [no req]   MWException from line 167 of /workspace/src/includes/Hooks.php: Invalid callback PropertySuggester\Hooks::onCreateSchema in hooks for LoadExtensionSchemaUpdates

Backtrace:
#0 /workspace/src/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)
#1 /workspace/src/includes/installer/DatabaseUpdater.php(127): Hooks::run(string, array)
#2 /workspace/src/includes/installer/DatabaseUpdater.php(192): DatabaseUpdater->__construct(Wikimedia\Rdbms\DatabaseMysqli, boolean, NULL)
#3 /workspace/src/includes/installer/DatabaseInstaller.php(312): DatabaseUpdater::newForDB(Wikimedia\Rdbms\DatabaseMysqli)
#4 /workspace/src/includes/installer/Installer.php(1567): DatabaseInstaller->createExtensionTables(MysqlInstaller)
#5 /workspace/src/includes/installer/CliInstaller.php(138): Installer->performInstallation(array, array)
#6 /workspace/src/maintenance/install.php(125): CliInstaller->execute()
#7 /workspace/src/maintenance/doMaintenance.php(94): CommandLineInstaller->execute()
#8 /workspace/src/maintenance/install.php(175): require_once(string)
#9 {main}

extension.json has:

"AutoloadNamespaces": {
    "PropertySuggester\\": "src/",
    "PropertySuggester\\Maintenance\\": "maintenance/"
},

But maybe that is not available in the installer :( Which would be similar to T193855 / https://gerrit.wikimedia.org/r/#/c/430887/

Event Timeline

hashar created this task.May 28 2018, 4:40 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 28 2018, 4:40 PM
hashar updated the task description. (Show Details)May 28 2018, 4:48 PM
hashar updated the task description. (Show Details)
hashar added a subscriber: Legoktm.
hashar updated the task description. (Show Details)May 28 2018, 5:07 PM
hashar updated the task description. (Show Details)
Legoktm claimed this task.May 28 2018, 5:42 PM

Hmm, I think I know what's wrong.

I triggered a test with PropertySuggester dummy change https://gerrit.wikimedia.org/r/#/c/376692/ made to depends on my old/abandonned mw/core patch https://gerrit.wikimedia.org/r/#/c/430887/ . That seems to pass through the failure. https://integration.wikimedia.org/ci/job/quibble-composer-mysql-php70-docker/2079/console (only to hit another one down in the chain).

I think that got addressed via T195823 for WikibaseLexeme, specifically by:

[mediawiki/core@master] Don't autoload classes in AutoloadStructureTest
https://gerrit.wikimedia.org/r/436078

It now fails due to WikibaseQuality:

AutoLoaderStructureTest::testPSR4Completeness

-WikibaseQuality\ConstraintReport\Tests\Checker\AllowedUnitsCheckerTest
+WikibaseQuality\ConstraintReport\Tests\AllowedUnitsCheckerTest

@WMDE-leszek is aware of it and extensions will be polished up.

Change 436355 had a related patch set uploaded (by Hashar; owner: Hashar):
[mediawiki/core@master] ExtensionRegistry now initialize psr4 namespaces

https://gerrit.wikimedia.org/r/436355

With Gerrit 436355 PropertySuggester managed to load its class :]

Change 436355 merged by jenkins-bot:
[mediawiki/core@master] registration: Initialize PSR-4 namespaces at same stage as normal autoloader

https://gerrit.wikimedia.org/r/436355

Change 436479 had a related patch set uploaded (by Legoktm; owner: Hashar):
[mediawiki/core@REL1_31] registration: Initialize PSR-4 namespaces at same stage as normal autoloader

https://gerrit.wikimedia.org/r/436479

Change 436479 merged by jenkins-bot:
[mediawiki/core@REL1_31] registration: Initialize PSR-4 namespaces at same stage as normal autoloader

https://gerrit.wikimedia.org/r/436479

hashar closed this task as Resolved.May 31 2018, 10:53 AM
hashar claimed this task.

Solved in mediawiki/core with https://gerrit.wikimedia.org/r/436355 which causes the extension registry to properly initialize the autoloader with whatever PS4 namespace we need.

Cool, thanks for the magic @hashar!

Vvjjkkii renamed this task from [PropertySuggester] MWException from line 167 of /workspace/src/includes/Hooks.php: Invalid callback PropertySuggester\Hooks::onCreateSchema in hooks for LoadExtensionSchemaUpdates to w4baaaaaaa.Jul 1 2018, 1:07 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii removed hashar as the assignee of this task.
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: gerritbot, Aklapper.
CommunityTechBot renamed this task from w4baaaaaaa to [PropertySuggester] MWException from line 167 of /workspace/src/includes/Hooks.php: Invalid callback PropertySuggester\Hooks::onCreateSchema in hooks for LoadExtensionSchemaUpdates.Jul 2 2018, 3:32 PM
CommunityTechBot closed this task as Resolved.
CommunityTechBot raised the priority of this task from High to Needs Triage.