Page MenuHomePhabricator

[Bug] Catchable fatal error: Argument 1 passed to Wikibase\Lib\AutoCommentFormatter::__construct() must be an instance of Language, StubUserLang given in AutoCommentFormatter.php on line 38
Closed, ResolvedPublic

Description

not frequent, but spotted in the logs:

Catchable fatal error: Argument 1 passed to Wikibase\Lib\AutoCommentFormatter::__construct() must be an instance of Language, StubUserLang given in /srv/mediawiki/php-1.26wmf22/extensions/Wikidata/extensions/Wikibase/lib/includes/formatters/AutoCommentFormatter.php on line 38

Details

Related Gerrit Patches:
mediawiki/extensions/Wikibase : masterRemove StubUserLang debug logging
mediawiki/extensions/Wikibase : wmf/1.26wmf22Unstub $wgLang before passing to AutoCommentFormatter
mediawiki/extensions/Wikibase : masterUnstub $wgLang before passing to AutoCommentFormatter

Event Timeline

aude created this task.Sep 10 2015, 9:31 AM
aude raised the priority of this task from to Needs Triage.
aude updated the task description. (Show Details)
aude added a subscriber: aude.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 10 2015, 9:31 AM
aude renamed this task from Catchable fatal error: Argument 1 passed to Wikibase\Lib\AutoCommentFormatter::__construct() must be an instance of Language, StubUserLang given in AutoCommentFormatter.php on line 38 to [Bug] Catchable fatal error: Argument 1 passed to Wikibase\Lib\AutoCommentFormatter::__construct() must be an instance of Language, StubUserLang given in AutoCommentFormatter.php on line 38.Sep 10 2015, 10:20 AM
aude set Security to None.
aude triaged this task as High priority.Sep 10 2015, 10:37 AM
aude lowered the priority of this task from High to Medium.

see more entries in the logs and should fix it asap. (5 entries today)

aude added a comment.Sep 11 2015, 10:06 AM

We had a related issue in T107711 and the cause of those appears to be AbuseFilter. Likely, it's the same cause for this.

Change 237620 merged by jenkins-bot:
Unstub $wgLang before passing to AutoCommentFormatter

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

aude closed this task as Resolved.Sep 11 2015, 2:04 PM
aude removed a project: Patch-For-Review.

with the debug logging, I can create a new task if I see some actionable task, such as something to fix in AbuseFilter.

aude moved this task from Review to Done on the Wikidata-Sprint-2015-09-01 board.Sep 11 2015, 2:05 PM

Change 239368 had a related patch set uploaded (by Aude):
Unstub $wgLang before passing to AutoCommentFormatter

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

Change 239368 merged by jenkins-bot:
Unstub $wgLang before passing to AutoCommentFormatter

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

aude added a comment.Sep 23 2015, 6:57 PM

Here is a stacktrace of how we ended up with a StubUserLang in the AutoCommentFormatter:

#0 /srv/mediawiki/php-1.26wmf23/includes/Hooks.php(204): Wikibase\RepoHooks::onFormat(array, NULL, boolean, string, boolean, Title, boolean)
#1 /srv/mediawiki/php-1.26wmf23/includes/Linker.php(1333): Hooks::run(string, array)
#2 /srv/mediawiki/php-1.26wmf23/includes/Linker.php(1375): Closure$Linker::formatAutocomments(array)
#3 /srv/mediawiki/php-1.26wmf23/includes/Linker.php(1289): Linker::formatAutocomments(string, Title, boolean)
#4 /srv/mediawiki/php-1.26wmf23/includes/api/ApiQueryWatchlist.php(386): Linker::formatComment(string, Title)
#5 /srv/mediawiki/php-1.26wmf23/includes/api/ApiQueryWatchlist.php(268): ApiQueryWatchlist->extractRowInfo(stdClass)
#6 /srv/mediawiki/php-1.26wmf23/includes/api/ApiQueryWatchlist.php(40): ApiQueryWatchlist->run()
#7 /srv/mediawiki/php-1.26wmf23/includes/api/ApiQuery.php(286): ApiQueryWatchlist->execute()
#8 /srv/mediawiki/php-1.26wmf23/includes/api/ApiMain.php(1270): ApiQuery->execute()
#9 /srv/mediawiki/php-1.26wmf23/includes/api/ApiMain.php(466): ApiMain->executeAction()
#10 /srv/mediawiki/php-1.26wmf23/includes/api/ApiMain.php(438): ApiMain->executeActionWithErrorHandling()
#11 /srv/mediawiki/php-1.26wmf23/api.php(88): ApiMain->execute()
#12 /srv/mediawiki/w/api.php(3): include(string)

aude added a comment.Nov 2 2015, 3:18 PM

this happens when formatting autocomments via ApiQueryRecentChanges or ApiQueryWatchlist:

Bug: T112070: #0 /srv/mediawiki/php-1.27.0-wmf.4/includes/Hooks.php(204): Wikibase\RepoHooks::onFormat(array, NULL, boolean, string, boolean, Title, boolean)
#1 /srv/mediawiki/php-1.27.0-wmf.4/includes/Linker.php(1346): Hooks::run(string, array)
#2 /srv/mediawiki/php-1.27.0-wmf.4/includes/Linker.php(1387): Closure$Linker::formatAutocomments(array)
#3 /srv/mediawiki/php-1.27.0-wmf.4/includes/Linker.php(1293): Linker::formatAutocomments(string, Title, boolean, NULL)
#4 /srv/mediawiki/php-1.27.0-wmf.4/includes/api/ApiQueryRecentChanges.php(510): Linker::formatComment(string, Title)
#5 /srv/mediawiki/php-1.27.0-wmf.4/includes/api/ApiQueryRecentChanges.php(387): ApiQueryRecentChanges->extractRowInfo(stdClass)
#6 /srv/mediawiki/php-1.27.0-wmf.4/includes/api/ApiQueryRecentChanges.php(131): ApiQueryRecentChanges->run()
#7 /srv/mediawiki/php-1.27.0-wmf.4/includes/api/ApiQuery.php(287): ApiQueryRecentChanges->execute()
#8 /srv/mediawiki/php-1.27.0-wmf.4/includes/api/ApiMain.php(1270): ApiQuery->execute()
#9 /srv/mediawiki/php-1.27.0-wmf.4/includes/api/ApiMain.php(466): ApiMain->executeAction()
#10 /srv/mediawiki/php-1.27.0-wmf.4/includes/api/ApiMain.php(438): ApiMain->executeActionWithErrorHandling()
#11 /srv/mediawiki/php-1.27.0-wmf.4/api.php(88): ApiMain->execute()
#12 /srv/mediawiki/w/api.php(3): include(string)

I just checked and this is still occurring. Here is a new trrack with updated line numbers etc.

2016-08-01 05:53:51 [V57j7wpAEDUAAHWvqBAAAABS] mw1288 wikidatawiki 1.28.0-wmf.12 wikibase-debug INFO: Bug: T112070: #0 /srv/mediawiki/php-1.28.0-wmf.12/includes/Hooks.php(195): Wikibase\RepoHooks::onFormat(NULL, boolean, string, boolean, Title, boolean, NULL)
#1 /srv/mediawiki/php-1.28.0-wmf.12/includes/Linker.php(1243): Hooks::run(string, array)
#2 /srv/mediawiki/php-1.28.0-wmf.12/includes/Linker.php(1284): Closure$Linker::formatAutocomments(array)
#3 /srv/mediawiki/php-1.28.0-wmf.12/includes/Linker.php(1190): Linker::formatAutocomments(string, Title, boolean, NULL)
#4 /srv/mediawiki/php-1.28.0-wmf.12/includes/api/ApiQueryWatchlist.php(367): Linker::formatComment(string, Title)
#5 /srv/mediawiki/php-1.28.0-wmf.12/includes/api/ApiQueryWatchlist.php(192): ApiQueryWatchlist->extractOutputData(WatchedItem, array)
#6 /srv/mediawiki/php-1.28.0-wmf.12/includes/api/ApiQueryWatchlist.php(42): ApiQueryWatchlist->run()
#7 /srv/mediawiki/php-1.28.0-wmf.12/includes/api/ApiQuery.php(251): ApiQueryWatchlist->execute()
#8 /srv/mediawiki/php-1.28.0-wmf.12/includes/api/ApiMain.php(1435): ApiQuery->execute()
#9 /srv/mediawiki/php-1.28.0-wmf.12/includes/api/ApiMain.php(508): ApiMain->executeAction()
#10 /srv/mediawiki/php-1.28.0-wmf.12/includes/api/ApiMain.php(479): ApiMain->executeActionWithErrorHandling()
#11 /srv/mediawiki/php-1.28.0-wmf.12/api.php(83): ApiMain->execute()
#12 /srv/mediawiki/w/api.php(3): include(string)
#13 {main}
hoo added a subscriber: hoo.Dec 5 2018, 9:04 AM

3 years later and this is still happening :/

All occurrences are coming from ApiQueryWatchlist (rarely)/ ApiQueryRecentChanges (more often, probably because it's used way more frequently).

Change 477978 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/Wikibase@master] Remove StubUserLang debug logging

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

Change 477978 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Remove StubUserLang debug logging

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