Page MenuHomePhabricator

CheckUser internal API error
Closed, ResolvedPublic

Description

I just checked a bunch of users using the API, but today it was impossible to fetch CU data about the user "Schweiz41" (on frwiki). However the special page worked as expected
It already happend to me in the past with other user. And back then, when an error occured a first time on a user, retrying on the same user always gave me the same error .

Steps to Reproduce:

HTTP Post request on frwiki:

{
    "action": "query",
    "format": "json",
    "list": "checkuser",
    "curequest": "edits",
    "cutarget": "Schweiz41",
    "cureason": "Schweiz41,+SwissArmy26+-+16+avril",
    "culimit": "max",
    "cutimecond": "-3+months",
    "cutoken": "....."
}

Actual Results:

{
    "error": {
        "code": "internal_api_error_Exception",
        "info": "[7e078238-da6a-49e5-a771-51d13d9c252c] Caught exception of type Exception",
        "errorclass": "Exception"
    },
    "servedby": "mw1280"
}

Expected Results:
JSON-formated edits of the user "Schweiz41" with CU informations.

Details

Stack Trace
2020-04-16 21:58:35 [7e078238-da6a-49e5-a771-51d13d9c252c] mw1280 frwiki 1.35.0-wmf.28 exception ERROR: [7e078238-da6a-49e5-a771-51d13d9c252c] /w/api.php   Exception from line 159 of /srv/mediawiki/php-1.35.0-wmf.28/extensions/CheckUser/includes/api/ApiQueryCheckUser.php: Couldn't fetch revision cu_changes table links to (cuc_this_oldid 0) {"exception_id":"7e078238-da6a-49e5-a771-51d13d9c252c","exception_url":"/w/api.php","caught_by":"mwe_handler"} 
[Exception Exception] (/srv/mediawiki/php-1.35.0-wmf.28/extensions/CheckUser/includes/api/ApiQueryCheckUser.php:159) Couldn't fetch revision cu_changes table links to (cuc_this_oldid 0)
  #0 /srv/mediawiki/php-1.35.0-wmf.28/includes/api/ApiQuery.php(263): ApiQueryCheckUser->execute()
  #1 /srv/mediawiki/php-1.35.0-wmf.28/includes/api/ApiMain.php(1580): ApiQuery->execute()
  #2 /srv/mediawiki/php-1.35.0-wmf.28/includes/api/ApiMain.php(523): ApiMain->executeAction()
  #3 /srv/mediawiki/php-1.35.0-wmf.28/includes/api/ApiMain.php(494): ApiMain->executeActionWithErrorHandling()
  #4 /srv/mediawiki/php-1.35.0-wmf.28/api.php(84): ApiMain->execute()
  #5 /srv/mediawiki/w/api.php(3): require(string)
  #6 {main}

Event Timeline

0x010C created this task.Apr 16 2020, 10:15 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 16 2020, 10:15 PM
Reedy changed the subtype of this task from "Bug Report" to "Production Error".
Reedy edited Stack Trace. (Show Details)

If it can help, it just happend again with another user "Navsenar" (always on frwiki).

{
    "error": {
        "code": "internal_api_error_Exception",
        "info": "[9cb64ab9-80ca-4c60-b9ff-3df26f4641d5] Caught exception of type Exception",
        "errorclass": "Exception"
    },
    "servedby": "mw1312"
}

Nope, I don't think so
If cuc_this_oldid is 0, there is indeed no Revision that corresponds, either retrieved via Revision::newFromId or otherwise
The exception was added by @Urbanecm as part of T234862: Do not show oversighted edit summaries in CheckUser API (CVE-2019-18611), to find the corresponding revision and see if the user can view it rather than assuming they could; I just changed how the revision was fetched

thcipriani added a subscriber: thcipriani.

Adding in Anti-Harassment folks to see if this is at all related to recent refactoring work on CheckUser.

Based on searching Logstash/mediawiki-errors for Couldn't fetch revision cu_changes it seems this happens mainly on fr.wikipedia.org, which given the low frequency of CheckUser actions might just be a coincindence.

It has been observed there since at least 2020-02-09.

dmaza added a subscriber: dmaza.Apr 29 2020, 8:56 PM

Adding in Anti-Harassment folks to see if this is at all related to recent refactoring work on CheckUser.

Looking thru it but it doesn't seem related to our present work

Change 593375 had a related patch set uploaded (by Dmaza; owner: Dmaza):
[mediawiki/extensions/CheckUser@master] Fix api error when fetching a revisions with invalid id

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

Tchanders assigned this task to dmaza.Apr 30 2020, 1:40 PM

Change 593375 merged by jenkins-bot:
[mediawiki/extensions/CheckUser@master] Fix api error when fetching a revisions with invalid id

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

dom_walden added a subscriber: dom_walden.

Cannot reproduce on:

Niharika closed this task as Resolved.May 6 2020, 5:52 PM
Niharika added a subscriber: Niharika.

Thanks all.

0x010C reopened this task as Open.EditedMay 11 2020, 7:07 AM

Hi,

I'm reopening this task as it seems not completely fixed. Performing a check this morning on [[User:Karl Marx1844]] (frwiki), I still get an error (only through the API as previously):

{
    "error": {
        "code": "internal_api_error_Exception",
        "info": "[3bd3f313-2aea-4849-9746-b3d9c37a1ed6] Caught exception of type Exception",
        "errorclass": "Exception"
    },
    "servedby": "mw1400"
}
DannyS712 closed this task as Resolved.EditedMay 11 2020, 7:15 AM

Hi,

I'm reopening this task as it seems not completely fixed. Performing a check this morning on [[User:Karl Marx1844]] (frwiki), I still get an error (only through the API as previously):

{
    "error": {
        "code": "internal_api_error_Exception",
        "info": "[3bd3f313-2aea-4849-9746-b3d9c37a1ed6] Caught exception of type Exception",
        "errorclass": "Exception"
    },
    "servedby": "mw1400"
}

That one is because of me - the fix was deployed, tested, and worked, and then was undeployed due to unrelated issues. See T249963: 1.35.0-wmf.31 deployment blockers. It should be deployed again at some point tomorrow/today (Monday).

Oh, ok that's fine then :). Thanks @DannyS712