Jump to content

Topic on Help talk:CirrusSearch/Flow

Can't run UpdateSearchIndexConfig.php file

7
Summary by DCausse (WMF)

Solved by downgrading from php 8.4 to php 8.2

75.130.249.175 (talkcontribs)

MediaWiki 1.39:

When I run the command php UpdateSearchIndexConfig.php in the CirrusSearch/maintenance folder, I get the following error:

[930f130bf0cbf86ca7483c41] [no req] Error: Class "MediaWiki\Extension\AbuseFilter\Parser\RuleCheckerFactory" not found Backtrace: from /var/www/html/w/extensions/AbuseFilter/includes/ServiceWiring.php(113) #0 /var/www/html/w/vendor/wikimedia/services/src/ServiceContainer.php(124): require() #1 /var/www/html/w/includes/MediaWikiServices.php(447): Wikimedia\Services\ServiceContainer->loadWiringFiles() #2 /var/www/html/w/includes/MediaWikiServices.php(285): MediaWiki\MediaWikiServices::newInstance() #3 /var/www/html/w/includes/Hooks.php(174): MediaWiki\MediaWikiServices::getInstance() #4 /var/www/html/w/includes/exception/MWExceptionHandler.php(807): Hooks::runner() #5 /var/www/html/w/includes/exception/MWExceptionHandler.php(336): MWExceptionHandler::logError() #6 /var/www/html/w/includes/AutoLoader.php(244): MWExceptionHandler::handleError() #7 /var/www/html/w/includes/AutoLoader.php(244): require(string) #8 /var/www/html/w/extensions/AbuseFilter/includes/ServiceWiring.php(113): AutoLoader::autoload() #9 /var/www/html/w/vendor/wikimedia/services/src/ServiceContainer.php(124): require(string) #10 /var/www/html/w/includes/MediaWikiServices.php(447): Wikimedia\Services\ServiceContainer->loadWiringFiles() #11 /var/www/html/w/includes/MediaWikiServices.php(285): MediaWiki\MediaWikiServices::newInstance() #12 /var/www/html/w/includes/Setup.php(322): MediaWiki\MediaWikiServices::getInstance() #13 /var/www/html/w/maintenance/doMaintenance.php(83): require_once(string) #14 /var/www/html/w/extensions/CirrusSearch/maintenance/UpdateSearchIndexConfig.php(117): require_once(string) #15 {main}


This file does exist in the AbuseFilter/includes/Parser folder. Does anyone know what's going on here?

PMiazga (WMF) (talkcontribs)

It's difficult to find out what could cause. Let me ask you couple questions/throw some suggestions before hand:

  • AbuseFilter files are autoloaded automatically thanks to composer `AutoloadNamespaces`. Please check if you have the merge-plugin enabled - Composer#Using composer-merge-plugin
  • Did you update/install anything recently? Is it a new set-up/installing new extensions you're trying to finalise, or is it something that worked before but stopped working after update?
  • I assume you already have both AbuseFilter and CirrusSearch extensions enabled (by calling wfLoadExtension() in LocalSettings file).
  • Can you specify exact versions of MediaWiki, are you on 1.39.10? I tried to run it and it worked to me, therefore it may be related to specific version or a version mismatch.
This post was hidden by DCausse (WMF) (history)
Bawolff (talkcontribs)

To confirm, does mediawiki work normally (like during web views) and do maintenance scripts in mediawiki core work fine (like e.g. view.php)? What version of AbuseFilter do you have?

75.130.249.175 (talkcontribs)

- I'm on MediaWiki 1.39.5.

- Just enabled the merge plugin, all composer json files should be correct. It should be noted that I installed the plugin using the tarball file, as I can't figure out how to install it from git and have it be compatible for MediaWiki 1.39.

- Both AbuseFilter and CirrusSearch extensions are enabled in LocalSettings.php

- I haven't installed any new plugins recently - I just did a full php re-install to see if that was the problem and it wasn't

- My wiki works normally in web view; scripts like view.php don't work because they run into the same error from AbuseFilter

DCausse (WMF) (talkcontribs)

Could you check if you have multiple versions of AbuseFilter installed?

I wonder if with multiple version installed, an old one gets its class loaded (likely <= 1.36) but the new one gets its ServiceWiring file executed.

Perhaps one way to investigate would be to debug the issue by printing the location of the AbuseFilter classes location:

$reflector = new \ReflectionClass( 'MediaWiki\Extension\AbuseFilter\FilterUser' );
print("FilterUser class location: " . $reflector->getFileName() . "\n");

You could perhaps put this at the very beginning of /var/www/html/w/extensions/AbuseFilter/includes/ServiceWiring.php?

Bawolff (talkcontribs)

Just to close the loop, this user reports that the issue went away after they downgraded from php 8.4 -> php 8.2

Reply to "Can't run UpdateSearchIndexConfig.php file"