Page MenuHomePhabricator

Unable to index document PHID-CMIT-..., Incorrect key file for table './phabricator_search/search_documentfield.MYI'
Closed, InvalidPublic

Description

I'm seeing this stack trace right now, having just pushed some tags into a hosted git repo:

[2014-10-20 15:09:40] PHLOG: 'Unable to index document PHID-CMIT-rrzk2z5yfad5i7b32bm3 with engine PhabricatorSearchEngineMySQL.' at [/home/aob01/phabricator/phabricator/src/applications/search/index/PhabricatorSearchDocumentIndexer.php:57]

#0 phlog(string) called at [<phabricator>/src/applications/search/index/PhabricatorSearchDocumentIndexer.php:57]
#1 PhabricatorSearchDocumentIndexer::indexDocumentByPHID(string) called at [<phabricator>/src/applications/search/index/PhabricatorSearchIndexer.php:21]
#2 PhabricatorSearchIndexer::indexDocumentByPHID(string) called at [<phabricator>/src/applications/search/worker/PhabricatorSearchWorker.php:10]
#3 PhabricatorSearchWorker::doWork() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:87]
#4 PhabricatorWorker::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php:124]
#5 PhabricatorWorkerActiveTask::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php:19]
#6 PhabricatorTaskmasterDaemon::run() called at [<phutil>/src/daemon/PhutilDaemon.php:91]
#7 PhutilDaemon::execute() called at [<phutil>/scripts/daemon/exec/exec_daemon.php:111]

[2014-10-20 15:09:40] EXCEPTION: (AphrontQueryException) #126: Incorrect key file for table './phabricator_search/search_documentfield.MYI'; try to repair it at [<phutil>/src/aphront/storage/connection/mysql/AphrontMySQLDatabaseConnectionBase.php:308]

#0 phlog(AphrontQueryException) called at [<phabricator>/src/applications/search/index/PhabricatorSearchDocumentIndexer.php:58]
#1 PhabricatorSearchDocumentIndexer::indexDocumentByPHID(string) called at [<phabricator>/src/applications/search/index/PhabricatorSearchIndexer.php:21]
#2 PhabricatorSearchIndexer::indexDocumentByPHID(string) called at [<phabricator>/src/applications/search/worker/PhabricatorSearchWorker.php:10]
#3 PhabricatorSearchWorker::doWork() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:87]
#4 PhabricatorWorker::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php:124]
#5 PhabricatorWorkerActiveTask::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php:19]
#6 PhabricatorTaskmasterDaemon::run() called at [<phutil>/src/daemon/PhutilDaemon.php:91]
#7 PhutilDaemon::execute() called at [<phutil>/scripts/daemon/exec/exec_daemon.php:111]

Event Timeline

staticshock raised the priority of this task from to Needs Triage.
staticshock updated the task description. (Show Details)
staticshock added a project: Diffusion.
staticshock added a subscriber: staticshock.
btrahan claimed this task.

This is a mysql configuration issue / scaling issue. See something like

http://stackoverflow.com/questions/19003106/mysql-error-126-incorrect-key-file-for-table

for how to resolve it for your instance.

Ah, thanks. Is there any way to re-run the original operation that failed here from the cli?

./bin/search index PHID-CMIT-rrzk2z5yfad5i7b32bm3

...should work I think.

Also cc @epriestley in case he's more concerned about this generally than I am...

Yeah, this is something with MySQL and not really directly related to Phabricator. I'd try:

REPAIR TABLE phabricator_search.search_documentfield;

If that doesn't work and the table still complains, you can safely TRUNCATE it and then bin/search index --all --background to rebuild the search index from scratch (might take a while, but the daemons will do it for you).

I'm not really sure what the root causes are here, beyond the usual (cosmic rays, someone pulled the plug on the machine, from that SO question it looks like full disks can do it).

/tmp being full probably doesn't apply to me, since i don't have a special mount-point for it, so it should be sharing in the bounty of ~28GB of free space on /dev/sda1. Someone did pull the plug on the machine, but that was probably about half a year ago, and I haven't noticed these errors until just now.