Page MenuHomePhabricator

PHP Warnings when "startingOver" an index
Closed, ResolvedPublic

Description

This message appears on MediaWiki 1.23.6 and CirrusSearch 0.2 (downloaded today for mw 1.23) when you startover an index (tested with elasicsearch 1.3.5 and 1.4.0):

php updateSearchIndexConfig.php --startOver

root@kc-alpha /var/www/wiki/mw-test/extensions/CirrusSearch/maintenance # php updateSearchIndexConfig.php --startOver

content index...

Fetching Elasticsearch version...1.4.0...ok
Scanning available plugins...
        head
Infering index identifier...wiki_wiki_mw-test_content_1412408671
Picking analyzer...german
Blowing away index to start over...ok
Validating analyzers...ok
Validating mappings...
        Validating mapping...different...corrected
Validating cache warmers...

PHP Notice: Undefined index: warmers in /var/www/wiki/mw-test/extensions/CirrusSearch/includes/Maintenance/CacheWarmers.php on line 95
PHP Warning: Invalid argument supplied for foreach() in /var/www/wiki/mw-test/extensions/CirrusSearch/includes/Maintenance/CacheWarmers.php on line 96
PHP Warning: array_diff_key(): Argument #1 is not an array in /var/www/wiki/mw-test/extensions/CirrusSearch/includes/Maintenance/CacheWarmers.php on line 47

Updating Main Page...done

PHP Warning: Invalid argument supplied for foreach() in /var/www/wiki/mw-test/extensions/CirrusSearch/includes/Maintenance/CacheWarmers.php on line 129

Validating aliases...
        Validating content alias...alias is free...corrected
        Validating all alias...alias not already assigned to this index...corrected
        Updating tracking indexes...done

general index...

Fetching Elasticsearch version...1.4.0...ok
Scanning available plugins...
        head
Infering index identifier...wiki_wiki_mw-test_general_1412408672
Picking analyzer...german
Blowing away index to start over...ok
Validating analyzers...ok
Validating mappings...
        Validating mapping...different...corrected
Validating cache warmers...

PHP Notice: Undefined index: warmers in /var/www/wiki/mw-test/extensions/CirrusSearch/includes/Maintenance/CacheWarmers.php on line 95
PHP Warning: Invalid argument supplied for foreach() in /var/www/wiki/mw-test/extensions/CirrusSearch/includes/Maintenance/CacheWarmers.php on line 96
PHP Warning: array_diff_key(): Argument #1 is not an array in /var/www/wiki/mw-test/extensions/CirrusSearch/includes/Maintenance/CacheWarmers.php on line 47
PHP Warning: Invalid argument supplied for foreach() in /var/www/wiki/mw-test/extensions/CirrusSearch/includes/Maintenance/CacheWarmers.php on line 129

Validating aliases...
        Validating general alias...alias is free...corrected
        Validating all alias...alias not already assigned to this index...corrected
        Updating tracking indexes...done
        Deleting namespaces...done
        Indexing namespaces...done

Version: REL1_23-branch
Severity: minor
OS: Linux
Platform: Other

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 4:00 AM
bzimport added a project: CirrusSearch.
bzimport set Reference to bz73457.
bzimport added a subscriber: Unknown Object (MLST).
SmartK created this task.Nov 15 2014, 10:36 AM

Update: same with MediaWiki 1.23.6 and then both master versions of CirrusSerach and Elastica

SmartK added a comment.Dec 4 2014, 7:57 AM

Update: Same with MediaWiki 1.24.0

demon closed this task as Resolved.Dec 4 2014, 2:56 PM
demon claimed this task.

We got rid of --startingOver.

SmartK added a comment.Dec 4 2014, 2:58 PM

OK, thank you for the info Chad. How would you suggest to "reindex"?

demon added a comment.Dec 4 2014, 3:04 PM

For reindexing in place, you can still use --reindexAndRemoveOk --indexIdentifier now like the README outlines. Barring that, if you need a full rebuild you have to drop the the index from ES and then run updateSearchIndexConfig.php fresh.

In T75457#818867, @Chad wrote:

We got rid of --startingOver.

No we didn't. Its totally still there:

vagrant@mediawiki-vagrant:~$ php /vagrant/mediawiki/extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php --startOver
content index...
	Fetching Elasticsearch version...1.3.4...ok
	Scanning available plugins...

And its important! I rarely run over `--reindexAndRemoveOk --indexIdentifier``` now but its still useful if you know that your index is totally busted and needs to be rebuilt from scratch whatever the downtime. So, yeah, we won't ever run it in production. But still.

I think I'll need to do another backport release for 1.24 soon anyway. I can grab it then. I'm pretty careful with those backport releases. I make sure the whole test suite passes and I rebuild the index a bunch of times. But I must have missed --startOver the last time I did it. I _think_ those warnings are pretty harmless so you should be able to proceed from there but I'll make sure to squash them soon.

Manybubbles reopened this task as Open.Dec 4 2014, 3:06 PM
Manybubbles triaged this task as Medium priority.
Manybubbles set Security to None.
SmartK added a comment.Dec 4 2014, 3:18 PM

Ok, got it. Thank you Chad and thank you Manybubbles.
CirrusSearch works great also in 1.24.0 so far, just wanted to report the "error".

Thanks again...

SmartK added a comment.Dec 4 2014, 3:45 PM

Just a short info with MediaWiki 1.24.0. When I use "php updateSearchIndexConfig.php --reindexAndRemoveOk --indexIdentifier now" as Chad suggested the same PHP Warning pops up. See below.

php updateSearchIndexConfig.php --reindexAndRemoveOk --indexIdentifier now    
                       
content index...
        Fetching Elasticsearch version...1.4.1...ok
        Scanning available plugins...
                head
        Setting index identifier...wiki_content_1417707626
        Picking analyzer...german
        Creating index...ok
        Validating analyzers...ok
        Validating mappings...
                Validating mapping...different...corrected
        Validating cache warmers...
PHP Notice:  Undefined index: warmers in /var/www/wiki/extensions/CirrusSearch/includes/Maintenance/CacheWarmers.php on line 95
PHP Warning:  Invalid argument supplied for foreach() in /var/www/wiki/extensions/CirrusSearch/includes/Maintenance/CacheWarmers.php on line 96
PHP Warning:  array_diff_key(): Argument #1 is not an array in /var/www/wiki/extensions/CirrusSearch/includes/Maintenance/CacheWarmers.php on line 47
                Updating Main Page...done
PHP Warning:  array_keys() expects parameter 1 to be array, null given in /var/www/wiki/extensions/CirrusSearch/includes/Maintenance/CacheWarmers.php on line 129
PHP Warning:  Invalid argument supplied for foreach() in /var/www/wiki/extensions/CirrusSearch/includes/Maintenance/CacheWarmers.php on line 129
        Validating aliases...
                Validating content alias...is taken...
                Reindexing...

Change 182297 had a related patch set uploaded (by Chad):
When an index has no warmers it won't return anything

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

Patch-For-Review

Change 182297 merged by jenkins-bot:
When an index has no warmers it won't return anything

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

demon closed this task as Resolved.Dec 30 2014, 10:44 PM
demon moved this task from Backlog to Done on the MediaWiki-Core-Team board.

I can confirm that this is resolved now. I tried the "master" version of CirrusSearch together with MediaWiki 1.24.1.

Thank you again.

bd808 moved this task from Done to Archive on the MediaWiki-Core-Team board.Jan 5 2015, 10:16 PM