Page MenuHomePhabricator

Fatal exception of type "Wikimedia\Assert\PostconditionException" (page with an invalid title on Pashto Wikipedia)
Closed, ResolvedPublicPRODUCTION ERROR

Description

Hello folks at Wikimedia :)

A fatal occurs on the following request: https://ps.wikipedia.org/?curid=21451

there is also a possibly related problem with the TextExtracts api page in the Pashto that breaks the extracts API. Given the following request

https://ps.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&formatversion=2&pageids=21451

the reply is

{"error":{"code":"invalidtitle","info":"Bad title \"تانبه::لرغونپوهنه\".","docref":"See https://ps.wikipedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."},"warnings":{"extracts":{"warnings":"\"exlimit\" was too large for a whole article extracts request, lowered to 1."}},"servedby":"mw1277"}

Keep up the great work, Enrico

Event Timeline

Aklapper renamed this task from Broken exctracts API for title in Pashto Wikipedia to "invalidtitle" error for extracts API error for title in Pashto Wikipedia .Sep 20 2019, 4:28 PM
Jdlrobson subscribed.

@Ebonetti90
What is the URI of the page with that pageid?
Are you able to use the REST_v1 summary endpoint (which is better supported): https://pt.wikipedia.org/api/rest_v1/#/Page%20content/get_page_summary__title_

Actually I don't know the URI myself, I found it as an error while processing the whole Pashto dump, so I reported it.

Changing the used API wouldn't change the error, this is the reply for getting the page from ID:

MediaWiki internal error.

Original exception: [XYk1sApAMEkAAEOseiAAAACP] 2019-09-23 21:14:24: Fatal exception of type "Wikimedia\Assert\PostconditionException"

Exception caught inside exception handler.

Set $wgShowExceptionDetails = true; at the bottom of LocalSettings.php to show detailed debugging information.
Jdlrobson renamed this task from "invalidtitle" error for extracts API error for title in Pashto Wikipedia to Fatal exception of type "Wikimedia\Assert\PostconditionException" / "invalidtitle" error for extracts API error for title in Pashto Wikipedia .Sep 23 2019, 9:36 PM
Jdlrobson updated the task description. (Show Details)
MaxSem changed the subtype of this task from "Task" to "Production Error".
MaxSem subscribed.
Postcondition failed: makeTitleSafe() should always return a Title for the text returned by getRootText().

#0 /srv/mediawiki/php-1.34.0-wmf.23/includes/Title.php(1896): Wikimedia\Assert\Assert::postcondition(boolean, string)
#1 /srv/mediawiki/php-1.34.0-wmf.23/extensions/Popups/includes/PopupsContext.php(161): Title->getRootTitle()
#2 /srv/mediawiki/php-1.34.0-wmf.23/extensions/Popups/includes/PopupsHooks.php(90): Popups\PopupsContext->isTitleBlacklisted(Title)
#3 /srv/mediawiki/php-1.34.0-wmf.23/includes/Hooks.php(174): Popups\PopupsHooks::onBeforePageDisplay(OutputPage, SkinVector)
#4 /srv/mediawiki/php-1.34.0-wmf.23/includes/Hooks.php(234): Hooks::callHook(string, array, array, NULL, string)
#5 /srv/mediawiki/php-1.34.0-wmf.23/includes/OutputPage.php(2571): Hooks::runWithoutAbort(string, array)
#6 /srv/mediawiki/php-1.34.0-wmf.23/includes/MediaWiki.php(899): OutputPage->output(boolean)
#7 /srv/mediawiki/php-1.34.0-wmf.23/includes/MediaWiki.php(911): Closure$MediaWiki::main()
#8 /srv/mediawiki/php-1.34.0-wmf.23/includes/MediaWiki.php(523): MediaWiki->main()
#9 /srv/mediawiki/php-1.34.0-wmf.23/index.php(44): MediaWiki->run()
#10 /srv/mediawiki/w/index.php(3): include(string)
#11 {main}

wiki: ps.wikipedia.org
exception_url: /?curid=21451

So we're talking about an invalid title here, تانبه::لرغونپوهنه which has a double colon somehow. If we remove one of them, the resulting page is valid.

Looking in the database:

MariaDB [pswiki]> select * from page where page_id = 21451\G
*************************** 1. row ***************************
           page_id: 21451
    page_namespace: 0
        page_title: تانبه::لرغونپوهنه
 page_restrictions:
  page_is_redirect: 0
       page_is_new: 1
       page_random: 0.482223427057
      page_touched: 20171226061507
page_links_updated: 20161213194521
       page_latest: 171794
          page_len: 13
page_content_model: wikitext
         page_lang: NULL
MaxSem renamed this task from Fatal exception of type "Wikimedia\Assert\PostconditionException" / "invalidtitle" error for extracts API error for title in Pashto Wikipedia to Fatal exception of type "Wikimedia\Assert\PostconditionException" (page with an invalid title on Pashto Wikipedia).Oct 23 2019, 4:13 AM
maxsem@deploy1001:~$ mwscript namespaceDupes.php --wiki=pswiki --source-pseudo-namespace='تانبه'
Checking prefix "تانبه" vs namespace 0
id=21451 ns=0 dbk=تانبه::لرغونپوهنه -> تانبه-:لرغونپوهنه (no conflict) DRY RUN ONLY

Looks good!
maxsem@deploy1001:~$ mwscript namespaceDupes.php --wiki=pswiki --source-pseudo-namespace='تانبه' --fix
Checking prefix "تانبه" vs namespace 0
id=21451 ns=0 dbk=تانبه::لرغونپوهنه -> تانبه-:لرغونپوهنه (no conflict)

Looks good!

The initial cause is resolved, here's the salvaged page. Note that it's in the main namespace, so you should probably move it elsewhere or delete it.

What needs further investigation is how this page was created and what should we do to prevent crashes on invalid titles, so I'm not closing this ticket yet.

Umherirrender subscribed.

I cannot read that language and working with right-to-left words is hard for me, but it looks like the extra namespace in pswiki.

I would assume that the page was created before the extra namespace was created and than the namespaceDupes.php was not running

	'pswiki' => [
		100 => 'تانبه',
		101 => 'د_تانبې_خبرې_اترې', // T119510
	],

I would suggest to have a full dry run of the maintenance script to look for other issues with the namespaces and than close the bug.

jforrester@mwmaint1002:/srv/mediawiki-staging$ mwscript namespaceDupes.php --wiki=pswiki
0 pages to fix, 0 were resolvable.

pagelinks from=17897 ns=0 dbk=ځانگړی:ونډې/103.5.172.134 *** INVALID
1 links to fix, 0 were resolvable.

Looks good!

That's Special:Contributions, linked to from… https://ps.wikipedia.org/wiki/%D8%A8%D9%84%D8%BA%D8%A7%D8%B1%DB%8C%D8%A7?oldid=17897 a 2007 version of the article about Bulgaria The page the IP wrote in 2013 https://ps.wikipedia.org/wiki/%D8%A8%D8%A7%D8%AF%D8%A7%D9%85_%D8%B8%D8%B1%DB%8C%D9%81%D9%8A_%D9%81%D9%82%DB%8C%D8%B1 but purging doesn't fix it?

Jdforrester-WMF assigned this task to MaxSem.

I think that's just the script being screwy. All looks good.