Ask your Symfony questions! Pay money and get answers fast! (more info)

Why is 'symfony cc' erasing needed cache files? Symfony


Symfony 1.4 using Propel.

This is a site where we are trying to create all of the forms using the generator, with calls like this:

./symfony propel:generate-admin --theme="roboo" --module="deal" frontend Deal

My site is now completely non-functional. One mistake that we made this morning is that someone committed the cache folder to Subversion. So I:

sudo su
# I am now root
mkdir /home/fix_subversion_problems
cd /home/fix_subversion_problems
svn export .

Then I cd'ed back to the directory where we are working and I did "svn delete" and "svn commit". Then I did "cp -r" to move the cache folder from the clean export back to the directory where we have somethings under Subversion control. So we have the cache folder back, and it is not under Subversion control.

Then I point my browser at the site and I get a blank white screen. So I do:

tail /etc/httpd/logs/error_log-20121014

And I see:

[Tue Nov 06 20:01:08 2012] [error] [client] PHP Warning: require(/home/roboo/cache/frontend/prod/config/config_config_handlers.yml.php): failed to open stream: No such file or directory in /home/roboo/lib/vendor/symfony/lib/config/sfConfigCache.class.php on line 279
[Tue Nov 06 20:01:08 2012] [error] [client] PHP Fatal error: require(): Failed opening required '/home/roboo/cache/frontend/prod/config/config_config_handlers.yml.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/roboo/lib/vendor/symfony/lib/config/sfConfigCache.class.php on line 279

It appears that /home/roboo/cache/frontend/prod/config/ was not copied over for some reason. See the attached screenshot.

I copy all of these files over. I now get a new error:

[Tue Nov 06 20:02:47 2012] [error] [client] PHP Fatal error: require(): Failed opening required '/home/roboo/cache/frontend/prod/config/modules_homepage_config_security.yml.php' (include_path='/home/roboo:/home/roboo/plugins/sfPropelORMPlugin/lib/vendor/phing:/home/roboo/plugins/sfPropelORMPlugin/lib/vendor/propel:/home/roboo/plugins/sfPropelORMPlugin/lib/vendor/phing/../:/home/roboo/plugins/sfPropelORMPlugin/lib/vendor/phing/classes:.:/usr/share/pear:/usr/share/php') in /home/roboo/cache/frontend/prod/config/config_core_compile.yml.php on line 265

I can not find this file, modules_homepage_config_security.yml.php, anywhere. From the top of the project I do:

find . -name *modules_homepage_config_security*

This gets me nothing. Nor can I find it in previous revisions in Subversion.

One other thing, if I do "symfony cc" it erases all of the files in cache/frontend/prod/config/ . And then I get errors about how these files are missing. If Symfony erases these files, then shouldn't Symfony also create these files?

Answers (2)


Ben answers:

try from the root of your project:
sudo chmod 777 cache log -R

Just in case you accidentally changed the ownership of the files by using sudo to copy them.


Milena Dimitrova answers:

The cache directory should never be committed to svn - it must be ignored.
You can physically delete the content of the cache folder as well:
rm -r -f cache/
then update from svn and make sure it is still empty.
Also, please note that you should not use autogenerated partials or components from one module into another,