Clear the Cache Plugin

I think we all agree it is not too user friendly with all the clear cache requirements just to install a new plugin, or get Mautic back on track. So we wrote a plugin to add that to the settings menu. You can get it here: https://automauticly.com/automauticly-clear-cache-plugin/

3 Likes

How can I make use of this plugin with a 500 error. I cleared the cache via documentaion, but my app/cache folder won’t regenerate. Can I find a fresh cache folder somewhere, and then install your plugin? I tried to get it from github but the cache isn’t in the source code?

Hi Nicholas,
Make sure your permissions and owners on both the plugin folder and the cache folder are set correctly. On my websites that is the owner is www-data:www-data

This is very useful.

Is it also compatible with Mautic v3.0.0?

1 Like

@healthstatus1 appears you dont support Gautit Cache + Clearout plugins anymore. I purchased the plugin (clearout) but you or your support Email hasnt been responsive… I have sent tons emails — & no responses!

Your cachre plugin isnt compatible with mautic3, Likewise Clearout.

I just hope all is well with you.

I can verify that Gautit Cache Clear plugin does not work on 3.3.3 - Seems like either a permissions issue or missing directory (at least from the error message it provides).

Could you provide the error so that we can maybe find a fix?

Hi Michael,
Last email I am showing from you is from December 30 and we responded on Jan 2.

Sorry we are not connecting, I will check and see what is going on with email.

I will send link to most current clean email plugin to the email address I have for you on account.

Greg

We are checking on this…

Make sure your initial permissions on the cache directory are set correctly and should be the user and group that the web server is running under. If that is the case, then the plugin should clear the cache without issue.

OK - so I added the ClearCache plugin back to my mautic instance (3.3.3). Cleared cache manually, etc. And the plugin button appears. But when I click the ‘clear cache’ button it tells me there is an error with either mission directory or permissons error.

Looking in the Mautic error log, I can see this:

[2021-07-29 14:19:53] mautic.WARNING: PHP Warning - unlink(/var/www/html/app/../var/cache/prod/translations/catalogue.pl.gUfYNxr.php.meta): Permission denied - in file /var/www/html/plugins/GautitClearCacheBundle/Controller/DefaultController.php - at line 66 {"dir":"/var/www/html/app/../var/cache/prod/translations","objects":[ ....

(it goes on from here for some time and for each file/folder it tried to delete)

I am including some screenshots of the command line, so you can see that the permissons on the ClearCache Plugin match the existing plugins:

However, it seems to me that the plugin is having difficulty accessing the folders that it is trying to delete. Perhaps the issue is not with permissions on the actual ClearCache plugin.

The same behavior occurred when I changed the owner and group of the ClearCache plugin to ‘root’. I don’t know enough about working in Ubuntu to know if this would make a difference, but I just thought I’d try it and add it here for some extra info.

You are causing lots of issues for yourself by executing things as root. This is evident from the screenshot you shared with some folders being owned by root still.

It is extremely ill advised to run anything as root, let alone installing plugins into a webserver directory.

My advice would be to learn to operate using the www-data user (su - www-data -s /bin/bash). It will be far harder to mess up the perms of stuff when the right user is extracting files.

I’m not an expert on Mautic file perms so obviously I can’t comment, but changing ownership recursively on the cache directory to allow www-data user and group to read and write is a shotgun approach but should work

Thanks - I noticed that, as well, when I was investigating permissions. It looks like I should probably be logged in as www-data when installing these plugins (or at least changing to that owner using the code you helpfully provided).

Thanks, again, @nsomaru. I’ll probably pass on working with this plugin anymore as I’m confident of how to do it from the command line, now.

Just to note, chown is used to handle permissions. That’s been covered ad nauseum elsewhere.

The code I gave will drop you into a user shell for the www-data user. Any operations operating on files should typically be performed by this user to ensure you don’t wreck permissions by using a root shell. That way you would find permissions errors to be few and far between (for any plug-in or modifications you make).

2 Likes

Hey there went to you new site to download the clear cache plugin and the download is frozen