Page 1 of 1

500 ISE after changing locale

Posted: Sun Aug 28, 2022 8:59 am
by Doobie Brother
If I set the locale in the preferences to en_GB the Zoneminder web interface becomes unusable and is throwing a 500 Internal Server Error [my wording of this is a bit vague because I can't get in any more to see exactly what field I changed :-D ].

This is logged:

Code: Select all

[Sun Aug 28 09:42:06.554996 2022] [php7:error] [pid 4050264] [client 2001:8b0:xxxx:42430] PHP Fatal error:  Uncaught IntlException: datefmt_create: no such time zone: '': U_ILLEGAL_ARGUMENT_ERROR in /usr/share/zoneminder/www/includes/config.php:150\nStack trace:\n#0 /usr/share/zoneminder/www/includes/config.php(150): IntlDateFormatter->__construct()\n#1 /usr/share/zoneminder/www/index.php(46): require_once('/usr/share/zone...')\n#2 {main}\n  thrown in /usr/share/zoneminder/www/includes/config.php on line 150
1.36.24 from Debian packages.
PHP 7.4.6

I am going to have a poke about in the DB and try to revert this and see I can recreate the issue.

Re: 500 ISE after changing locale

Posted: Sun Aug 28, 2022 9:14 am
by Doobie Brother

Code: Select all

mysql> select ID,Name,Value from Config;

...
|   3 | ZM_LANG_DEFAULT                  | en_gb                                                                         |
| 100 | ZM_LD_PRELOAD                    |                                                                               |
|   4 | ZM_LOCALE_DEFAULT                | 162                                                                           |
...
First attempt:

Code: Select all

mysql> UPDATE Config SET Value = '' WHERE ID = 3;
Query OK, 1 row affected (0.02 sec)
Rows matched: 1  Changed: 1  Warnings: 0
Did nothing.

Code: Select all


mysql> UPDATE Config SET Value = '' WHERE ID = 4;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0
Fixed it.

At this point, LANG_DEFAULT is ba_ba in the web interface. Changed to en_gb, fine. Change LOCALE_DEFAULT to en_GB, broken. I noticed that the value for this is '162' rather than 'en_GB', so I tried manually setting it to the latter, but it still errors out.

Re: 500 ISE after changing locale

Posted: Sun Aug 28, 2022 9:30 am
by Doobie Brother
I see a reference to php-intl here:
viewtopic.php?p=127224&sid=fdcf1cd3b433 ... 16#p127224
which is loaded, according to phpinfo();
This also says that intl.default_locale is unset so I assume that corresponds with datefmt_create: no such time zone: ''

Re: 500 ISE after changing locale

Posted: Sun Aug 28, 2022 9:37 am
by Ralphred
Try using en-GB for intl.default_locale.

Re: 500 ISE after changing locale

Posted: Sun Aug 28, 2022 7:16 pm
by Doobie Brother
Yes, the time is a lot more readable now and it doesn't cause a 500 ISE.