Page MenuHomePhabricator

[testwiki - wmf.21] Homepage: Bad request for page/summary and user-impact
Closed, ResolvedPublicBUG REPORT

Description

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

  • On testwiki wmf.21 Special:Homepage doesn't display the stats in the Impact module and doesn't display any info in the SE card:

Screen Shot 2024-03-05 at 12.57.56 PM.png (1×2 px, 220 KB)

e.g.
GET https://test.wikipedia.org/api/rest_v1/page/summary/Ulrik_Plesner_(architect%2C_born_1930) 400 (Bad Request)

POST https://test.wikipedia.org/w/rest.php/growthexperiments/v0/user-impact/%2350416?lang=en 400 (Bad Request)

Software version :
testwiki wmf.21

Other information

  • I couldn't find anything in logstash
  • the suggested tasks work as expected (i.e. when you click on the SE card and go to the selected article - all is fine).

Event Timeline

Shared in Slack conversation:

I can reproduce this locally without specific setup. The reason seems to be Rest API handler body parsing function no liking a POST request (application/json) with an empty body (see source). Change seems introduced in 1003411 which could explaing why it’s showing on testwiki and probably all group 0 wikis. I think empty post requests are a fair usage. I’m inclined to say this should be fixed in core and it’s a potential UBN. (Not sure how many clients perform POST empty requests).

Urbanecm_WMF triaged this task as Unbreak Now! priority.Mar 6 2024, 1:38 PM

Thanks @Sgs for taking a look. As of now (with wmf.21 on group1), I am able to reproduce this at fr.wiktionary or cawiki (which are in group1). Marking as a train blocker.

Do we have an idea of how bad the impact for group1 users is? Does this warrant a rollback?

Change 1009257 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/core@master] Revert several REST-related commits

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

Do we have an idea of how bad the impact for group1 users is? Does this warrant a rollback?

Growth features are only enabled on Wikipedias and French Wiktionary. So, this only affects frwiktionary plus Wikipedias that are in group1. I'll leave the final decision up to you, but I think this doesn't require a rollback, but train should not move forward to group2.

Change 1009289 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@master] JS REST: make POST default to empty object

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

Change 1009257 abandoned by Urbanecm:

[mediawiki/core@master] Revert several REST-related commits

Reason:

In favour of I320e4a686e4a54f08abd7575893e694083c4fa68

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

@daniel @Urbanecm_WMF We need a backport patch to unblock 1.42.0-wmf.21.

Can https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1009289 be used as-is for 1.42.0-wmf.21? In that case I can go ahead and create the patch. Otherwise, could one of you create a version of the patch that can be backported?

Change 1009326 had a related patch set uploaded (by Urbanecm; author: Daniel Kinzler):

[mediawiki/core@wmf/1.42.0-wmf.21] JS REST: make POST default to empty object

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

Can https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1009289 be used as-is for 1.42.0-wmf.21? In that case I can go ahead and create the patch. Otherwise, could one of you create a version of the patch that can be backported?

Yes. I +2'ed the patch ~40 minutes ago and now I'm in the process of backporting it :).

Change 1009326 merged by jenkins-bot:

[mediawiki/core@wmf/1.42.0-wmf.21] JS REST: make POST default to empty object

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

Change 1009289 merged by jenkins-bot:

[mediawiki/core@master] JS REST: make POST default to empty object

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

Mentioned in SAL (#wikimedia-operations) [2024-03-06T18:07:37Z] <urbanecm@deploy2002> Started scap: Backport for [[gerrit:1009326|JS REST: make POST default to empty object (T359216)]]

Mentioned in SAL (#wikimedia-operations) [2024-03-06T18:11:39Z] <urbanecm@deploy2002> urbanecm: Backport for [[gerrit:1009326|JS REST: make POST default to empty object (T359216)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-03-06T18:21:56Z] <urbanecm@deploy2002> Finished scap: Backport for [[gerrit:1009326|JS REST: make POST default to empty object (T359216)]] (duration: 14m 19s)

Urbanecm_WMF assigned this task to daniel.
Urbanecm_WMF moved this task from Incoming to QA on the Growth-Team (Sprint 9 (Growth Team)) board.

@daniel's patch fixed the issue. @Etonkovidova, can you please take a look again? Thanks for reporting the problem!

Etonkovidova renamed this task from [testwiki - wmf.21] Bad request for page/summary and user-impact to [testwiki - wmf.21] Homepage: Bad request for page/summary and user-impact.Mar 6 2024, 6:25 PM
Etonkovidova reopened this task as Open.
Etonkovidova removed daniel as the assignee of this task.
jnuche lowered the priority of this task from Unbreak Now! to Needs Triage.Mar 6 2024, 6:34 PM
Etonkovidova claimed this task.

@daniel's patch fixed the issue. @Etonkovidova, can you please take a look again? Thanks for reporting the problem!

Checked on testwiki wmf.21 and on wikis wmf.21 in 1&2 groups - all looks as expected.

Note: It seems that updating the title of a task re-opens a task? And, also, re removing an assignee - I didn't recall that I actually did it.

Change #1015609 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] mediawiki.api: use `=== undefined` instead of typeof for local vars

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

Change #1015547 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/core@master] mediawiki.api: document that `body` is optional for REST POST

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

Change #1015609 merged by jenkins-bot:

[mediawiki/core@master] mediawiki.api: use `=== undefined` instead of typeof for local vars

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

Change #1015547 merged by jenkins-bot:

[mediawiki/core@master] mediawiki.api: document that `body` is optional for REST POST

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