Page MenuHomePhabricator

BadMethodCallException on Commons: /includes/specials/pagers/ImageListPager.php: Call to a member function getUrl() on a non-object (boolean)
Closed, ResolvedPublic

Description

[XQowzwpAAEAAAHjy0MEAAABU] 2019-06-19 12:55:44: 嚴重例外類型 "BadMethodCallException"

Event Timeline

A2093064 created this task.Jun 19 2019, 1:11 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 19 2019, 1:11 PM

@A2093064 Can you briefly describe what you were trying to do when this error happened?

I can see it in the logs, but I don't want to describe it publicly without your permission.

A2093064 added a comment.EditedJun 19 2019, 1:51 PM

@Krinkle A user posted this error message in a Facebook group. He said he can't upload files and view Special:ListFiles/His_name. These are all I know. Maybe I can ask him for his permission.

He moved "File:蔣培火墓.jpg" to "File:蔡培火墓.jpg" and got errors, then this file lost.

Now I view https://commons.wikimedia.org/wiki/Special:ListFiles/Pbdragonwang and got:

[XQpBhgpAMEoAAKmzvyEAAACH] 2019-06-19 14:07:02: Fatal exception of type "BadMethodCallException"
zeljkofilipin triaged this task as Unbreak Now! priority.Jun 19 2019, 3:15 PM
zeljkofilipin added a subscriber: zeljkofilipin.

Train blockers are UBN.

Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptJun 19 2019, 3:15 PM
Aklapper renamed this task from BadMethodCallException on commons to BadMethodCallException on Commons: /includes/specials/pagers/ImageListPager.php: Call to a member function getUrl() on a non-object (boolean).Jun 19 2019, 3:19 PM
Cparle added a subscriber: Cparle.Jun 19 2019, 3:35 PM

This patch made a change to /includes/specials/pagers/ImageListPager.php on a line that calls getUrl() https://gerrit.wikimedia.org/r/c/mediawiki/core/+/510199

CC'ing patch author and reviewer

This patch made a change to /includes/specials/pagers/ImageListPager.php on a line that calls getUrl() https://gerrit.wikimedia.org/r/c/mediawiki/core/+/510199

In ImageListPager.php, it replaced wfLocalFile() with $services->getRepoGroup()->findFile(), but I think that’s actually the replacement for wfFindFile(), and the correct replacement for wfLocalFile() would be $services->getRepoGroup()->getLocalRepo()->newFile(). I should’ve checked this more thoroughly in review, sorry. I’ll upload a patch.

Change 517999 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/core@master] Fix wfLocalFile() replacement

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

Unfortunately I can’t reproduce the bug locally, so I’m not sure if the fix works. Is it okay if I temporarily apply it on mwdebug1002 before it’s merged, or is that frowned upon?

Oh nevermind, I can’t test it on mwdebug1002 either with the train being rolled back.

Change 517999 merged by jenkins-bot:
[mediawiki/core@master] Fix wfLocalFile() replacement

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

Change 518013 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/core@wmf/1.34.0-wmf.10] Fix wfLocalFile() replacement

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

Jdforrester-WMF lowered the priority of this task from Unbreak Now! to High.Jun 20 2019, 3:23 PM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

So this is provisionally fixed but we can't tell until the train rolls forward to Commons, is that right?

Change 518013 merged by jenkins-bot:
[mediawiki/core@wmf/1.34.0-wmf.10] Fix wfLocalFile() replacement

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

Mentioned in SAL (#wikimedia-operations) [2019-06-20T16:19:08Z] <krinkle@deploy1001> Synchronized php-1.34.0-wmf.10/includes/specials/pagers/ImageListPager.php: T226102 / 294500d6e1d70b2 (duration: 00m 58s)

Jdforrester-WMF closed this task as Resolved.Mon, Jun 24, 3:55 PM

For simplicity let's mark this as Resolved and re-open if it didn't work.