Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntlException: Constructor failed #474

Closed
Dianliang233 opened this issue Jun 3, 2022 · 4 comments
Closed

IntlException: Constructor failed #474

Dianliang233 opened this issue Jun 3, 2022 · 4 comments
Labels
wontfix This will not be worked on

Comments

@Dianliang233
Copy link

Describe the Bug

I keep getting this error after I upgraded the skin. I have tried the following troubleshooting steps:

  • Revert to PHP 7
  • Upgrade to PHP 8.1
  • Upgrade to MW 1.38
  • Revert to MW 1.37
  • Checked my date.timezone config and made sure it's UTC so no invaild TZ

One thing worth noting is that an older version (1.10.0) of the skin is stilling working fine on my install. I haven't tested out which exact version introduced this but main branch, 1.17.5 and 1.17.4 all throws out this error.

Steps to reproduce the behavior:

  1. Install the latest version of the skin
  2. See error:
MediaWiki internal error.

Original exception: [19561fc8e4a5c18cc07b1e2f] /wiki/Special:%E7%89%88%E6%9C%AC IntlException: Constructor failed
Backtrace:
from /path/to/mediawiki/skins/Citizen/includes/Partials/Drawer.php(180)
#0 /path/to/mediawiki/skins/skins/Citizen/includes/Partials/Drawer.php(180): NumberFormatter->__construct()
#1 /path/to/mediawiki/skins/skins/Citizen/includes/Partials/Drawer.php(90): MediaWiki\Skins\Citizen\Partials\Drawer->getSiteStatsData()
#2 /path/to/mediawiki/skins/skins/Citizen/includes/SkinCitizen.php(124): MediaWiki\Skins\Citizen\Partials\Drawer->getDrawerTemplateData()
#3 /path/to/mediawiki/skins/includes/skins/SkinMustache.php(56): MediaWiki\Skins\Citizen\SkinCitizen->getTemplateData()
#4 /path/to/mediawiki/skins/includes/skins/SkinTemplate.php(144): SkinMustache->generateHTML()
#5 /path/to/mediawiki/skins/includes/OutputPage.php(2644): SkinTemplate->outputPage()
#6 /path/to/mediawiki/skins/includes/MediaWiki.php(944): OutputPage->output()
#7 /path/to/mediawiki/skins/includes/MediaWiki.php(957): MediaWiki::{closure}()
#8 /path/to/mediawiki/skins/includes/MediaWiki.php(564): MediaWiki->main()
#9 /path/to/mediawiki/skins/index.php(53): MediaWiki->run()
#10 /path/to/mediawiki/skins/index.php(46): wfIndexMain()
#11 {main}

Exception caught inside exception handler: [19561fc8e4a5c18cc07b1e2f] /wiki/Special:%E7%89%88%E6%9C%AC IntlException: Constructor failed
Backtrace:
from /path/to/mediawiki/skins/Citizen/includes/Partials/Drawer.php(180)
#0 /path/to/mediawiki/skins/skins/Citizen/includes/Partials/Drawer.php(180): NumberFormatter->__construct()
#1 /path/to/mediawiki/skins/skins/Citizen/includes/Partials/Drawer.php(90): MediaWiki\Skins\Citizen\Partials\Drawer->getSiteStatsData()
#2 /path/to/mediawiki/skins/skins/Citizen/includes/SkinCitizen.php(124): MediaWiki\Skins\Citizen\Partials\Drawer->getDrawerTemplateData()
#3 /path/to/mediawiki/skins/includes/skins/SkinMustache.php(56): MediaWiki\Skins\Citizen\SkinCitizen->getTemplateData()
#4 /path/to/mediawiki/skins/includes/skins/SkinTemplate.php(144): SkinMustache->generateHTML()
#5 /path/to/mediawiki/skins/includes/OutputPage.php(2644): SkinTemplate->outputPage()
#6 /path/to/mediawiki/includes/exception/MWExceptionRenderer.php(158): OutputPage->output()
#7 /path/to/mediawiki/includes/exception/MWExceptionRenderer.php(77): MWExceptionRenderer::reportHTML()
#8 /path/to/mediawiki/includes/exception/MWExceptionHandler.php(107): MWExceptionRenderer::output()
#9 /path/to/mediawiki/includes/exception/MWExceptionHandler.php(202): MWExceptionHandler::report()
#10 /path/to/mediawiki/includes/MediaWiki.php(583): MWExceptionHandler::handleException()
#11 /path/to/mediawiki/index.php(53): MediaWiki->run()
#12 /path/to/mediawiki/index.php(46): wfIndexMain()
#13 {main}

System

Please complete the following information:

  • MediaWiki version [e.g. v1.33.1] v1.38
  • Server OS: [e.g. Debian 10] CentOS 7.9.2009
  • PHP version [e.g. v7.2.19-0ubuntu0.18.04.2] 8.0.17 (fpm-fcgi)
@Dianliang233 Dianliang233 added the bug Something isn't working label Jun 3, 2022
@alistair3149
Copy link
Member

Have you installed php-intl and ICU? If yes, what versions are they on?

@lakejason0
Copy link

lakejason0 commented Jun 14, 2022

I'm also experiencing this, and it's like

intl

Internationalization support enabled
ICU version 50.2
ICU Data version 50.2
ICU TZData version 2018e
ICU Unicode version 6.2
I'm on 7.4.25 (fpm-fcgi) tho

@Rushster
Copy link

Same problem here. On php 7.4.29 and php-intl and ICU is installed.

@alistair3149 alistair3149 added the help wanted Extra attention is needed label Jun 14, 2022
alistair3149 added a commit that referenced this issue Jun 14, 2022
…tats

Add the ability to disable numberformatter independently from sitestats
Due to an upstream issue, numberforrmatter can throw an exception in some
instances (#474). This will help to mitigate the issue.
@alistair3149
Copy link
Member

It is an upstream issue with the ICU installation, not much I can do on my end.
However, I added a config $wgCitizenUseNumberFormatter in which you can disable numberformatter without disabling site statistics. Setting that to false will fix your issue.

@alistair3149 alistair3149 added wontfix This will not be worked on and removed bug Something isn't working help wanted Extra attention is needed labels Jun 14, 2022
@alistair3149 alistair3149 pinned this issue Aug 24, 2023
alistair3149 added a commit that referenced this issue Aug 24, 2023
This should at least avoid Citizen throwing an exception.
However, it won't address the root cause of the issue.

Closes #474
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants