Page MenuHomePhabricator

DBQueryError on Wikitech Static Search
Closed, ResolvedPublicPRODUCTION ERROR

Description

Special:Search on https://wikitech-static.wikimedia.org fails with a database error: [7cffe91bd97b733bea47d0e6] 2020-01-26 22:05:00: Fatal exception of type "Wikimedia\Rdbms\DBQueryError". The search bar on each page works as expected.

See also 105a282e52f525c02425aa97 on https://wikitech-static.wikimedia.org/w/index.php?search=Test&title=Special%3ASearch&profile=default&fulltext=1

Details

Request ID
7cffe91bd97b733bea47d0e6 / 105a282e52f525c02425aa97
Request URL
https://wikitech-static.wikimedia.org/w/index.php?search=Test&title=Special%3ASearch&profile=default&fulltext=1

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
RhinosF1 changed the subtype of this task from "Task" to "Production Error".Jan 26 2020, 10:19 PM
RhinosF1 set Request ID to 7cffe91bd97b733bea47d0e6.
RhinosF1 set Request URL to https://wikitech-static.wikimedia.org/wiki/Special:Search.
RhinosF1 renamed this task from Search broken on wikitech-static to DBQueryError on Wikitech Static Search.Jan 26 2020, 10:23 PM
RhinosF1 changed Request URL from https://wikitech-static.wikimedia.org/wiki/Special:Search to https://wikitech-static.wikimedia.org/w/index.php?search=Test&title=Special%3ASearch&profile=default&fulltext=1.
RhinosF1 changed Request ID from 7cffe91bd97b733bea47d0e6 to 7cffe91bd97b733bea47d0e6 / 105a282e52f525c02425aa97.
RhinosF1 updated the task description. (Show Details)
bd808 subscribed.

Removing Wikimedia-database-issue as wikitech-static is not really a "production" wiki.

[dbf6b55549aeaa4dd45553af] /w/index.php?search=ceph&title=Special%3ASearch&profile=default&fulltext=1 Wikimedia\Rdbms\DBQueryError from line 1603 of /srv/mediawiki/w/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?
Query: SELECT page_id,page_namespace,page_title FROM `page`,`searchindex` WHERE (page_id=si_page) AND ( MATCH(si_title) AGAINST('+ceph ' IN BOOLEAN MODE) ) AND page_namespace = '0' ORDER BY MATCH(si_title) AGAINST('+ceph ' IN NATURAL LANGUAGE MODE) DESC LIMIT 21
Function: SearchMySQL::searchInternal
Error: 144 Table './wikitech/searchindex' is marked as crashed and last (automatic?) repair failed (localhost)

Backtrace:

#0 /srv/mediawiki/w/includes/libs/rdbms/database/Database.php(1574): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
#1 /srv/mediawiki/w/includes/libs/rdbms/database/Database.php(1152): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#2 /srv/mediawiki/w/includes/libs/rdbms/database/Database.php(1807): Wikimedia\Rdbms\Database->query(string, string)
#3 /srv/mediawiki/w/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->select(array, array, array, string, array, array)
#4 /srv/mediawiki/w/includes/libs/rdbms/database/DBConnRef.php(315): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#5 /srv/mediawiki/w/includes/search/SearchMySQL.php(193): Wikimedia\Rdbms\DBConnRef->select(array, array, array, string, array, array)
#6 /srv/mediawiki/w/includes/search/SearchMySQL.php(179): SearchMySQL->searchInternal(string, boolean)
#7 /srv/mediawiki/w/includes/search/SearchDatabase.php(73): SearchMySQL->doSearchTitleInDB(string)
#8 /srv/mediawiki/w/includes/search/SearchEngine.php(143): SearchDatabase->doSearchTitle(string)
#9 /srv/mediawiki/w/includes/search/SearchEngine.php(172): SearchEngine->{closure}()
#10 /srv/mediawiki/w/includes/search/SearchEngine.php(144): SearchEngine->maybePaginate(Closure)
#11 /srv/mediawiki/w/includes/specials/SpecialSearch.php(355): SearchEngine->searchTitle(string)
#12 /srv/mediawiki/w/includes/specials/SpecialSearch.php(179): SpecialSearch->showResults(string)
#13 /srv/mediawiki/w/includes/specialpage/SpecialPage.php(575): SpecialSearch->execute(NULL)
#14 /srv/mediawiki/w/includes/specialpage/SpecialPageFactory.php(611): SpecialPage->run(NULL)
#15 /srv/mediawiki/w/includes/MediaWiki.php(296): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#16 /srv/mediawiki/w/includes/MediaWiki.php(900): MediaWiki->performRequest()
#17 /srv/mediawiki/w/includes/MediaWiki.php(527): MediaWiki->main()
#18 /srv/mediawiki/w/index.php(44): MediaWiki->run()
#19 {main}

I left stack traces on, so you can reproduce and see this error without a wikitech-static login. Can we just rebuild that db?

Can we just rebuild that db?

Per the Error: 144 Table './wikitech/searchindex' is marked as crashed and last (automatic?) repair failed (localhost) line I would guess that trying to rebuild that table would be the first thing to try. I think that would look something like dropping the table, recreating it from the spec in maintentance/tables.sql, and then running https://www.mediawiki.org/wiki/Manual:Rebuildtextindex.php

Bstorm triaged this task as Unbreak Now! priority.

@bd808's instructions seem to have worked.

YOUR1 reopened this task as Open.EditedOct 18 2023, 8:32 AM
YOUR1 subscribed.

I know this is a rather old issue; but we've encountered the same issue.

The problem is that our 'searchindex' table engine was set to innodb; settings this to myisam fixed the problems. I do wonder why the query isn't automatically escaped.

We're running multiple MW versions, 1.35.x, 1.39.x. The problem exists in all versions.

taavi subscribed.

Please do not re-open old, unrelated tasks.