Topic on Project:Support desk

$dbKey: must not be empty

5
Ticklehill (talkcontribs)

I noticed some pages were missing from search, tried to rebuild but have lost me search index.

The site is 20 years old, I am running version 1.38.2.


Grateful for any help / clue what to do.


php maintenance/rebuildall.php

** Rebuilding fulltext search index (if you abort this will break searching; run this script again to fix):

Dropping index...

Clearing searchindex table...Done

Rebuilding index fields for 512234 pages...

...

5000

Wikimedia\Assert\ParameterAssertionException from line 72 of /var/www/html/wiki/vendor/wikimedia/assert/src/Assert.php: Bad value for parameter $dbKey: must not be empty

#0 /var/www/html/wiki/includes/page/PageReferenceValue.php(66): Wikimedia\Assert\Assert::parameter()

#1 /var/www/html/wiki/includes/page/PageIdentityValue.php(87): MediaWiki\Page\PageReferenceValue->__construct()

#2 /var/www/html/wiki/includes/Revision/RevisionStore.php(1722): MediaWiki\Page\PageIdentityValue->__construct()

#3 /var/www/html/wiki/includes/Revision/RevisionStore.php(1609): MediaWiki\Revision\RevisionStore->newRevisionFromRowAndSlots()

#4 /var/www/html/wiki/maintenance/rebuildtextindex.php(116): MediaWiki\Revision\RevisionStore->newRevisionFromRow()

#5 /var/www/html/wiki/maintenance/rebuildtextindex.php(68): RebuildTextIndex->populateSearchIndex()

#6 /var/www/html/wiki/maintenance/rebuildall.php(48): RebuildTextIndex->execute()

#7 /var/www/html/wiki/maintenance/doMaintenance.php(114): RebuildAll->execute()

#8 /var/www/html/wiki/maintenance/rebuildall.php(67): require_once('...')

#9 {main}

Ticklehill (talkcontribs)

I did a fresh mediawiki-1.39.3 install, updated the DB and still ...


php rebuildall.php

Wikimedia\Assert\ParameterAssertionException from line 72 of /var/www/html/newiki/vendor/wikimedia/assert/src/Assert.php: Bad value for parameter $dbKey: must not be empty


A clue, a hint, a suggestion, anything ....

Ticklehill (talkcontribs)

We are still stuck with no search index, can anyone help ?

TheDJ (talkcontribs)

This likely means you have an invalid row in your Database. If you look at rebuildTextIndex.php in function populateSearchIndex, you will find a fragment like this:

$title = Title::makeTitle( $s->page_namespace, $s->page_title );

try {

$revRecord = $revStore->newRevisionFromRow( $s );


So from DB row $s (which I think is a join from the revision and page tables...) it builds a Title and then tries to find the revision records that go with that title. It seems this value is empty or otherwise invalid. This is strange, as it did join on page_latest = rev_id and it has a page_id , but does not have a valid title for it. Try adding some $this->output to the script there, to figure out what the page_id and page_latest are. Then retrieve the values page_namespace and page_title and figure out what is wrong here. Then check your database if you have more entries like this and see if you can maybe fill/overwrite the tables with correct or at least 'usable' data. Always backups first of course.

Ticklehill (talkcontribs)

Many thanks, I put in some debug as below, please would you expand upon the next step


code ....


try {

                                        $revRecord = $revStore->newRevisionFromRow( $s );

                                        $content = $revRecord->getContent( SlotRecord::MAIN );

                                        $this->output("A->" . $s->page_id . "<->" . $s->page_namespace . "<->" . $s->page_title . "<-bar\n");

                                        $u = new SearchUpdate( $s->page_id, $title, $content );

                                        $u->doUpdate();

                                        $this->output("B->" . $s->page_id . "<->" . $s->page_namespace . "<->" . $s->page_title . "<-bar\n");

                                }

output ....


A->5310<->0<->Freddie_Mack<-bar

B->5310<->0<->Freddie_Mack<-bar

Wikimedia\Assert\ParameterAssertionException from line 72 of /var/www/html/wiki/vendor/wikimedia/assert/src/Assert.php: Bad value for parameter $dbKey: must not be empty

#0 /var/www/html/wiki/includes/page/PageReferenceValue.php(66): Wikimedia\Assert\Assert::parameter()

Reply to "$dbKey: must not be empty"