Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Uncaught Zend_Locale_Exception


Go to End


4 Posts   1954 Views

Avatar
Dorsai

Community Member, 12 Posts

5 March 2015 at 11:55am

Hi,

I am getting the following error in a clean install when trying to access Admin and was wondering if anyone has encountered the same issue? And possibly how they fixed it.

[User Error] Uncaught Zend_Locale_Exception: failed to receive data from locale en_GB
GET /admin/pages

Line 1139 in /home/webspace/[site]/www/htdocs/framework/thirdparty/Zend/Locale/Format.php
Source

1130 * @param string|Zend_Locale $locale OPTIONAL Locale of $number, possibly in string form (e.g. 'de_AT')
1131 * @return string format
1132 * @throws Zend_Locale_Exception throws an exception when locale data is broken
1133 */
1134 public static function getDateFormat($locale = null)
1135 {
1136 $format = Zend_Locale_Data::getContent($locale, 'date');
1137 if (empty($format)) {
1138 require_once 'Zend/Locale/Exception.php';
1139 throw new Zend_Locale_Exception("failed to receive data from locale $locale");
1140 }
1141
1142 return $format;
1143 }
1144
1145 /**

Trace

Zend_Locale_Format::getDateFormat(en_GB)
Member.php:1113
Member->getDateFormat()
ViewableData.php:108
ViewableData->__get(DateFormat)
LeftAndMain.php:214
LeftAndMain->init()
CMSMain.php:65
CMSMain->init()
Controller.php:139
Controller->handleRequest(SS_HTTPRequest,DataModel)
LeftAndMain.php:443
LeftAndMain->handleRequest(SS_HTTPRequest,DataModel)
AdminRootController.php:93
AdminRootController->handleRequest(SS_HTTPRequest,DataModel)
Director.php:370
Director::handleRequest(SS_HTTPRequest,Session,DataModel)
Director.php:153
Director::direct(/admin/pages,DataModel)
main.php:177

Avatar
Adrexia

Moderator, 4 Posts

12 October 2015 at 10:50pm

I'm unsure exactly what causes this - I get it randomly every few months. I found it can be fixed by adding a silverstripe-cache directory to the project root.

Avatar
ntd

Community Member, 9 Posts

11 October 2016 at 12:35am

Edited: 11/10/2016 12:35am

Today I got this very same error. Flushing the cache did not solve the problem but manually removing the whole cache directory did:

rm -fr /tmp/silverstripe-cache-php5.6.26-0+deb8u1-var-www-www.whatev.er/

My guess is Zend_Locale directly uses Zend_Cache (see e.g. Zend_Locale_Data::getContent) and not the SilverStripe wrapper, hence it is not flushed by ?flush. If that cache is for some reason invalid, you end up locked.

I recently updated PHP (that in turn changes the cache path), so I suspect that is the reason that triggered this error.

Avatar
ntd

Community Member, 9 Posts

17 October 2016 at 5:05am

Ok, this problem seems to be triggered by a couple of bug in PHP. I filed a workaround for SilverStripe in issue 6174.