Page MenuHomePhabricator

Investigate Production Errors from ComputedUserImpactLookup::getPageViewData
Closed, ResolvedPublic3 Estimated Story Points

Description

We have a number of recent-ish production errors all related to the ComputedUserImpactLookup class, and in particular its getPageViewData method.

While they don't seem to be directly related to our efforts in T341599: Impact Module: improvements for former newcomers/T398500: [timebox: 3 days] Impact module: Support larger wgGEUserImpactMaxEdits, we probably want to address them before scaling the feature further and potentially worsen existing issues.

Since it seems plausible that there is a common cause, this tasks exists to consolidate the exploration of all three.

Acceptance criteria:

  • We know what's causing these errors
  • We have identified next steps, or if they were simple to fix, we fixed them.
  • If we haven't fixed them yet, we understand their potential impact on T341599

Related Objects

StatusSubtypeAssignedTask
OpenNone
OpenNone
ResolvedReedy
OpenNone
OpenNone
OpenNone
OpenNone
DeclinedNone
ResolvedReedy
ResolvedKrinkle
ResolvedKrinkle
Resolvedcscott
ResolvedPRODUCTION ERRORMichael
ResolvedPRODUCTION ERRORMichael
ResolvedPRODUCTION ERRORMichael
ResolvedPRODUCTION ERRORMichael
ResolvedMichael

Event Timeline

KStoller-WMF set the point value for this task to 3.Sep 8 2025, 4:21 PM
KStoller-WMF lowered the priority of this task from High to Medium.Nov 18 2025, 5:54 PM

Looking into this a bit, the errors mentioned in T400574: PHP Warning: Undefined array key "mos:LABEL" seem to be the most fruitful to investigate. In particular, I notice that all the titles that come up here as undefined array keys seem to contain a colon, like an interwiki link or sometimes a redirect:

  • mos:LABEL (siwiki)
  • R:Dúniya (crhwiki)
  • mos:DASH (siwiki)

Also, these errors seem to be rare:

image.png (467×869 px, 41 KB)

I suggest skipping processing such a title when encountering it, and logging a warning to allow further investigation when it happens again. After that change is merged, I also recommend closing the related production errors because they should not happen again. Though this task should be kept open for further investigation.

There should be virtually no impact on T341599: in some very rare cases, a page might be missing pageview data, that's all.

Change #1208382 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/GrowthExperiments@master] fix(Impact): skip mismatched title in pageview data

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

Motivated by @Michael's patch, I took a look at this as well. The titles listed by Michael are special: two of them are external titles (as mos is a language code, it refers to mos.wikipedia.org regardless of the Wikipedia it is used on). The last remaining one doesn't have any views logged in AQS:

urbanecm@wmf3345 ~ % curl -s 'https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/crh.wikipedia/all-access/user/R:D%C3%BAniya/daily/20250920/20251023' | jq .
{
  "detail": "The date(s) you used are valid, but we either do not have data for those date(s), or the project you asked for is not loaded yet. Please check documentation for more information",
  "method": "get",
  "status": 404,
  "title": "Not Found",
  "type": "about:blank",
  "uri": "/metrics/pageviews/per-article/crh.wikipedia/all-access/user/R:D%C3%BAniya/daily/20250920/20251023"
}
urbanecm@wmf3345 ~ %

This made me think "what is the result ComputedUserImpact gets" (the Pinnipedia query is there just to verify I was having the right expectations and did not mess something in the manual call):

>  $t = \MediaWiki\Title\Title::newFromText('R:Dúniya')                                                                                                                                                                                                                       
= MediaWiki\Title\Title {#5335                                                                                                                                                                                                                                                
    +mArticleID: -1,                                                                                                                                                                                                                                                          
    +prefixedText: null,                                                                                                                                                                                                                                                      
    +mRedirect: null,                                                                                                                                                                                                                                                         
  }                                                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                           
> $l = \MediaWiki\MediaWikiServices::getInstance()->get('GrowthExperimentsUserImpactLookup_Computed')                                                                                                                                      
= GrowthExperiments\UserImpact\ComputedUserImpactLookup {#5355}                                                                                                                                                                            
                                                                                                                                                                                                                                           
>  $titleObjects = []                                                                                                                                                                                                                      
= []                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                           
> $titleObjects['R:Dúniya'] = ['title' => $t]                                                                                                                                                                                              
= [                                                                                                                                                                                                                                        
    "title" => MediaWiki\Title\Title {#5335                                                                                                                                                                                                
      +mArticleID: -1,                                                                                                                                                                                                                     
      +prefixedText: null,                                                                                                                                                                                                                 
      +mRedirect: null,                                                                                                                                                                                                                    
    },                                                                                                                                                                                                                                     
  ]                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                           
> sudo $d =$l->getPageViewDataInJobContext($titleObjects, User::newFromName('Martin Urbanec (WMF)'), 60)                                                                                                                                   
= []     

> $titleObjects['Pinnipedia'] = ['title' => \MediaWiki\Title\Title::newFromText('Pinnipedia')]                                                                                                                                             
= [                                                                                                                                                                                                                                        
    "title" => MediaWiki\Title\Title {#8364                                                                                                                                                                                                
      +mArticleID: -1,                                                                                                                                                                                                                     
      +prefixedText: null,                                                                                                                                                                                                                 
      +mRedirect: null,                                                                                                                                                                                                                    
    },                                                                                                                                                                                                                                     
  ]                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                           
> sudo $d =$l->getPageViewDataInJobContext($titleObjects, User::newFromName('Martin Urbanec (WMF)'), 60)                                                                                                                                   
= [                                                                                                                                                                                                                                        
    "Pinnipedia" => [                                                                                                                                                                                                                      
      "2025-09-27" => 2,                                                                                                                                                                                                                   
      "2025-09-28" => 2,
      "2025-09-29" => 0,
      "2025-09-30" => 1,
      [...]
  ]

>

So, maybe we're just not dealing correctly with pages that were not visited at all in the last 60 days?

Change #1208382 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] fix(Impact): skip mismatched title in pageview data

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

Not sure why that tag was missing here. Once the train has been fully rolled out, I think we can close the directly related 4 parent production errors as they should no longer happen.

This has rolled out and the error does not seem to have happened since. We'll see it as a Growth warning if it ever does. It will have the message Title {title} not found in allTitleObjects.