Page MenuHomePhabricator

[arwiki-wmf.12] Unable to find 4 link recommendation phrase item(s) in document.
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
Unable to find 4 link recommendation phrase item(s) in document.
exception.trace
at AddLinkDesktopArticleTarget.AddLinkArticleTarget.annotateSuggestions  <anonymous>:15:785
at AddLinkDesktopArticleTarget.AddLinkArticleTarget.beforeLoadSuccess  <anonymous>:11:363
at AddLinkDesktopArticleTarget.loadSuccess  <anonymous>:3:826
at fire  https://ar.wikipedia.org/w/load.php?lang=ar&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets%7Cjquery.ui%7Cwikibase.client.linkitem.init&skin=vector&version=uch6y:46:897
at fireWith  https://ar.wikipedia.org/w/load.php?lang=ar&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets%7Cjquery.ui%7Cwikibase.client.linkitem.init&skin=vector&version=uch6y:48:96
at mightThrow  https://ar.wikipedia.org/w/load.php?lang=ar&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets%7Cjquery.ui%7Cwikibase.client.linkitem.init&skin=vector&version=uch6y:50:441
at process  https://ar.wikipedia.org/w/load.php?lang=ar&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets%7Cjquery.ui%7Cwikibase.client.linkitem.init&skin=vector&version=uch6y:50:498
at https://ar.wikipedia.org/w/load.php?lang=ar&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets%7Cjquery.ui%7Cwikibase.client.linkitem.init&skin=vector&version=uch6y:50:722
at mightThrow  https://ar.wikipedia.org/w/load.php?lang=ar&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets%7Cjquery.ui%7Cwikibase.client.linkitem.init&skin=vector&version=uch6y:49:833
at process  https://ar.wikipedia.org/w/load.php?lang=ar&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets%7Cjquery.ui%7Cwikibase.client.linkitem.init&skin=vector&version=uch6y:50:498
	
tags
input-kafka-clienterror-codfw, kafka, es, es, throttle-exempt, normalized_message_untrimmed
Impact

The page https://ar.wikipedia.org/w/index.php?title=1961_في_بيرو&veaction=edit&action=edit is loaded without Add link suggesttions

Screen Shot 2021-07-02 at 5.31.04 PM.png (1×2 px, 458 KB)

Notes

The error is only present in mediawiki-client-errors channel, not in mw-client-growth-team-errors

The Console displays the following error:

Uncaught Error: No annotation view found
 at RecommendedLinkToolbarDialogDesktop.RecommendedLinkToolbarDialog.getAnnotationViewAtIndex
 at RecommendedLinkToolbarDialogDesktop.showFirstRecommendation
 at RecommendedLinkToolbarDialogDesktop.RecommendedLinkToolbarDialog.afterSetupProcess
 at RecommendedLinkToolbarDialogDesktop.afterSetupProcess

Event Timeline

I originally thought this is similar/same as T283606: Add a link: too many articles have no suggestions upon arrival, but it sounds in this case, no user-facing error message was shown? If that's right, are there any steps to reproduce?

I originally thought this is similar/same as T283606: Add a link: too many articles have no suggestions upon arrival, but it sounds in this case, no user-facing error message was shown? If that's right, are there any steps to reproduce?

I was surprised that there were no user warning displayed. I don't think that there are definite steps to reproduce - will do more testing and then update the ticket.

Can reproduce for that article: https://ar.wikipedia.org/wiki/%D8%AE%D8%A7%D8%B5:Homepage/newcomertask/7101743?geclickid=123&genewcomertasktoken=000&getasktype=link-recommendation

I originally thought this is similar/same as T283606: Add a link: too many articles have no suggestions upon arrival, but it sounds in this case, no user-facing error message was shown? If that's right, are there any steps to reproduce?

It's not quite the same, there are suggestions in this case but the frontend logic cannot find them in the article text. Not showing the same error dialog is a bug, though. I see

Uncaught Error: No annotation view found
    at RecommendedLinkToolbarDialogDesktop.RecommendedLinkToolbarDialog.getAnnotationViewAtIndex
    at RecommendedLinkToolbarDialogDesktop.showFirstRecommendation
    at RecommendedLinkToolbarDialogDesktop.RecommendedLinkToolbarDialog.afterSetupProcess
    at RecommendedLinkToolbarDialogDesktop.afterSetupProcess
    at RecommendedLinkToolbarDialogDesktop.<anonymous>

The error is only present in mediawiki-client-errors channel, not in mw-client-growth-team-errors

Weird, I'd expect that the other way around.

This error occurred 346 times in the last month https://logstash.wikimedia.org/goto/0ccd76b3babe2f6cee48f6e10914bc58, maybe we should take a closer look at this. @DMburugu @MMiller_WMF this task in Incoming, should it be moved to Ready for Development? I think what we'd want to determine is:

  • some specific examples of when this occurs and why
  • are there patterns seen that could be fixed via software changes
  • are errors handled appropriately (there's a console error listed in the previous comment, for example)

Having not heard otherwise, I'll move this as a lower priority item for us to start working on

Change 725013 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@master] [WIP] AddLink: Handle cases where no phrases are found

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

kostajh raised the priority of this task from Low to Medium.Oct 18 2021, 7:31 AM
Failed to locate "لاعبة كرة طائرة" (occurrences seen: 0) in document.
Failed to locate "سياسي" (occurrences seen: 0) in document.
Failed to locate "الولايات المتحدة الأمريكية" (occurrences seen: 0) in document.

The words do all appear in the text. The issue is that the wiki source looks like this:

{{Div col}}
* <target word>
* ...
{{Div col end}}

where {{Div col}} / {{Div col end}} resolve to <div> / </div> with some multicolumn styling. So mwparserfromhell sees the content between the two templates as top-level but the Parsoid DOM tree walker does not. This is the problem of unbalanced templates (which will probably be banned at some point in the future: T114445: [RFC] Balanced templates).

I don't think we can do much here (other than the generic error handling improvements suggested by @kostajh). The Parsoid DOM doesn't make it easy (I'm not sure it even makes it possible) to differentiate between {{div|bar}} where Template:Div is <div>{{{1}}}</div> and {{start div}}bar{{end div}} where Template:Start div and Template:End div are <div> and </div>. If we wanted to deal with it, we'd probably have to fully rewrite mwaddlink to use Parsoid HTML instead of wikitext.

Change 725013 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] AddLink: Handle cases where no phrases are found

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

Patch was merged, so the task either needs more work or (if we accept that fixing the unbalanced template issue is infeasible) ready for QA. I'll go with the latter but feel free to override.

Patch was merged, so the task either needs more work or (if we accept that fixing the unbalanced template issue is infeasible) ready for QA. I'll go with the latter but feel free to override.

I agree with what you wrote in T286100#7624160. This happens infrequently enough to not justify spending more time on it, IMO.

The article on which the issue was reported - https://ar.wikipedia.org/w/index.php?title=1961_في_بيرو&gesuggestededit=1&veaction=edit - will display a regular warning "Back to suggested edits".