Page MenuHomePhabricator

"BadMethodCallException" from EchoHooks::getNotificationTypes adding to certain talk page
Closed, ResolvedPublic

Description

Twice tonight when adding a section to a user talk page, the submit resulted in:

https://www.mediawiki.org/w/index.php?title=User_talk:Waldir&action=submit
Exception encountered, of type "BadMethodCallException".

If I reload the web page and resubmit the I get an edit conflict, and it turns out my contribution was successful.

legoktm found

legoktm@fluorine:/a/mw-log$ grep "BadMethodCallException" exception.log | grep mediawikiwiki
2015-03-20 07:54:02 mw1212 mediawikiwiki: [4b5683b8] /w/index.php?title=User_talk:Waldir&action=submit  
   BadMethodCallException from line 221 of /
   srv/mediawiki/php-1.25wmf22/extensions/Echo/Hooks.php:
   Call to a member function isMinor() on a non-object (NULL)

the second exception has identifier [49120a69]

I tried adding a new section to my own user page and it worked fine.

Here's the full log from the first exception.

2015-03-20 07:54:02 mw1212 mediawikiwiki: [4b5683b8] /w/index.php?title=User_talk:Waldir&action=submit BadMethodCallException from line 221 of /srv/mediawiki/php-1.25wmf22/extensions/Echo/Hooks.php: Call to a member function isMinor() on a non-object (NULL)
#0 /srv/mediawiki/php-1.25wmf22/includes/Hooks.php(209): EchoHooks::getNotificationTypes()
#1 /srv/mediawiki/php-1.25wmf22/includes/GlobalFunctions.php(4016): Hooks::run()
#2 /srv/mediawiki/php-1.25wmf22/extensions/Echo/controller/NotificationController.php(82): wfRunHooks()
#3 /srv/mediawiki/php-1.25wmf22/extensions/Echo/model/Event.php(146): EchoNotificationController::notify()
#4 /srv/mediawiki/php-1.25wmf22/extensions/Echo/includes/DiscussionParser.php(97): EchoEvent::create()
#5 /srv/mediawiki/php-1.25wmf22/extensions/Echo/Hooks.php(444): EchoDiscussionParser::generateEventsForRevision()
#6 /srv/mediawiki/php-1.25wmf22/includes/Hooks.php(209): EchoHooks::onArticleSaved()
#7 /srv/mediawiki/php-1.25wmf22/includes/content/ContentHandler.php(1161): Hooks::run()
#8 /srv/mediawiki/php-1.25wmf22/includes/page/WikiPage.php(1979): ContentHandler::runLegacyHooks()
#9 /srv/mediawiki/php-1.25wmf22/includes/page/Article.php(1991): WikiPage->doEditContent()
#10 /srv/mediawiki/php-1.25wmf22/includes/EditPage.php(1905): Article->__call()
#11 /srv/mediawiki/php-1.25wmf22/includes/EditPage.php(1298): EditPage->internalAttemptSave()
#12 /srv/mediawiki/php-1.25wmf22/includes/EditPage.php(538): EditPage->attemptSave()
#13 /srv/mediawiki/php-1.25wmf22/includes/actions/EditAction.php(56): EditPage->edit()
#14 /srv/mediawiki/php-1.25wmf22/includes/actions/SubmitAction.php(40): EditAction->show()
#15 /srv/mediawiki/php-1.25wmf22/includes/MediaWiki.php(403): SubmitAction->show()
#16 /srv/mediawiki/php-1.25wmf22/includes/MediaWiki.php(275): MediaWiki->performAction()
#17 /srv/mediawiki/php-1.25wmf22/includes/MediaWiki.php(571): MediaWiki->performRequest()
#18 /srv/mediawiki/php-1.25wmf22/includes/MediaWiki.php(422): MediaWiki->main()
#19 /srv/mediawiki/php-1.25wmf22/index.php(46): MediaWiki->run()
#20 /srv/mediawiki/w/index.php(3): include()

Event Timeline

Spage updated the task description. (Show Details)
Spage raised the priority of this task from to High.
Spage added a subscriber: Spage.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 20 2015, 8:25 AM

Change 198426 had a related patch set uploaded (by EBernhardson):
Read revision from master when determining notifications to send

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

This wasn't noticed until now as its a timing bug and depended on the amount of slave lag and the time it took to get from writing out the new revision to sending the notifications.

FWIW from fluorine logs:

  • there were three other occurrences in today's exception.log that weren't me, all on mediawikiwiki.
  • on 2015-03-19 there were 20 exceptions, including some on test2wiki and testwikidatawiki (I wonder if some browsertest failed?)
  • no exceptions earlier in March

Change 198426 merged by jenkins-bot:
Read revision from master when determining notifications to send

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

I think this also means users with enotifminoredits falsy can miss notifications, so we need to SWAT this on Monday.

Change 198467 had a related patch set uploaded (by Mattflaschen):
Read revision from master when determining notifications to send

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

Change 198468 had a related patch set uploaded (by Mattflaschen):
Read revision from master when determining notifications to send

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

@matthiasmullie I did the cherry-picks above. It would be good to get this in the morning SWAT if possible.

It depends on cherry-picks of "Update mock wgEchoConfig to also run on Special:JavaScript/qunit/plain" to pass Jenkins, which I've done now.

Change 198467 merged by jenkins-bot:
Read revision from master when determining notifications to send

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

Change 198468 merged by jenkins-bot:
Read revision from master when determining notifications to send

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

Mattflaschen-WMF closed this task as Resolved.Mar 26 2015, 10:05 PM
Mattflaschen-WMF assigned this task to EBernhardson.
Mattflaschen-WMF set Security to None.
Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptJun 12 2015, 6:35 PM