Page MenuHomePhabricator

MySQL timeout in API
Closed, ResolvedPublic

Description

[WWfbIQpAEDMAAFYiJJ4AAACS] mw1286 enwiki 1.30.0-wmf.7 exception ERROR: [WWfbIQpAEDMAAFYiJJ4AAACS] /w/api.php?action=query&list=projectpages   Wikimedia\Rdbms\DBQueryError from line 1145 of /srv/mediawiki/php-1.30.0-wmf.7/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  pa_page_id AS `page_id`,pa_project_id AS `project_id`,page_title AS `title`,page_namespace AS `namespace`,pap_project_title AS `project_name`  FROM `page_assessments` JOIN `page` ON ((page_id = pa_page_id)) JOIN `page_assessments_projects` ON ((pa_project_id = pap_project_id))    ORDER BY pa_project_id, pa_page_id LIMIT 11
Function: ApiQueryProjectPages::run
Error: 2062 Read timeout is reached (10.64.48.21)
 {"exception_id":"WWfbIQpAEDMAAFYiJJ4AAACS","caught_by":"other"}
[Exception Wikimedia\Rdbms\DBQueryError] (/srv/mediawiki/php-1.30.0-wmf.7/includes/libs/rdbms/database/Database.php:1145) A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?
Query: SELECT  pa_page_id AS `page_id`,pa_project_id AS `project_id`,page_title AS `title`,page_namespace AS `namespace`,pap_project_title AS `project_name`  FROM `page_assessments` JOIN `page` ON ((page_id = pa_page_id)) JOIN `page_assessments_projects` ON ((pa_project_id = pap_project_id))    ORDER BY pa_project_id, pa_page_id LIMIT 11
Function: ApiQueryProjectPages::run
Error: 2062 Read timeout is reached (10.64.48.21)
  #0 /srv/mediawiki/php-1.30.0-wmf.7/includes/libs/rdbms/database/Database.php(975): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
  #1 /srv/mediawiki/php-1.30.0-wmf.7/includes/libs/rdbms/database/Database.php(1339): Wikimedia\Rdbms\Database->query(string, string)
  #2 /srv/mediawiki/php-1.30.0-wmf.7/includes/api/ApiQueryBase.php(387): Wikimedia\Rdbms\Database->select(array, array, array, string, array, array)
  #3 /srv/mediawiki/php-1.30.0-wmf.7/extensions/PageAssessments/api/ApiQueryProjectPages.php(46): ApiQueryBase->select(string)
  #4 /srv/mediawiki/php-1.30.0-wmf.7/extensions/PageAssessments/api/ApiQueryProjectPages.php(22): ApiQueryProjectPages->run()
  #5 /srv/mediawiki/php-1.30.0-wmf.7/includes/api/ApiQuery.php(253): ApiQueryProjectPages->execute()
  #6 /srv/mediawiki/php-1.30.0-wmf.7/includes/api/ApiMain.php(1580): ApiQuery->execute()
  #7 /srv/mediawiki/php-1.30.0-wmf.7/includes/api/ApiMain.php(546): ApiMain->executeAction()
  #8 /srv/mediawiki/php-1.30.0-wmf.7/includes/api/ApiMain.php(517): ApiMain->executeActionWithErrorHandling()
  #9 /srv/mediawiki/php-1.30.0-wmf.7/api.php(94): ApiMain->execute()
  #10 /srv/mediawiki/w/api.php(3): include(string)
  #11 {main}

Query plan:

mysql:wikiadmin@db1083 [enwiki]> explain SELECT  pa_page_id AS `page_id`,pa_project_id AS `project_id`,page_title AS `title`,page_namespace AS `namespace`,pap_project_title AS `project_name`  FROM `page_assessments` JOIN `page` ON ((page_id = pa_page_id)) JOIN `page_assessments_projects` ON ((pa_project_id = pap_project_id))    ORDER BY pa_project_id, pa_page_id LIMIT 11\G
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: page_assessments_projects
         type: index
possible_keys: PRIMARY
          key: pap_project_title
      key_len: 258
          ref: NULL
         rows: 2949
        Extra: Using index; Using temporary; Using filesort
*************************** 2. row ***************************
           id: 1
  select_type: SIMPLE
        table: page_assessments
         type: ref
possible_keys: PRIMARY,pa_project
          key: pa_project
      key_len: 4
          ref: enwiki.page_assessments_projects.pap_project_id
         rows: 399
        Extra: Using index
*************************** 3. row ***************************
           id: 1
  select_type: SIMPLE
        table: page
         type: eq_ref
possible_keys: PRIMARY
          key: PRIMARY
      key_len: 4
          ref: enwiki.page_assessments.pa_page_id
         rows: 1
        Extra:

Event Timeline

MaxSem created this task.Jul 13 2017, 8:59 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 13 2017, 8:59 PM

Change 365177 had a related patch set uploaded (by Kaldari; owner: Kaldari):
[mediawiki/extensions/PageAssessments@master] Fix DB timeout from API queries without project specified

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

Change 365177 merged by jenkins-bot:
[mediawiki/extensions/PageAssessments@master] Fix DB timeout from API queries without project specified

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

kaldari moved this task from Untriaged to Archive on the Community-Tech board.Jul 14 2017, 11:46 PM
kaldari closed this task as Resolved.
kaldari claimed this task.