Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache:clear doesn't work #19

Open
gnutix opened this issue Aug 21, 2013 · 15 comments
Open

Cache:clear doesn't work #19

gnutix opened this issue Aug 21, 2013 · 15 comments
Labels

Comments

@gnutix
Copy link

gnutix commented Aug 21, 2013

I'm having issues executing the cache:clear command with this bundle.

On my server :

Clearing the cache for the prod environment with debug true

  [Symfony\Component\Filesystem\Exception\IOException]                                                  
  Failed to remove directory /var/www/sites/my-website/app/cache/prod_old/sessions

Is it about webserver's user rights ?

In local :

[error] Internal Server Error

And here is what I find in the logs for the local error :

[2013-08-21 11:51:53] request.CRITICAL: Exception thrown when handling an exception (Symfony\Component\Debug\Exception\ContextErrorException: Warning: file_put_contents(/var/www/sites/my-website/app/cache/dev/annotations/Symfony-Bundle-TwigBundle-Controller-ExceptionController.cache.php): failed to open stream: No such file or directory in /var/www/sites/my-website/vendor/doctrine/common/lib/Doctrine/Common/Annotations/FileCacheReader.php line 186) {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\ContextErrorException: Warning: file_put_contents(/var/www/sites/my-website/app/cache/dev/annotations/My-Bundle-Entity-MyEntityTranslation.cache.php): failed to open stream: No such file or directory in /var/www/sites/my-website/vendor/doctrine/common/lib/Doctrine/Common/Annotations/FileCacheReader.php line 186 at /var/www/sites/my-website/vendor/doctrine/common/lib/Doctrine/Common/Annotations/FileCacheReader.php:186)"}

Both commands work well from the command line.
I'm using Symfony 2.3.3 and CoreSphereConsoleBundle 0.1.0.

@gnutix
Copy link
Author

gnutix commented Sep 4, 2013

Any help would be welcomed !

@laszlokorte
Copy link
Member

Hey, sorry for the late response.

Are you able to run the command via the real command line (ssh)? I suppose it is a permission problem.

@gnutix
Copy link
Author

gnutix commented Sep 4, 2013

I can execute the command in the command line. But the user for the app/cache/* folders is not the same as the one I'm connected with (and that may indeed be the issue).

I'll try to ask the server admin guys about it.

@jokey2k
Copy link
Member

jokey2k commented Oct 6, 2013

Assuming this is solved by now on the server you are using? I cannot reproduce it here.

@gnutix
Copy link
Author

gnutix commented Oct 7, 2013

I'm not yet fixed about it, as the IT service is really... slow to interact with us (development). But I'll open the issue again if I'm in the need.

@gnutix gnutix closed this as completed Oct 7, 2013
@umens
Copy link

umens commented Dec 3, 2013

hi ! i had the same issue. command with ssh works fine ( with root user ) but it doesn't work with the bundle but everything else works fine. any idea ?

@laszlokorte
Copy link
Member

Have you giving chmod 777 permissions to the /app/cache/ and all it's (just for diagnosis reasons)?

It could be that if you have run cache:warmup via ssh the folders and files are created without write access for the user the webserver is running as. This would lead to the webserver not being able to modify the files afterwards.

@umens
Copy link

umens commented Dec 3, 2013

i gave chmod 777 permissions to the /app/cache/ and /app/log/ . I had never
user the command cache:warmup ( is that a problem ? )
the weird thing is that le command erase almost entierly the cache folder
but it remain one file.
And i got this error on firebug. this is the file that remain.

image

@laszlokorte
Copy link
Member

Could you try to create the app/cache/dev/annotations folder yourself?
I could be that the error is not in this bundle but in the doctrine annotations.

@laszlokorte
Copy link
Member

I the error occurred due to the --no-warmup flag which was automatically added to the cache:clear command when executed via web console. I forced this flag to prevent namespacing errors in earlier symfony versions but it seems to not necessary anymore.

Could you please try the current master branch?

@umens
Copy link

umens commented Dec 8, 2013

i updated to the current master and i got this error

image

i got a new directory in the cache folder : " de_ "
the only folder which the update time change is profiler/ all the other don't change or are deleting.

by the way "cache:clear --no-optional-warmers" is working partially. (delete some folder but not all).

(sorry for my poor english :) and i really appreciate your help )

@maximevenin
Copy link

Same problem here:

  [Symfony\Component\Filesystem\Exception\IOException]                                                  
  Failed to remove directory /var/www/sites/my-website/app/cache/dev_old/sessions

The "sessions" folder has 755 rights, and the right owner. If I delete it manually and run "cache:clear --no-warmup" it is created again and I get the same error. However, for production mode it works fine.

My config:
coresphere/console-bundle dev-master 8666165
symfony/symfony v2.3.9
hosted on a Gandi Simple Hosting instance.

Hope this can help.

@laszlokorte
Copy link
Member

Are you logged in during using the console? Could you try clearing the cache while being logged out?

@laszlokorte laszlokorte reopened this Jan 6, 2014
@maximevenin
Copy link

I was indeed logged in but logging out didn't change anything. The sessions folder is empty btw.

@TomasVotruba
Copy link
Contributor

Try running it like this: cache:clear --no-warmup

This works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants