alcor Posted July 7, 2023 Share Posted July 7, 2023 (edited) Hello guys, I would love to know if someone experienced the same thing before and how I can fix. Two things that maybe are connected or not that we are looking in the last days and cant find an answer, no new module, no new technical changes. 1/ Every morning (not connected to a known cronjob so far we checked) around 6am, the products images are "broken". We need to run manually at Traffic & SEO > SEO & URLs > Friendly URL and turn off and on again then voilà, all restored again. 2/ Sometimes we see this error after cleaning the cache: Quote Oops... looks like an unexpected error occurred. An exception has been thrown during the rendering of a template ("RecursiveDirectoryIterator::__construct(/var/www/vhosts/xxx.net/httpdocs/var/cache/prod/smarty/compile/do_flatsome/d1): failed to open dir: Permission denied"). [Twig\Error\RuntimeError 0] Then we noticed that the permissions of var/cache/prod/smarty/ goes to 771 instead 755. Ownership is the same, no changes. Any hint of what's going on and what we can do to fix? Thanks in advance! Edited July 7, 2023 by alcor Forgot to say thanks in advance! :) (see edit history) Link to comment Share on other sites More sharing options...
ComGrafPL Posted July 10, 2023 Share Posted July 10, 2023 Whats the Presta version? Are you getting other issues? Link to comment Share on other sites More sharing options...
alcor Posted July 10, 2023 Author Share Posted July 10, 2023 13 minutes ago, ComGrafPL said: Whats the Presta version? Are you getting other issues? Advanced Parameters > Information PrestaShop version: 1.7.8.9 Server information: Linux #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 Server software version: Apache PHP version: 7.4.33 Detail I've noticed again now (which I change every day) Required parameters: Please fix the following error(s) Set write permissions for the "cache" folder. Set write permissions for the "img" folder and subfolders. Ah I've tried to migrate to another new server and it was even worse, there was not even time to wait until next morning to see the error - that happened of course again today 6h36am. In the new server there was a lot of "override" errors, all the time error 500 pages etc and a came back to the old/current server redirecting the DNS. At least this error keeps the store operational. Link to comment Share on other sites More sharing options...
ComGrafPL Posted July 10, 2023 Share Posted July 10, 2023 Could be this: https://github.com/PrestaShop/PrestaShop/issues/10998 Link to comment Share on other sites More sharing options...
alcor Posted July 10, 2023 Author Share Posted July 10, 2023 31 minutes ago, ComGrafPL said: Could be this: https://github.com/PrestaShop/PrestaShop/issues/10998 Thanks, I've checked! My var/cache/prod/appParameters.php is 0644 (so is normal) /httpdocs/var/cache/prod/smarty (and subfolders) is 0771 (changed somehow again) I found the opcache settings and changed from: opcache.revalidate_freq=2 opcache.validate_timestamps=1 to opcache.revalidate_freq = 0 (the only change needed) opcache.validate_timestamps = 1 opcache.fast_shutdown is not present in my config and looks like it was removed from this version...so lets'stay like this. Now I will try to fix the var/cache permissions again and I believe we have to wait until tomorrow morning Sure I will let you all know if it was fixed. Link to comment Share on other sites More sharing options...
alcor Posted July 10, 2023 Author Share Posted July 10, 2023 (edited) 1 hour ago, ComGrafPL said: Could be this: https://github.com/PrestaShop/PrestaShop/issues/10998 Ops, something is wrong. I've changed in the PHP settings on Plesk, then in /opt/plesk/php/7.4/etc/php.d/10-opcache.ini and the PHP info still shows opcache.revalidate_freq=2 Did I missed something? Edited July 10, 2023 by alcor (see edit history) Link to comment Share on other sites More sharing options...
alcor Posted July 10, 2023 Author Share Posted July 10, 2023 There was a lot of bad folder permissions and owner as "root"... all fixed. Link to comment Share on other sites More sharing options...
alcor Posted July 10, 2023 Author Share Posted July 10, 2023 45 minutes later... Link to comment Share on other sites More sharing options...
s4lvozesta Posted July 11, 2023 Share Posted July 11, 2023 could it be that new file is created as root in var/cache folder? try giving it 'static' group and user, e.g. (do not copy and paste this command, it is just example) chmod g+s /var/www/html to make sure every newly created file/folder under it is having the same group. Try also with 'static user'. After changing ini file, I cant remind myself enough to restart web server (e.g. apache/nginx) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now