Page MenuHomePhabricator

Wikimedia\Assert\InvariantException: Invariant failed: MentorQuestionPoster called without a mentor present
Closed, DuplicatePublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   Wikimedia\Assert\InvariantException: Invariant failed: MentorQuestionPoster called without a mentor present
FrameLocationCall
from/srv/mediawiki/php-1.44.0-wmf.19/vendor/wikimedia/assert/src/Assert.php(231)
#0/srv/mediawiki/php-1.44.0-wmf.19/extensions/GrowthExperiments/includes/HelpPanel/QuestionPoster/MentorQuestionPoster.php(71)Wikimedia\Assert\Assert::invariant(bool, string)
#1/srv/mediawiki/php-1.44.0-wmf.19/extensions/GrowthExperiments/includes/HelpPanel/QuestionPoster/QuestionPoster.php(487)GrowthExperiments\HelpPanel\QuestionPoster\MentorQuestionPoster->getDirectTargetTitle()
#2/srv/mediawiki/php-1.44.0-wmf.19/extensions/GrowthExperiments/includes/HelpPanel/QuestionPoster/QuestionPoster.php(86)GrowthExperiments\HelpPanel\QuestionPoster\QuestionPoster->getTargetTitle()
#3/srv/mediawiki/php-1.44.0-wmf.19/extensions/GrowthExperiments/includes/HelpPanel/QuestionPoster/MentorQuestionPoster.php(36)GrowthExperiments\HelpPanel\QuestionPoster\QuestionPoster->__construct(MediaWiki\Page\WikiPageFactory, MediaWiki\Title\TitleFactory, MediaWiki\Permissions\PermissionManager, Wikimedia\Stats\StatsFactory, bool, bool, MediaWiki\Context\DerivativeContext, string, string)
#4/srv/mediawiki/php-1.44.0-wmf.19/extensions/GrowthExperiments/includes/HelpPanel/QuestionPoster/QuestionPosterFactory.php(123)GrowthExperiments\HelpPanel\QuestionPoster\MentorQuestionPoster->__construct(MediaWiki\Page\WikiPageFactory, MediaWiki\Title\TitleFactory, GrowthExperiments\Mentorship\MentorManager, MediaWiki\Permissions\PermissionManager, Wikimedia\Stats\StatsFactory, bool, bool, MediaWiki\Context\DerivativeContext, string, string)
#5/srv/mediawiki/php-1.44.0-wmf.19/extensions/GrowthExperiments/includes/Api/ApiHelpPanelPostQuestion.php(99)GrowthExperiments\HelpPanel\QuestionPoster\QuestionPosterFactory->getQuestionPoster(string, string, MediaWiki\Context\DerivativeContext, string, string)
#6/srv/mediawiki/php-1.44.0-wmf.19/extensions/GrowthExperiments/includes/Api/ApiHelpPanelPostQuestion.php(58)GrowthExperiments\Api\ApiHelpPanelPostQuestion->getQuestionPoster(string, string, string)
#7/srv/mediawiki/php-1.44.0-wmf.19/includes/api/ApiMain.php(2005)GrowthExperiments\Api\ApiHelpPanelPostQuestion->execute()
#8/srv/mediawiki/php-1.44.0-wmf.19/includes/api/ApiMain.php(947)MediaWiki\Api\ApiMain->executeAction()
#9/srv/mediawiki/php-1.44.0-wmf.19/includes/api/ApiMain.php(918)MediaWiki\Api\ApiMain->executeActionWithErrorHandling()
#10/srv/mediawiki/php-1.44.0-wmf.19/includes/api/ApiEntryPoint.php(152)MediaWiki\Api\ApiMain->execute()
#11/srv/mediawiki/php-1.44.0-wmf.19/includes/MediaWikiEntryPoint.php(202)MediaWiki\Api\ApiEntryPoint->execute()
#12/srv/mediawiki/php-1.44.0-wmf.19/api.php(44)MediaWiki\MediaWikiEntryPoint->run()
#13/srv/mediawiki/w/api.php(3)require(string)
#14{main}
Impact
Notes

Details

Request URL
https://pt.wikipedia.org/w/api.php

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I managed to reproduce this by:

  1. have a mentor
  2. in Tab 1) on your homepage, open up the "Ask you Mentor a question" dialog and write something, but don't submit it yet
  3. in Tab 2) opt out of mentorship
  4. submit question

I would assume this might happen as well if the mentor goes away while the message is being written, and similar circumstances.

This still keeps happening on and off: https://logstash.wikimedia.org/goto/8811d92f9c04f7b8dcae5e4f74b60219

This is a snapshot over the last 30 days:

image.png (221×459 px, 10 KB)

I've highlighted this production error in T386567: ApiHelpPanelPostQuestion throws an unhandled exception on invalid API calls and moved that task to Up Next on our board.

This is a duplicate with the other task @Michael listed (and that @EMcFarland-WMF is currently working on). I'll merge both tasks.