Page MenuHomePhabricator

"Internal Error" on Recent Changes: Bad value for parameter $title: should not be empty unless namespace is main and fragment or interwiki is non-empty
Open, Needs TriagePublic

Description

Updated to 1.34 this morning, not certain if this was an error before. When I open the Recent Changes page I get a generic "Internal error" and no pages listed (there should be changes as I had made edits). Nothing in php.log, but when I turn on debug I get the following error in the debug console:

[exception] [Xf5TyEWj@38AAAjVlmwAAAAB] /index.php?title=Special:RecentChanges Wikimedia\Assert\ParameterAssertionException from line 63 of /home/xxx/xxx.xxx.ca/vendor/wikimedia/assert/src/Assert.php: Bad value for parameter $title: should not be empty unless namespace is main and fragment or interwiki is non-empty

Version info:
MediaWiki: 1.34.0 (ff037a9)
Git branch: REL1_34
PHP: 7.3.11

Ran rebuildrecentchanges.php, no improvement.

Related Objects

Event Timeline

I can't make sense of the error, but: we use

[[o:{{PAGENAME}}]]

as a link to a sister page with the same name on a properly declared interwiki in a lot of pages. The links work as expected when the sister page exists, and link to a "this page doesn't exist" type page when the sister page doesn't exist. Just in case this might be related.

With $wgShowExceptionDetails = true I still only get the "Internal error" on page. Something else flashes briefly when I first open the page but then gets hidden. Here is what I do in Localsettings to turn on debugging:

$debug = true; # Set this to true for debugging, false otherwise.
if ( $debug ) {
	error_reporting( -1 );
	ini_set( 'display_errors', 1 );
	$wgDebugToolbar = true;
	$wgShowSQLErrors = true;
	$wgShowExceptionDetails = true; 
	$wgShowDBErrorBacktrace = true;
	$wgDebugLogFile = "/home/ccmdb/logs/debug-{$wgDBname}.log";

	$wgAuthenticationTokenVersion = "1"; # Changing this will log out all existing sessions.
 }

My debug log file has
[Sat Dec 21 08:55:55 2019] [error] [client 104.246.134.43] File does not exist: /home/xxx/xxx.xxx.ca/internal_error.html, referer: https://xxx.xxx.ca/index.php?title=Special:RecentChanges

Ah here we go:

[SQLBagOStuff] MainObjectStash using store ReplicatedBagOStuff
[objectcache] MainWANObjectCache using store EmptyBagOStuff
IP: 104.246.134.43
Start request GET /index.php?title=Special:RecentChanges
HTTP HEADERS:
CACHE-CONTROL: max-age=0
UPGRADE-INSECURE-REQUESTS: 1
COOKIE: xxxdbUserName=xxx; _pk_id.5.21b0=835b542ae4dc1d2f.1547433897.59.1573579094.1573579087.; _pk_id.2.21b0=7f069500f448f53f.1551222927.1.1551222927.1551222927.; _pk_testcookie..undefined=1; xxxmwdb_session=db2sp8pbqpcfa9e259cplm3e44hrbqg3; xxxmwdbUserID=2; xxxmwdbToken=efdf1b9809a85f8da18db9f5abe2ac76; UseDC=master; UseCDNCache=false
CONNECTION: close
DNT: 1
REFERER: https://xxx.xxx.ca/index.php?title=Special:ReplaceText
ACCEPT-ENCODING: gzip, deflate, br
ACCEPT-LANGUAGE: en-US,en;q=0.5
ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
USER-AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0
HOST: xxx.xxx.ca
[localisation] LocalisationCache: using store LCStoreCDB
[session] SessionManager using store SqlBagOStuff
[DBReplication] Cannot use ChronologyProtector with EmptyBagOStuff
[DBReplication] Wikimedia\Rdbms\LBFactory::getChronologyProtector: request info {
"IPAddress": "104.246.134.43",
"UserAgent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko\/20100101 Firefox\/71.0",
"ChronologyProtection": false,
"ChronologyPositionIndex": 0,
"ChronologyClientId": false
}
[DBConnection] Wikimedia\Rdbms\LoadBalancer::lazyLoadReplicationPositions: executed chronology callback.
[DBConnection] Wikimedia\Rdbms\LoadBalancer::getLocalConnection: connected to database 0 at 'xxxdb.xxx.ca'.
User: cache miss for user 2
User: loading options for user 2 from database.
[DBConnection] Wikimedia\Rdbms\LoadBalancer::getLocalConnection: connected to database 0 at 'xxxdb.xxx.ca'.
[SQLBagOStuff] Connection mysql object #296 (handle id #299) will be used for SqlBagOStuff
[SQLBagOStuff] Connection mysql object #296 (handle id #299) will be used for SqlBagOStuff
User::getBlockedStatus: checking...
User: loading options for user 2 from override cache.
[MessageCache] MessageCache using store SqlBagOStuff
[SQLBagOStuff] Connection mysql object #296 (handle id #299) will be used for SqlBagOStuff
[SQLBagOStuff] Connection mysql object #296 (handle id #299) will be used for SqlBagOStuff
[SQLBagOStuff] Connection mysql object #296 (handle id #299) will be used for SqlBagOStuff
[SQLBagOStuff] Connection mysql object #296 (handle id #299) will be used for SqlBagOStuff
[SQLBagOStuff] SqlBagOStuff::lock failed due to timeout for xxxmwdb:messages:en.
[ContentHandler] Created handler for css: CssContentHandler
[ContentHandler] Created handler for wikitext: WikitextContentHandler
[ContentHandler] Created handler for javascript: JavaScriptContentHandler
[SQLBagOStuff] Connection mysql object #296 (handle id #299) will be used for SqlBagOStuff
[SQLBagOStuff] Connection mysql object #296 (handle id #299) will be used for SqlBagOStuff
[MessageCache] MessageCache::load: Loading en... local cache is empty, global cache is expired/volatile, loading from database
ParserFactory: using preprocessor: Preprocessor_Hash
Unstubbing $wgLang on call of $wgLang::_unstub from ParserOptions->__construct
[exception] [Xf58QEWj@38AAAZ47TwAAAAB] /index.php?title=Special:RecentChanges Wikimedia\Assert\ParameterAssertionException from line 63 of /home/xxx/xxx.xxx.ca/vendor/wikimedia/assert/src/Assert.php: Bad value for parameter $title: should not be empty unless namespace is main and fragment or interwiki is non-empty
User: loading options for user 2 from database.
User: loading options for user 2 from database.
User: loading options for user 2 from database.

Need the full exception backtrace, which Isn’t either of those

Though you should get it as you’ve set the right output with $wgShowExceptionDetails

$wgShowExceptionDetails is set to true. I have also taken all of those settings out of that convenience loop I copy pasted above with my debug settings in my localsettings.php, just to be sure. Still the same. I can get the debug info with the eventual exception displayed on the screen, but not the stack trace.
Is there any second place I should be able to pick up or send the stack trace?

I checked "Use non-JavaScript interface" in preferences and then I was able to get the stack trace:

[XgAAy0Wj@38AABo5XuwAAAAA] /index.php?title=Special:RecentChanges Wikimedia\Assert\ParameterAssertionException from line 63 of /home/intmed1/internal.umintmed.ca/vendor/wikimedia/assert/src/Assert.php: Bad value for parameter $title: should not be empty unless namespace is main and fragment or interwiki is non-empty

Backtrace:

#0 /home/xxx/xxx.xxx.ca/includes/title/TitleValue.php(109): Wikimedia\Assert\Assert::parameter(boolean, string, string)
#1 /home/xxx/xxx.xxx.ca/includes/specials/SpecialRecentChanges.php(435): TitleValue->__construct(integer, string)
#2 /home/xxx/xxx.xxx.ca/includes/specialpage/ChangesListSpecialPage.php(1660): SpecialRecentChanges->outputChangesList(Wikimedia\Rdbms\ResultWrapper, FormOptions)
#3 /home/xxx/xxx.xxx.ca/includes/specialpage/ChangesListSpecialPage.php(671): ChangesListSpecialPage->webOutput(Wikimedia\Rdbms\ResultWrapper, FormOptions)
#4 /home/xxx/xxx.xxx.ca/includes/specials/SpecialRecentChanges.php(165): ChangesListSpecialPage->execute(NULL)
#5 /home/xxx/xxx.xxx.ca/includes/specialpage/SpecialPage.php(575): SpecialRecentChanges->execute(NULL)
#6 /home/xxx/xxx.xxx.ca/includes/specialpage/SpecialPageFactory.php(611): SpecialPage->run(NULL)
#7 /home/xxx/xxx.xxx.ca/includes/MediaWiki.php(296): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#8 /home/xxx/xxx.xxx.ca/includes/MediaWiki.php(900): MediaWiki->performRequest()
#9 /home/xxx/xxx.xxx.ca/includes/MediaWiki.php(527): MediaWiki->main()
#10 /home/xxx/xxx.xxx.ca/index.php(47): MediaWiki->run()
#11 {main}
Aklapper renamed this task from Generic "Internal Error" on Recent Changes page to "Internal Error" on Recent Changes: Bad value for parameter $title: should not be empty unless namespace is main and fragment or interwiki is non-empty.Jan 3 2020, 3:54 PM

Any idea what might be causing this? It only happens on this one out of my 5 wikis.

From what I can see in the code, there must be an entry in your recentchanges with empty rc_title. Not sure what could cause this...

You are correct: "SELECT * FROM recentchanges where not (rc_title > "")" gives me 312 records. The first 25 all have
rc_source = mw.log
rc_log_type = cargo
rc_log_create = recreatetable

If I clear those out, recent changes works as it should.

So, some extra info. I use the cargo extension, and I run maintenance script cargorecreatedata (https://www.mediawiki.org/wiki/Extension:Cargo/Storing_data#Command-line_script) nightly because we had some trouble with things not updating in the past. I just ran the script manually, and it didn't throw any errors.
However, when I run recent changes again, the "Internal error" is back.

I will contact the Cargo people about this to find out if they can change the blank rc title.

Could I also suggest that MW should handle an empty rc_title more informatively than with just an "Internal error" (as it does when "Use non-JavaScript interface" is false in RC settings, even if debug is enabled)? This might more generally be a matter of that red-ish debug box not showing in that case, not sure though.

I have given up on a fix for this and instead set up a cron job that deletes the offending lines with a "Delete FROM recentchanges where not (rc_title > ""). This fixes recent changes for me on that wiki.