Topic on Extension talk:CirrusSearch

Cirrus Search updateSearchIndexConfig.php PHP Fatal Error

11
Fschloegl (talkcontribs)

I tried to install Cirrus Search, when I'm executing the updateSearchIndexConfig.php I get the following error:

root@wiki:/var/www/html# php extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php

content index...

Fetching Elasticsearch version...2.1.1...ok

Scanning available plugins...none

Infering index identifier...PHP Fatal error:  Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]]) in /var/www/html/extensions/Elastica/vendor/ruflin/elastica/lib/Elastica/Exception/ResponseException.php on line 34

206.51.148.2 (talkcontribs)

Same here.

AmazingTrans (talkcontribs)

I think this has something to do with the elasticsearch version.

EBernhardson (WMF) (talkcontribs)

CirrusSearch does not yet support elasticsearch >=2.0. You will need to use elasticsearch 1.7.x currently. We expect to be upgrading to support >= 2.0 in the april-june timeframe.

EBernhardson (WMF) (talkcontribs)

I've also pulled a patch forward into the REL1_26 branch which should be merged in the next day or two which will error at the correct place here, when checking the elasticsearch version and give a better error message

T-maios (talkcontribs)

Hello CirrusSearch-Team,

fist of all: Thanks for providing a way to connect ElasticSearch to MediaWiki!

Second of all: I would like to provide you with my error messages to help with the development and to get help for myself! :-)

I am running the following software [Special:Version]

MediaWiki:1.26.2

PHP: 5.6.17-0+deb8u1 (apache2handler)

MySQL: 5.5.47-0+deb8u1

Elasticsearch: 1.7.5

CirrusSearch: 0.2 (Hash: c80d8ec6816d01b52033015d4c710035c4f2db4a)

Elastica: 1.3.0.0 (Hash: 2703907a9688c07b45f8d4a7e98a2c1d0047c857)

LocalSettings is configured to $wgDisableSearchUpdate = true;

According to [https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FCirrusSearch.git/HEAD/README README-instructions] I am stuck at the point where I build/update search index.

__________

$ php updateSearchIndexConfig.php

content index...

Fetching Elasticsearch version...1.7.5...ok

Scanning available plugins...none

Infering index identifier...mwiki_CP_1262-mwiki_CP__content_first

Picking analyzer...german

Creating index...

Unexpected Elasticsearch failure.

Elasticsearch failed in an unexpected way.  This is always a bug in CirrusSearch.

Error type: Elastica\Exception\ResponseException

Message: InvalidIndexNameException[[mwiki_CP_1262-mwiki_CP__content_first] Invalid index name [mwiki_CP_1262-mwiki_CP__content_first], must be lowercase]

Trace:

#0 /var/www/html/wiki_1262/extensions/Elastica/vendor/ruflin/elastica/lib/Elastica/Request.php(171): Elastica\Transport\Http->exec(Object(Elastica\Request), Array)

#1 /var/www/html/wiki_1262/extensions/Elastica/vendor/ruflin/elastica/lib/Elastica/Client.php(621): Elastica\Request->send()

#2 /var/www/html/wiki_1262/extensions/Elastica/vendor/ruflin/elastica/lib/Elastica/Index.php(494): Elastica\Client->request('mwiki_CP_1262-m...', 'PUT', Array, Array)

#3 /var/www/html/wiki_1262/extensions/Elastica/vendor/ruflin/elastica/lib/Elastica/Index.php(284): Elastica\Index->request('', 'PUT', Array, Array)

#4 /var/www/html/wiki_1262/extensions/CirrusSearch/includes/Maintenance/Validators/IndexValidator.php(124): Elastica\Index->create(Array, false)

#5 /var/www/html/wiki_1262/extensions/CirrusSearch/includes/Maintenance/Validators/IndexValidator.php(94): CirrusSearch\Maintenance\Validators\IndexValidator->createIndex(false)

#6 /var/www/html/wiki_1262/extensions/CirrusSearch/maintenance/updateOneSearchIndexConfig.php(285): CirrusSearch\Maintenance\Validators\IndexValidator->validate()

#7 /var/www/html/wiki_1262/extensions/CirrusSearch/maintenance/updateOneSearchIndexConfig.php(226): CirrusSearch\Maintenance\UpdateOneSearchIndexConfig->validateIndex()

#8 /var/www/html/wiki_1262/extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php(49): CirrusSearch\Maintenance\UpdateOneSearchIndexConfig->execute()

#9 /var/www/html/wiki_1262/maintenance/doMaintenance.php(103): CirrusSearch\Maintenance\UpdateSearchIndexConfig->execute()

#10 /var/www/html/wiki_1262/extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php(56): require_once('/var/www/html/w...')

#11 {main}

__________

Is there a way to help me with the next steps? What can I do?

Timaios.

Ezivert (talkcontribs)

Which versions of the following packages do you have installed?

I had no problems with these versions:

elasticsearch        1.7.1

libjna-java        4.1.0-1

libjna-jni        4.1.0-1

libelasticsearch1.7-java    1.7.3+dfsg-3

MediaWiki         1.26.2

Elastica        1.3.0.0

CirrusSearch        0.2

T-maios (talkcontribs)

I do have the same versions installed as you mentioned above, except for:

  • Elasticsearch 1.7.5
EBernhardson (WMF) (talkcontribs)

the problem with indices needing to be lowercased looks to be a bug in cirrus, it looks like your wiki name has capitals and we don't deal with that. I've filled https://phabricator.wikimedia.org/T135021 to track fixing this problem. Should be a relatively easy fix.

T-maios (talkcontribs)

Hey, thanks for attending to that issue.

Those capitals are part of the database name - in case that makes a difference:

"mwiki_CP_1262-mwiki_CP__content_first"

  • mwiki_CP_1262 - database name
  • mwiki_CP_ - prefix for mediawiki table names
64.166.54.199 (talkcontribs)

<InvalidIndexNameException[[MediaWiki_content_first] Invalid index name [MediaWiki_con

tent_first], must be lowercase]>

To solve:

  1. Take a dump of your mediawiki sql table, eg, "MediaWiki" and rename the database to all lowercase, ie "mediawiki" less the apostrophes. I did this everywhere in the database (~448 instances) using Notepad++.
  2. Upload the new lowercased database into mysql.
  3. Open your localsettings.php file in the wiki folder and change the database name from the original uppercase to the lowercase version. Your wiki will now point to the new lowercase database.
  4. Run the script to create the index: php /var/www/extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php
  5. If OK, you'll see the script fetch elasticsearch version...1.7.2...ok ...blah blah blah ...Indexing namespaces...done.
Reply to "Cirrus Search updateSearchIndexConfig.php PHP Fatal Error"