Last modified: 2014-09-05 02:43:52 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T70887, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 68887 - internal_api_error_BadMethodCallException from GettingStarted morelike task type
internal_api_error_BadMethodCallException from GettingStarted morelike task type
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
CirrusSearch (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Matthew Flaschen
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-31 00:01 UTC by Steven Walling
Modified: 2014-09-05 02:43 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Steven Walling 2014-07-31 00:01:06 UTC
The post-edit notification fails to trigger on Beta Labs with the following error response. 

"info":"Exception Caught: Call to a member function addInterwikiResults() on a non-object (NULL)","*":"\n\n#0 /srv/common-local/php-master/includes/api/ApiQuerySearch.php(100): CirrusSearch->searchText()\n#1 /srv/common-local/php-master/includes/api/ApiQuerySearch.php(47): ApiQuerySearch->run()\n#2 /srv/common-local/php-master/includes/api/ApiQuery.php(281): ApiQuerySearch->execute()\n#3 /srv/common-local/php-master/includes/api/ApiMain.php(907): ApiQuery->execute()\n#4 /srv/common-local/php-master/includes/api/ApiMain.php(332): ApiMain->executeAction()\n#5 /srv/common-local/php-master/extensions/GettingStarted/MoreLikePageSuggester.php(53): ApiMain->execute()\n#6 /srv/common-local/php-master/extensions/GettingStarted/api/ApiGettingStartedGetPages.php(66): GettingStarted\\MoreLikePageSuggester->getArticles()\n#7 /srv/common-local/php-master/extensions/GettingStarted/api/ApiGettingStartedGetPages.php(32): GettingStarted\\ApiGettingStartedGetPages->getArticles()\n#8 /srv/common-local/php-master/includes/api/ApiPageSet.php(176): GettingStarted\\ApiGettingStartedGetPages->executeGenerator()\n#9 /srv/common-local/php-master/includes/api/ApiPageSet.php(132): ApiPageSet->executeInternal()\n#10 /srv/common-local/php-master/includes/api/ApiQuery.php(265): ApiPageSet->execute()\n#11 /srv/common-local/php-master/includes/api/ApiMain.php(907): ApiQuery->execute()\n#12 /srv/common-local/php-master/includes/api/ApiMain.php(363): ApiMain->executeAction()\n#13 /srv/common-local/php-master/includes/api/ApiMain.php(334): ApiMain->executeActionWithErrorHandling()\n#14 /srv/common-local/php-master/api.php(85): ApiMain->execute()\n#15 /srv/common-local/w/api.php(3): include()\n#16 {main}\n\n"
Comment 1 Steven Walling 2014-07-31 00:29:28 UTC
After more testing: many older articles on beta labs work just fine. This specifically appeared on editing a newly-imported page, like http://en.wikipedia.beta.wmflabs.org/wiki/Cheese
Comment 2 Matthew Flaschen 2014-08-21 22:17:56 UTC
It's reproducible on non-existent articles (http://en.wikipedia.beta.wmflabs.org/w/api.php?action=query&list=gettingstartedgetpages&gsgptaskname=morelike&gsgpcount=9&gsgpexcludedtitle=asdfasdfasdfasdfasdf&format=xmlfm) and just-created ones (as originally reported).

It seems to be an issue in CirrusSearch where it calls addInterwikiResults on a null object.  I think this indicates the initial search had no results (but didn't throw an error or anything), and it then tries to do an interwiki search.

In production, it looks like this currently affects the Italian projects (GettingStarted is installed on Italian Wikipedia).
Comment 3 Gerrit Notification Bot 2014-08-27 19:19:58 UTC
Change 156607 had a related patch set uploaded by Manybubbles:
Don't add interwiki results to null

https://gerrit.wikimedia.org/r/156607
Comment 4 Nik Everett 2014-08-27 19:20:52 UTC
Thanks for the easy reproduction steps.  Sorry it took me so long to get to.
Comment 5 Gerrit Notification Bot 2014-08-27 19:34:53 UTC
Change 156607 merged by jenkins-bot:
Don't add interwiki results to null

https://gerrit.wikimedia.org/r/156607
Comment 6 Matthew Flaschen 2014-09-04 02:34:29 UTC
Nik, doesn't that mean it won't show any interwiki results if there are not results on the current wiki (since "0 results" == null)?

I'm not totally sure how interwiki results are supposed to work, but that seems like it might not be desired behavior.  E.g. on English Wikipedia, should it show English Wiktionary results even if there are no English Wikipedia results?  Is that how interwiki results normally work (other than the 0 results part)?
Comment 7 Nik Everett 2014-09-04 13:02:32 UTC
Nah, an empty search results object isn't falsy in this case.  Its an object rather than an array.  Though, you are right it'd be more clear to check for null directly.  You want to send a patch :) ?

Also, some proof:
https://it.wiktionary.org/w/index.php?title=Speciale%3ARicerca&profile=default&search=ulteriori+informazioni&fulltext=Search
Comment 8 Matthew Flaschen 2014-09-05 02:43:52 UTC
(In reply to Nik Everett from comment #7)
> Nah, an empty search results object isn't falsy in this case.  Its an object
> rather than an array.  Though, you are right it'd be more clear to check for
> null directly.  You want to send a patch :) ?

I wasn't thinking of weak type equality issues, but rather https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FCirrusSearch.git/bc8ac094eaa9ebbc22de44667c4ea97ca0fb70b4/includes%2FCirrusSearch.php#L61 :

* @return Search\ResultSet|null|Status results, no results, or error respectively

which apparently indicates (second in list on both sides) that null means "no results":

> Also, some proof:
> https://it.wiktionary.org/w/index.
> php?title=Speciale%3ARicerca&profile=default&search=ulteriori+informazioni&fu
> lltext=Search

Thanks for reassuring me.

That feature is awesome, by the way.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links