Page MenuHomePhabricator

TypeError: Argument 1 passed to MediaWiki\Output\OutputPage::parseInternal() must be of the type string, null given, called in /srv/mediawiki/php-1.43.0-wmf.6/includes/Output/OutputPage.php on line 2446
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
labels.normalized_message
[{reqId}] {exception_url}   TypeError: Argument 1 passed to MediaWiki\Output\OutputPage::parseInternal() must be of the type string, null given, called in /srv/mediawiki/php-1.43.0-wmf.6/includes/Output/OutputPage.php on line 2446
error.stack_trace
from /srv/mediawiki/php-1.43.0-wmf.6/includes/Output/OutputPage.php(2511)
#0 /srv/mediawiki/php-1.43.0-wmf.6/includes/Output/OutputPage.php(2446): MediaWiki\Output\OutputPage->parseInternal(NULL, MediaWiki\Title\Title, boolean, boolean)
#1 /srv/mediawiki/php-1.43.0-wmf.6/extensions/LiquidThreads/includes/LqtView.php(2426): MediaWiki\Output\OutputPage->parseAsContent(NULL)
#2 /srv/mediawiki/php-1.43.0-wmf.6/extensions/LiquidThreads/includes/LqtView.php(1616): LqtView::parseSignature(NULL)
#3 /srv/mediawiki/php-1.43.0-wmf.6/extensions/LiquidThreads/includes/LqtView.php(1602): LqtView->threadSignature(Thread)
#4 /srv/mediawiki/php-1.43.0-wmf.6/extensions/LiquidThreads/includes/LqtView.php(1858): LqtView->showThreadBody(Thread)
#5 /srv/mediawiki/php-1.43.0-wmf.6/extensions/LiquidThreads/includes/LqtView.php(2206): LqtView->showSingleThread(Thread)
#6 /srv/mediawiki/php-1.43.0-wmf.6/extensions/LiquidThreads/includes/Pages/ThreadHistoricalRevisionView.php(135): LqtView->showThread(Thread, integer, integer, array)
#7 /srv/mediawiki/php-1.43.0-wmf.6/extensions/LiquidThreads/includes/LqtDispatch.php(111): ThreadHistoricalRevisionView->show()
#8 /srv/mediawiki/php-1.43.0-wmf.6/extensions/LiquidThreads/includes/LqtDispatch.php(231): LqtDispatch::threadPermalinkMain(MediaWiki\Output\OutputPage, Article, MediaWiki\Title\Title, MediaWiki\User\User, MediaWiki\Request\WebRequest)
#9 /srv/mediawiki/php-1.43.0-wmf.6/includes/HookContainer/HookContainer.php(159): LqtDispatch::tryPage(MediaWiki\Output\OutputPage, Article, MediaWiki\Title\Title, MediaWiki\User\User, MediaWiki\Request\WebRequest, MediaWiki\Actions\ActionEntryPoint)
#10 /srv/mediawiki/php-1.43.0-wmf.6/includes/HookContainer/HookRunner.php(2530): MediaWiki\HookContainer\HookContainer->run(string, array)
#11 /srv/mediawiki/php-1.43.0-wmf.6/includes/actions/ActionEntryPoint.php(695): MediaWiki\HookContainer\HookRunner->onMediaWikiPerformAction(MediaWiki\Output\OutputPage, Article, MediaWiki\Title\Title, MediaWiki\User\User, MediaWiki\Request\WebRequest, MediaWiki\Actions\ActionEntryPoint)
#12 /srv/mediawiki/php-1.43.0-wmf.6/includes/actions/ActionEntryPoint.php(508): MediaWiki\Actions\ActionEntryPoint->performAction(Article, MediaWiki\Title\Title)
#13 /srv/mediawiki/php-1.43.0-wmf.6/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()
#14 /srv/mediawiki/php-1.43.0-wmf.6/includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute()
#15 /srv/mediawiki/php-1.43.0-wmf.6/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#16 /srv/mediawiki/w/index.php(3): require(string)
#17 {main}
Impact
Notes

Event Timeline

It seems LQT Thread->signature is typed null|string but its constructor implies that this does not survive past the constructor, with a lzy fallback to a default:

https://gerrit.wikimedia.org/g/mediawiki/extensions/LiquidThreads/+/ee008b8ec4955f69ec9661dff4c8cfde4889a82d/includes/Thread.php#1871

if ( $this->signature === null ) {
	// Grab our signature.
	$sig = LqtView::getUserSignature( $this->author() );
	$contLang = MediaWikiServices::getInstance()->getContentLanguage();
	$set['thread_signature'] = $contLang->truncateForDatabase( $sig, 255, '' );
	$this->setSignature( $sig );
}

My guess is, either the above stack trace can somehow happen without this branch being reached (in which case the real bug might be that something is incorrectly skipping this). Or, it is correctly reached but the above is still producing null (e.g. getUserSignature, or setSignature not setting $this->signature or not setting it to a string).

If it seems like it can't happen, it's probably unserialized objects… yup.

I'll just add a ?? '' somewhere.

Change #1034554 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/LiquidThreads@master] Fix fatal error due to missing signature on very old comments

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

This probably only affects comments posted before rELQTcfbcd544b3e7: LiquidThreads (SCHEMA CHANGE): Make signatures a per-post affair, defaulting to… (2009), and seemingly only when viewing the topic history. I don't think it's a release blocker.

Change #1034554 merged by jenkins-bot:

[mediawiki/extensions/LiquidThreads@master] Fix fatal error due to missing signature on very old comments

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

Change #1034182 had a related patch set uploaded (by Jforrester; author: Bartosz Dziewoński):

[mediawiki/extensions/LiquidThreads@wmf/1.43.0-wmf.6] Fix fatal error due to missing signature on very old comments

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

Change #1034182 merged by jenkins-bot:

[mediawiki/extensions/LiquidThreads@wmf/1.43.0-wmf.6] Fix fatal error due to missing signature on very old comments

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

Mentioned in SAL (#wikimedia-operations) [2024-05-22T08:00:01Z] <hashar@deploy1002> Started scap: Backport for [[gerrit:1034182|Fix fatal error due to missing signature on very old comments (T365495)]]

Mentioned in SAL (#wikimedia-operations) [2024-05-22T08:02:38Z] <hashar@deploy1002> jforrester and hashar: Backport for [[gerrit:1034182|Fix fatal error due to missing signature on very old comments (T365495)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

hashar assigned this task to matmarex.
hashar subscribed.

I have deployed the fix this morning and confirmed the fix while doing the deployment. Thank you @matmarex!

Mentioned in SAL (#wikimedia-operations) [2024-05-22T08:16:29Z] <hashar@deploy1002> Finished scap: Backport for [[gerrit:1034182|Fix fatal error due to missing signature on very old comments (T365495)]] (duration: 16m 27s)