Jump to content

Photos broken at morning and smarty issues


alcor

Recommended Posts

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 by alcor
Forgot to say thanks in advance! :) (see edit history)
Link to comment
Share on other sites

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

31 minutes ago, ComGrafPL said:

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.

Screenshot 2023-07-10 at 11.08.49.png

Link to comment
Share on other sites

  • razaro changed the title to Photos broken at morning and smarty issues

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...