Last modified: 2010-05-15 15:34:04 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T4543, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 2543 - Unable to rebuild indexes in V1.4.5
Unable to rebuild indexes in V1.4.5
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
PC Windows 2000
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2005-06-26 23:55 UTC by Jason Armistead
Modified: 2010-05-15 15:34 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Jason Armistead 2005-06-26 23:55:54 UTC
If I try to run any of the maintenance scripts (in my case rebuildall.php or rebuildtextindex.php) 
then I get a couple of errors as follows:

C:\xampp\xampp\htdocs\MEDIAW~1.5\MAINTE~1>C:\xampp\xampp\php\php rebuildall.php

Warning: Invalid argument supplied for foreach() in C:\xampp\xampp\htdocs\MEDIAW~1.5\MAINTE~1
\ on line 156

Fatal error: Call to a member function tableName() on a non-object in 
C:\xampp\xampp\htdocs\mediawiki-1.4.5\includes\ObjectCache.php on line 409

The first error in is related to the newly added multiple DB server code.  It gets 
cranky because foreach is expecting an array, but if you aren't using multiple DB servers, then 
it's just a single false value per DefaultSettings.php

Adding a check using is_array seems to make this happier, as follows:

   if (is_array($wgDBservers)) {
     foreach ( $wgDBservers as $i => $server ) {
       $wgDBservers[$i]['user'] = $wgDBuser;
       $wgDBservers[$i]['password'] = $wgDBpassword;

The second error, I haven't yet figured out why it is getting upset.  This worked OK in V1.4.4

The rest of the MediaWiki software seems to be running OK (the apache / web part).  It's just the 
maintenance scripts that seem to be giving troubles.


Comment 1 Brion Vibber 2005-06-27 00:01:50 UTC
Sounds like a database connection failed in some way, returning a null object; can you 
confirm correct $wgDBadminuser and $wgDBadminpassword settings in AdminSettings.php?
Comment 2 Jason Armistead 2005-06-27 00:11:07 UTC
Right on Brion !

I forgot to fix AdminSettings after I changed my MySQL password.

Can these maintenance scripts fail more "gracefully" ?

Even just a couple of printfs for the dummies like me to remind me to check AdminSettings.php is (a) present and (b) is 
correctly configured, would be good.  After all, we may not touch some parts of the MediaWiki system in between upgrades.

I only decided to reindex because I reconfigured MySQL to use a fulltext index word length of 3 instead of 4 to catch all the 
TLAs we're using on our wiki.

As for the first bug - that's definitely a bug rather than a result of my brain fading !


Comment 3 Brion Vibber 2005-12-12 02:53:08 UTC
Seems to work fine on current CVS HEAD with PHP 4.4.1, 5.0.5, and 5.1.1.
The foreach() thing sounds like a problem with really old versions of PHP,
which we no longer support.


Note You need to log in before you can comment on or make changes to this bug.