Jump to content

Topic on Project:Support desk/Flow

Some special pages not working anymore after upgrade

7
Summary by Till Kraemer

PCRE_CONFIG_NEWLINE was set to -1 (ANY). Setting it to -2 (ANYCRLF) fixed the problem.

Till Kraemer (talkcontribs)

Hello, I upgraded to MediaWiki 1.37.0 and now on some of my wikis some of the special pages are not working anymore, for example Special:Search shows the following message: "There is currently no text in this page. You can search for this page title in other pages, search the related logs, or create this page."

Also, some Wikibase items show wikitext after the update. It's pretty weird.

On another wiki, some articles were empty when I clicked them. I fixed that with php maintenance/cleanupTitles.php but I have no idea how to fix the broken special pages.

Any help is very much appreciated!

Thanks and cheers,

Till

Bawolff (talkcontribs)

That is very weird. Do you have a link to your wiki if public?

The only thing i can think of, is sometimes misconfigured short urls can cause something sort of like that.

Till Kraemer (talkcontribs)

@Bawolff, thank you very much for your reply! My Nginx config file indeed looks a little outdated but unfortunately, changing it didn't fix the problem.

The wikis are public but NSFW (at least for people not working in the adult industry :) If that doesn't scare you, here are the links :)

Special pages that don't work: Special:LinkSearch, Special:Search, Special:MIMESearch and Special:FileDuplicateSearch. So basically everything search-related is screwed up (no pun intended :) However, while this doesn't work, removing the &title=বিশেষ%3Aঅনুসন্ধান part of the URL shows the search results properly.

On another wiki, only Special:WhatLinksHere doesn't work.

Any idea what could be at play here? Could this still be a misconfiguration issue?

Thanks and cheers,

Till

Bawolff (talkcontribs)

Wow that's weird.

It seems to have something to do with unicode. It seems only to effect pages that have unicode characters that aren't in latin1.

The really weird part is that even if the special char is not part of the namespace, it still makes mediawiki confused thinking its main namespace. E.g. compare https://pl.pornopedia.com/wiki/Specjalna:Linkuj%C4%85ce vs https://pl.pornopedia.com/wiki/Specjalna:foo

it also affects other namespace detection - https://pl.pornopedia.com/wiki/Talk:A gets redirected to localized version of talk but https://pl.pornopedia.com/wiki/Talk:%C4%85 does not.

This is a bit of a stab in the dark, but perhaps if php was compiled against a version of PCRE library that had unicode support disabled.


Could you enable logging all php warnings (see manual:how to debug), and if that doesn't show anything maybe mediawiki debug logs to. Look especially for errors that mention preg_match, preg_replace or unicode (but also just anything out of the ordinary that shows up)

Till Kraemer (talkcontribs)

@Bawolff, thank you for your help! And yes, you're right, other special pages are also affected on the Polish wiki; sorry, I didn't notice that before. I don't really understand though why ą doesn't work but ł in Specjalna:Zasady_haseł does work.

Oh, yeah, the namespace confusion in your example is pretty weird and I don't know why the talk page of ą gets forwarded to Ä. "Close enough!" ;)

Another OpenBSD user also seems to experience an issue with the ą. I tested it and <?php var_dump(preg_match('/^.{5,64}$/', 'daswązdas')); also returns int(0) for me while <?php var_dump(preg_match('/^.{5,64}$/', 'daswęzdas')); returns int(1).


The PCRE section of phpinfo() looks like this:

PCRE (Perl Compatible Regular Expressions) Supportenabled
PCRE Library Version10.37 2021-05-26
PCRE Unicode Version13.0.0
PCRE JIT Supportnot compiled in
DirectiveLocal ValueMaster Value
pcre.backtrack_limit10000001000000
pcre.recursion_limit100000100000


PHP warnings are enabled but I didn't find anything in the logs.

I just upgraded from PHP 7.4.27 to PHP 7.4.28 but unfortunately, it didn't fix the problem.

I think I just wait for MediaWiki to be compatible with PHP 8 and see if that will solve the issue.

Thank you again for your kind help!

Cheers,

Till

Bawolff (talkcontribs)

That thread was helpful.


I think what is happening is that pcre is being compiled with PCRE_CONFIG_NEWLINE set to -1, and mediawiki is not compatible with that. This config option causes the iso 8859 control character NEL - 0x85 to be interpreted as a line ending character, which messes things up for unicode characters that have a utf-8 representation containing 0x85 in it which includes ą.

At this point mediawiki is pretty reliant on pcre not having that compile time option enabled, so i think the only fix is to recompile pcre.


I filed a bug about detecting this during installer: https://phabricator.wikimedia.org/T303560

Till Kraemer (talkcontribs)

@Bawolff, Awesome! :) I just changed --enable-newline-is-any to --enable-newline-is-anycrlf in /usr/ports/devel/pcre2/Makefile and installed pcre2. Now it works! :) Thank you so much!

Another little issue occurred when I searched on the Bengali wiki. It said: "Precondition failed: This Title instance does not represent a proper page, but merely a link target." php maintenance/cleanupTitles.php fixed it though! :)

Cheers,

Till