500 ISE after changing locale

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
Doobie Brother
Posts: 13
Joined: Sun Jun 21, 2020 12:24 pm

500 ISE after changing locale

Post 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.
Doobie Brother
Posts: 13
Joined: Sun Jun 21, 2020 12:24 pm

Re: 500 ISE after changing locale

Post 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.
Doobie Brother
Posts: 13
Joined: Sun Jun 21, 2020 12:24 pm

Re: 500 ISE after changing locale

Post 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: ''
Ralphred
Posts: 32
Joined: Fri Jul 08, 2022 12:23 pm

Re: 500 ISE after changing locale

Post by Ralphred »

Try using en-GB for intl.default_locale.
Doobie Brother
Posts: 13
Joined: Sun Jun 21, 2020 12:24 pm

Re: 500 ISE after changing locale

Post by Doobie Brother »

Yes, the time is a lot more readable now and it doesn't cause a 500 ISE.
Post Reply