Page MenuHomePhabricator

RangeError: Maximum call stack size exceeded in mediawiki.searchSuggest
Closed, ResolvedPublicBUG REPORT

Description

In 1.44.0-wmf.3 we are seeing a substantial increase in this error (28,580 since last group 1 deploy):

Screenshot 2024-11-14 at 3.20.09 PM.png (686×3 px, 146 KB)

Per the criteria in https://wikitech.wikimedia.org/wiki/Deployments/Holding_the_train#Error-rate_increases_(See_#Logspam) this should block next train.

It appears to be impacting projects with legacy Vector as the default skin with Italian Wikipedia accounting for the majority of issues:

https://logstash.wikimedia.org/goto/0c14bbf0302646ca03635abdc67f68e5

Stack trace:

	at find  https://de.wikipedia.org/w/load.php?lang=de&modules=jquery&skin=vector&version=r2z40:12:634
at find.matchesSelector  https://de.wikipedia.org/w/load.php?lang=de&modules=jquery&skin=vector&version=r2z40:18:592
at jQuery.filter  https://de.wikipedia.org/w/load.php?lang=de&modules=jquery&skin=vector&version=r2z40:37:443
at winnow  https://de.wikipedia.org/w/load.php?lang=de&modules=jquery&skin=vector&version=r2z40:37:264
at jQuery.fn.init.is  https://de.wikipedia.org/w/load.php?lang=de&modules=jquery&skin=vector&version=r2z40:38:133
at keypress  https://de.wikipedia.org/w/load.php?lang=de&modules=jquery.suggestions&skin=vector&version=glvk0:8:627
at HTMLInputElement.eval  https://de.wikipedia.org/w/load.php?lang=de&modules=jquery.suggestions&skin=vector&version=glvk0:12:259
at HTMLInputElement.dispatch  https://de.wikipedia.org/w/load.php?lang=de&modules=jquery&skin=vector&version=r2z40:65:932
at elemData.handle  https://de.wikipedia.org/w/load.php?lang=de&modules=jquery&skin=vector&version=r2z40:62:565

Steps to replicate the issue (include links if applicable):

What happens?:
Recursion error triggered

What should have happened instead?:
No error

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

Jdlrobson renamed this task from RangeError: Maximum call stack size exceeded to RangeError: Maximum call stack size exceeded in mediawiki.searchSuggest.EditedThu, Nov 14, 11:24 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson added subscribers: matmarex, TheDJ.

Maybe related, I've just noticed that I'm getting a load of Uncaught InternalError: too much recursion console errors when searching (Vector 2010) and using arrow keys to navigate the search results is not working as expected (gif below, I am just pressing the down arrow):

Screen Recording 2024-11-14 at 23.23.33.gif (630×574 px, 855 KB)

Uncaught InternalError: too much recursion
    jQuery 7
jquery.js:2396:19
    jQuery 18
    <anonymous> searchSuggest.js:372
    jQuery 17
    <anonymous> searchSuggest.js:372
    jQuery 17
    <anonymous> searchSuggest.js:372
    jQuery 17
    <anonymous> searchSuggest.js:372
    jQuery 17
    <anonymous> searchSuggest.js:372
    jQuery 17
    <anonymous> searchSuggest.js:372
    jQuery 17
    <anonymous> searchSuggest.js:372
    dispatch jQuery

Yep that matches the errors I'm seeing in logstash. @TheresNoTime are you able to update the description with replication steps? Can you replicate the issue locally (and if so can you fix it by reverting https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1088731 ?)

Yep that matches the errors I'm seeing in logstash. @TheresNoTime are you able to update the description with replication steps? Can you replicate the issue locally (and if so can you fix it by reverting https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1088731 ?)

(sorry, I've stepped away from the computer now — but fwiw given $( this ).trigger( 'keypress' ); looks like it'll trigger a change and/or input event, and thus the recursion, I'd agree that's the cause)

nb. created a revert (https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1091470) and then made a patchdemo using that patch — issue is reproducible on a patchdemo running latest core (e.g. https://167789d4d8.catalyst.wmcloud.org/w/), but not once that change is reverted.

Revert patch: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1091470 merged. (I just realized it wasn't tagged with this task, oops.)

I've made a backport patch — I'm around to do this today if needed, but given it's a Friday can it wait until Monday?

Thanks @matmarex and @TheresNoTime for confirming the fix. I think it's okay for this to wait until Monday.

I don't think it's impacting end users (please correct me if I'm wrong?), it's just triggering alerts on our monitoring.

It is affecting end users, unless this is unrelated:

searching (Vector 2010) and using arrow keys to navigate the search results is not working as expected (gif below, I am just pressing the down arrow):

Screen Recording 2024-11-14 at 23.23.33.gif (630×574 px, 855 KB)

stjn subscribed.

Made it impossible to use keyboard navigation in search. Please don't wait till Monday. Vector 2010 is still the default skin in multiple projects, too.

This is certainly still an issue in vector-2010, able to reproduce and still getting user stories raised in VRT.

Change #1091605 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Samtar):

[mediawiki/core@wmf/1.44.0-wmf.3] Revert "Allow other input and changes to trigger searchsuggestions to update"

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

Change #1091605 merged by jenkins-bot:

[mediawiki/core@wmf/1.44.0-wmf.3] Revert "Allow other input and changes to trigger searchsuggestions to update"

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

Mentioned in SAL (#wikimedia-operations) [2024-11-18T15:03:30Z] <lucaswerkmeister-wmde@deploy2002> Started scap sync-world: Backport for [[gerrit:1091605|Revert "Allow other input and changes to trigger searchsuggestions to update" (T379983)]]

Mentioned in SAL (#wikimedia-operations) [2024-11-18T15:06:38Z] <lucaswerkmeister-wmde@deploy2002> samtar, lucaswerkmeister-wmde: Backport for [[gerrit:1091605|Revert "Allow other input and changes to trigger searchsuggestions to update" (T379983)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-11-18T15:11:45Z] <lucaswerkmeister-wmde@deploy2002> Finished scap sync-world: Backport for [[gerrit:1091605|Revert "Allow other input and changes to trigger searchsuggestions to update" (T379983)]] (duration: 08m 14s)

Jdlrobson claimed this task.

I can't replicate any more and the errors are now trailing off:

Screenshot 2024-11-18 at 10.25.30 AM.png (283×1 px, 33 KB)

Thanks for getting this backported!