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.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

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

Uncaught Zend_Cache_Exception: cache_dir must be a directory


Go to End
Reply


33 Posts   23843 Views

Avatar
xeraa

Google Summer of Code Hacker, 58 Posts

20 March 2010 at 2:42am

After transfering a project from windows (working fine) to linux, I get the following error on pages using forms (other pages are fine):

[User Error] Uncaught Zend_Cache_Exception: cache_dir must be a directory
GET /registrierung?flush=all

Line 208 in /var/www/contentaward_test/sapphire/thirdparty/Zend/Cache.php
Source

199 *
200 * Note : for perf reasons, the "load" of Zend/Cache/Exception is dynamic
201 * @param string $msg Message for the exception
202 * @throws Zend_Cache_Exception
203 */
204 public static function throwException($msg)
205 {
206 // For perfs reasons, we use this dynamic inclusion
207 require_once 'Zend/Cache/Exception.php';
208 throw new Zend_Cache_Exception($msg);
209 }
210
211 /**
212 * Normalize frontend and backend names to allow multiple words TitleCased
213 *
214 * @param string $name Name to normalize

Trace

* Zend_Cache::throwException(cache_dir must be a directory)
Line 153 of File.php
* Zend_Cache_Backend_File->setCacheDir(/tmp/,)
Line 122 of File.php
* Zend_Cache_Backend_File->__construct(Array)
Line 152 of Cache.php
* Zend_Cache::_makeBackend(File,Array,,)
Line 93 of Cache.php
* Zend_Cache::factory(Core,File,Array,Array)
Line 835 of Data.php
* Zend_Locale_Data::getContent(de_DE,date)
Line 962 of Format.php
* Zend_Locale_Format::getDateFormat(de_DE)
Line 81 of DateField.php
* DateField->__construct(Geburtsdatum,Geburtsdatum* (TT MM JJJJ))
Line 55 of RegistrierungsFormular.php
* RegistrierungsFormular_Controller->Form()
Line 367 of ViewableData.php
* ViewableData->obj(Form,,,1)
Line 443 of ViewableData.php
* ViewableData->XML_val(Form,,1)
Line 21 of .cache.var.www.contentaward_test.mysite.templates.Layout.RegistrierungsFormular.ss
* include(/var/www/contentaward_test/silverstripe-cache/.cache.var.www.contentaward_test.mysite.templates.Layout.RegistrierungsFormular.ss)
Line 377 of SSViewer.php
* SSViewer->process(RegistrierungsFormular_Controller,Zend_Cache_Frontend_Output)
Line 368 of SSViewer.php
* SSViewer->process(RegistrierungsFormular_Controller)
Line 202 of Controller.php
* Controller->handleAction(SS_HTTPRequest)
Line 134 of RequestHandler.php
* RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
* Controller->handleRequest(SS_HTTPRequest)
Line 172 of ContentController.php
* ContentController->handleRequest(SS_HTTPRequest)
Line 67 of ModelAsController.php
* ModelAsController->handleRequest(SS_HTTPRequest)
Line 283 of Director.php
* Director::handleRequest(SS_HTTPRequest,Session)
Line 127 of Director.php
* Director::direct(/registrierung)
Line 127 of main.php

/silverstripe-cache is writable (chmod 777) and being filled with manifest files.
Is

Zend_Cache_Backend_File->setCacheDir(/tmp/,)

to be expected or is there something wrong with that?

Not sure if it is related or a different matter: I use Requirements::combine_files("mainCSS.css", $cssArray); and the file is created on windows just fine, but not on linux. /assets is writable (chmod 777) as well.

Avatar
ccburns

Community Member, 74 Posts

23 March 2010 at 6:12pm

I am getting the same error. It is a completely clean install of 2.4 beta2 on a Mac. Had no problems with previous installs, but the 2nd beta is tripping me up.

Did you end up working out how to fix this problem?

[User Error] Uncaught Zend_Cache_Exception: cache_dir is not writable
GET /admin/

Line 208 in /Library/WebServer/Documents/invitro/silverstripe-2.4-beta2/sapphire/thirdparty/Zend/Cache.php

Source

199 *
200 * Note : for perf reasons, the "load" of Zend/Cache/Exception is dynamic
201 * @param string $msg Message for the exception
202 * @throws Zend_Cache_Exception
203 */
204 public static function throwException($msg)
205 {
206 // For perfs reasons, we use this dynamic inclusion
207 require_once 'Zend/Cache/Exception.php';
208 throw new Zend_Cache_Exception($msg);
209 }
210
211 /**
212 * Normalize frontend and backend names to allow multiple words TitleCased
213 *
214 * @param string $name Name to normalize
Trace

Zend_Cache::throwException(cache_dir is not writable)
Line 156 of File.php
Zend_Cache_Backend_File->setCacheDir(/var/folders/Jb/JbIke7UgFoqFYA3Qp8B2r++++TI/-Tmp-//,)
Line 122 of File.php
Zend_Cache_Backend_File->__construct(Array)
Line 152 of Cache.php
Zend_Cache::_makeBackend(File,Array,,)
Line 93 of Cache.php
Zend_Cache::factory(Core,File,Array,Array)
Line 835 of Data.php
Zend_Locale_Data::getContent(en_US,date)
Line 962 of Format.php
Zend_Locale_Format::getDateFormat(en_US)
Line 81 of DateField.php
DateField->__construct(SiteTreeFilterDate)
Line 216 of CMSMain.php
CMSMain->SiteTreeFilterDateField()
Line 367 of ViewableData.php
ViewableData->obj(SiteTreeFilterDateField,,,1)
Line 443 of ViewableData.php
ViewableData->XML_val(SiteTreeFilterDateField,,1)
Line 102 of .cache.Library.WebServer.Documents.invitro.silverstripe-2.4-beta2.cms.templates.Includes.CMSMain_left.ss
include(/Library/WebServer/Documents/invitro/silverstripe-2.4-beta2/silverstripe-cache/.cache.Library.WebServer.Documents.invitro.silverstripe-2.4-beta2.cms.templates.Includes.CMSMain_left.ss)
Line 377 of SSViewer.php
SSViewer->process(CMSMain)
Line 340 of ViewableData.php
ViewableData->renderWith(Array)
Line 473 of LeftAndMain.php
LeftAndMain->Left()
Line 367 of ViewableData.php
ViewableData->obj(Left,,,1)
Line 443 of ViewableData.php
ViewableData->XML_val(Left,,1)
Line 59 of .cache.Library.WebServer.Documents.invitro.silverstripe-2.4-beta2.cms.templates.LeftAndMain.ss
include(/Library/WebServer/Documents/invitro/silverstripe-2.4-beta2/silverstripe-cache/.cache.Library.WebServer.Documents.invitro.silverstripe-2.4-beta2.cms.templates.LeftAndMain.ss)
Line 377 of SSViewer.php
SSViewer->process(CMSMain)
Line 202 of Controller.php
Controller->handleAction(SS_HTTPRequest)
Line 134 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
Controller->handleRequest(SS_HTTPRequest)
Line 283 of Director.php
Director::handleRequest(SS_HTTPRequest,Session)
Line 127 of Director.php
Director::direct(/admin/)
Line 127 of main.php

Avatar
ccburns

Community Member, 74 Posts

23 March 2010 at 6:15pm

Actually just solved it.

I found this reference to a tmp folder

Line 156 of File.php
Zend_Cache_Backend_File->setCacheDir(/var/folders/Jb/JbIke7UgFoqFYA3Qp8B2r++++TI/-Tmp-//,)

I just went and made that folder writable to anyone with chmod -R 0777 blah

Working now.

I guess it must be the permissions set on the folder when the system tries to create the cache file???

Kind Regards,
Colin

Avatar
xeraa

Google Summer of Code Hacker, 58 Posts

1 April 2010 at 12:20pm

I still don't get it.
According to my output (Zend_Cache_Backend_File->setCacheDir(/tmp/,)) /tmp needs to be writable. But it is (as you'd expect).
Any hints what I'm doing wrong or how to change that folder?

Avatar
xeraa

Google Summer of Code Hacker, 58 Posts

2 April 2010 at 4:31am

I ended up setting the cache_dir explicitly in /sapphire/thirdparty/Zend/Cache/Backend/File.php:90 to my silverstripe-cache directory.
Not sure if this is a good idea, but at least it's working...

Avatar
x75

Community Member, 42 Posts

6 April 2010 at 4:37am

Hi,
I have the same issue with 2.4.0-rc1. 2.3.6 is runnig fine on the same Server.
Should we file a ticket on trac?

Thanks
Johannes

Avatar
xeraa

Google Summer of Code Hacker, 58 Posts

6 April 2010 at 4:51am

Thanks for your report - so it's not just me ;-).

I filed a ticket: http://open.silverstripe.org/ticket/5349

Avatar
x75

Community Member, 42 Posts

6 April 2010 at 5:19am

just in case more info is needed:

Steps that led to the error:
1. Clean install of 2.4.0-rc1
2. Try to open /admin (frontend works fine)

System:
Debian (2.6.26-2-amd64)
Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny4 with Suhosin-Patch mod_perl/2.0.4 Perl/v5.10.0
MySQL 5.0.51a-24+lenny2+spu1

Go to Top