Page MenuHomePhabricator

list=alldeletedrevisions gives query (timeout?) error for adrfrom/adrto or adrprefix
Closed, ResolvedPublic

Description

Was looking at deleted revision and get database query error

https://de.wikipedia.org/w/api.php?action=query&list=alldeletedrevisions&format=json&adrfrom=Salingen&adrto=Salingen

{
    "servedby": "mw1228",
    "warnings": {
        "query": {
            "*": "Formatting of continuation data will be changing soon. To continue using the current formatting, use the 'rawcontinue' parameter. To begin using the new format, pass an empty string for 'continue' in the initial query."
        }
    },
    "error": {
        "code": "internal_api_error_DBQueryError",
        "info": "[9f765fac] Database query error"
    }
}

https://de.wikipedia.org/w/api.php?action=query&list=alldeletedrevisions&adrprefix=Salingen

{
    "servedby": "mw1136",
    "warnings": {
        "query": {
            "*": "Formatting of continuation data will be changing soon. To continue using the current formatting, use the 'rawcontinue' parameter. To begin using the new format, pass an empty string for 'continue' in the initial query."
        }
    },
    "error": {
        "code": "internal_api_error_DBQueryError",
        "info": "[6ce91710] Database query error"
    }
}

Would be nice to get access to the stacktrace or the sql. Thanks.

Event Timeline

Umherirrender raised the priority of this task from to Needs Triage.
Umherirrender updated the task description. (Show Details)
Umherirrender added a subscriber: Umherirrender.

The first is:

2015-02-16 18:38:05 mw1228 dewiki: [9f765fac] /w/api.php?action=query&list=alldeletedrevisions&format=jsonfm&&adrfrom=Salingen&adrto=Salingen   DBQueryError from line 1251 of /srv/mediawiki/php-1.25wmf16/includes/db/Database.php: A database error has occurred. Did you forget to run maintenance/update.php after upgrading?  See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script
Query: SELECT  ar_id,ar_page_id,ar_rev_id,ar_text,ar_text_id,ar_timestamp,ar_comment,ar_user_text,ar_user,ar_minor_edit,ar_deleted,ar_len,ar_parent_id,ar_sha1,ar_content_format,ar_content_model,ar_title,ar_namespace  FROM `archive`   WHERE ((ar_title<='Salingen') AND (ar_title>='Salingen'))  ORDER BY ar_namespace  DESC,ar_title  DESC,ar_timestamp  DESC,ar_id  DESC LIMIT 11  
Function: ApiQueryAllDeletedRevisions::run
Error: 2013 Lost connection to MySQL server during query (10.64.16.34)

#0 /srv/mediawiki/php-1.25wmf16/includes/db/Database.php(1196): DatabaseBase->reportQueryError()
#1 /srv/mediawiki/php-1.25wmf16/includes/db/Database.php(1685): DatabaseBase->query()
#2 /srv/mediawiki/php-1.25wmf16/includes/api/ApiQueryBase.php(379): DatabaseBase->select()
#3 /srv/mediawiki/php-1.25wmf16/includes/api/ApiQueryAllDeletedRevisions.php(278): ApiQueryBase->select()
#4 /srv/mediawiki/php-1.25wmf16/includes/api/ApiQueryRevisionsBase.php(43): ApiQueryAllDeletedRevisions->run()
#5 /srv/mediawiki/php-1.25wmf16/includes/api/ApiQuery.php(297): ApiQueryRevisionsBase->execute()
#6 /srv/mediawiki/php-1.25wmf16/includes/api/ApiMain.php(1025): ApiQuery->execute()
#7 /srv/mediawiki/php-1.25wmf16/includes/api/ApiMain.php(394): ApiMain->executeAction()
#8 /srv/mediawiki/php-1.25wmf16/includes/api/ApiMain.php(365): ApiMain->executeActionWithErrorHandling()
#9 /srv/mediawiki/php-1.25wmf16/api.php(84): ApiMain->execute()
#10 /srv/mediawiki/w/api.php(3): include()
#11 {main}

The second is:

2015-02-16 18:38:18 mw1136 dewiki: [6ce91710] /w/api.php?action=query&list=alldeletedrevisions&adrprefix=Salingen   DBQueryError from line 1251 of /srv/mediawiki/php-1.25wmf16/includes/db/Database.php: A database error has occurred. Did you forget to run maintenance/update.php after upgrading?  See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script
Query: SELECT  ar_id,ar_page_id,ar_rev_id,ar_text,ar_text_id,ar_timestamp,ar_comment,ar_user_text,ar_user,ar_minor_edit,ar_deleted,ar_len,ar_parent_id,ar_sha1,ar_content_format,ar_content_model,ar_title,ar_namespace  FROM `archive`   WHERE (ar_title LIKE 'Salingen%' )  ORDER BY ar_namespace  DESC,ar_title  DESC,ar_timestamp  DESC,ar_id  DESC LIMIT 11  
Function: ApiQueryAllDeletedRevisions::run
Error: 2013 Lost connection to MySQL server during query (10.64.16.34)

#0 /srv/mediawiki/php-1.25wmf16/includes/db/Database.php(1196): DatabaseBase->reportQueryError()
#1 /srv/mediawiki/php-1.25wmf16/includes/db/Database.php(1685): DatabaseBase->query()
#2 /srv/mediawiki/php-1.25wmf16/includes/api/ApiQueryBase.php(379): DatabaseBase->select()
#3 /srv/mediawiki/php-1.25wmf16/includes/api/ApiQueryAllDeletedRevisions.php(278): ApiQueryBase->select()
#4 /srv/mediawiki/php-1.25wmf16/includes/api/ApiQueryRevisionsBase.php(43): ApiQueryAllDeletedRevisions->run()
#5 /srv/mediawiki/php-1.25wmf16/includes/api/ApiQuery.php(297): ApiQueryRevisionsBase->execute()
#6 /srv/mediawiki/php-1.25wmf16/includes/api/ApiMain.php(1025): ApiQuery->execute()
#7 /srv/mediawiki/php-1.25wmf16/includes/api/ApiMain.php(394): ApiMain->executeAction()
#8 /srv/mediawiki/php-1.25wmf16/includes/api/ApiMain.php(365): ApiMain->executeActionWithErrorHandling()
#9 /srv/mediawiki/php-1.25wmf16/api.php(84): ApiMain->execute()
#10 /srv/mediawiki/w/api.php(3): include()

Both appear to be timeout errors.

Aklapper renamed this task from list=alldeletedrevisions gives query error for adrfrom/adrto or adrprefix to list=alldeletedrevisions gives query (timeout?) error for adrfrom/adrto or adrprefix.Feb 17 2015, 9:40 AM
Aklapper triaged this task as Medium priority.
Aklapper set Security to None.

The probem seems the missing ar_namespace condition, because adding that gives a result.

For performance reason it may be necessary to disable the namespace search for none/multi or all namespaces in the request?
The index is over ar_namespace,ar_title,ar_timestamp

Working examples:
https://de.wikipedia.org/w/api.php?action=query&list=alldeletedrevisions&format=jsonfm&adrnamespace=0&adrfrom=Salingen&adrto=Salingen
https://de.wikipedia.org/w/api.php?action=query&list=alldeletedrevisions&adrprefix=Salingen&adrnamespace=0

Change 307789 had a related patch set uploaded (by Anomie):
ApiQueryAllDeletedRevisions: More namespace handling fixes

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

Change 307789 merged by jenkins-bot:
ApiQueryAllDeletedRevisions: More namespace handling fixes

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

Anomie claimed this task.

This should be fixed in 1.28.0-wmf.18.