Page MenuHomePhabricator

UserNotLoggedIn exception: ⧼User must be logged-in.⧽
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

MediaWiki version: 1.36.0-wmf.6

message
UserNotLoggedIn: ⧼User must be logged-in.⧽
exception.trace
#0 /srv/mediawiki/php-1.36.0-wmf.6/extensions/GrowthExperiments/includes/HelpPanel/QuestionPoster/QuestionPosterFactory.php(60): GrowthExperiments\HelpPanel\QuestionPoster\QuestionPoster->__construct(DerivativeContext, string, string)
#1 /srv/mediawiki/php-1.36.0-wmf.6/extensions/GrowthExperiments/includes/Api/ApiHelpPanelPostQuestion.php(104): GrowthExperiments\HelpPanel\QuestionPoster\QuestionPosterFactory->getQuestionPoster(string, string, DerivativeContext, string, string)
#2 /srv/mediawiki/php-1.36.0-wmf.6/extensions/GrowthExperiments/includes/Api/ApiHelpPanelPostQuestion.php(64): GrowthExperiments\Api\ApiHelpPanelPostQuestion->getQuestionPoster(string, string, string)
#3 /srv/mediawiki/php-1.36.0-wmf.6/includes/api/ApiMain.php(1593): GrowthExperiments\Api\ApiHelpPanelPostQuestion->execute()
#4 /srv/mediawiki/php-1.36.0-wmf.6/includes/api/ApiMain.php(529): ApiMain->executeAction()
#5 /srv/mediawiki/php-1.36.0-wmf.6/includes/api/ApiMain.php(500): ApiMain->executeActionWithErrorHandling()
#6 /srv/mediawiki/php-1.36.0-wmf.6/api.php(90): ApiMain->execute()
#7 /srv/mediawiki/php-1.36.0-wmf.6/api.php(45): wfApiMain()
#8 /srv/mediawiki/w/api.php(3): require(string)
#9 {main}

Impact

Users do have a warning message that their question is not posted since they were logged out in a different tab (or their session expired). Although it's not ideal - the warning can be dismissed, but a user is not visibly logged out.

betalabstestwiki
Screen Shot 2020-08-31 at 2.46.41 PM.png (547×380 px, 51 KB)
Screen Shot 2020-08-31 at 2.50.00 PM.png (521×414 px, 69 KB)

Notes

  • Probably it should not be logged in as an error in logstash?
  • steps to reproduce:
    • log in to testwiki and open two articles in two different tabs.
    • in the first tab click 'Edit' to see Help panel
    • log out from the second tab
    • in the first tab (where Help panel was opened) - type a question and submit. A warning message will be displayed.

Details

Event Timeline

Krinkle renamed this task from ⧼User must be logged-in.⧽ to UserNotLoggedIn exception: ⧼User must be logged-in.⧽.Sep 8 2020, 7:39 PM
Krinkle updated the task description. (Show Details)
Krinkle edited Stack Trace. (Show Details)
Krinkle moved this task from Untriaged to Sep 2020 on the Wikimedia-production-error board.
Krinkle moved this task from Sep 2020 to Aug 2020 on the Wikimedia-production-error board.

In a web context, UserNotLoggedIn is handled automatically and does not reach Logstash. I guess that is not the case for the action API. The API should catch and replace with a better error message (or maybe it would make sense to do this in the core API framework?), and the error dialog should include the API error message.

Testwiki displaying the raw HTML for the message is probably worth its own task.

In a web context, UserNotLoggedIn is handled automatically and does not reach Logstash. I guess that is not the case for the action API. The API should catch and replace with a better error message (or maybe it would make sense to do this in the core API framework?), and the error dialog should include the API error message.

There are 3 more such errors on wmf.10 arwiki.

Testwiki displaying the raw HTML for the message is probably worth its own task.

Agree - filed as T263793: Help panel: error message for logged out user shows raw HTML

Let's throw this into the sprint then. The user impact is minimal, but generating production error log noise is not nice, and the fix is trivial.

Change 631133 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/extensions/GrowthExperiments@master] Catch UserNotLoggedIn error in ApiHelpPanelPostQuestion

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

message
UserNotLoggedIn: ⧼User must be logged-in.⧽

That's also a bit weird. Is the error message being double-localized?

Change 631133 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] Catch UserNotLoggedIn error in ApiHelpPanelPostQuestion

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

Change 631313 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/extensions/GrowthExperiments@master] Fix UserNotLoggedIn usage in QuestionPoster

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

Change 631313 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] Fix UserNotLoggedIn usage in QuestionPoster

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