Instance broken after clearing cache the wrong way. Reset permissions and owner does not help (yet)

Your server is running with www-data right ? Then if you change everything to www-data there should spinn up the instance if everything is installed.

Can you set debug key to true in app/config/local.php, Then check the server logs. Also what message does it show in the browser?

the last error message in var/logs/ (given the time stamp, I think it was before I change debug key to true)

[2022-11-11 22:29:26] mautic.NOTICE: PHP Notice - SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php/sessions) failed: Permission denied (13) - in file /var/www/html/mautic/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php - at line 106 {"maxlifetime":1440} {"hostname":"vps","pid":1249}

nginx is running as www-data (checked it once above). changed all to www-data (user and group). problem remains.

changed debug key to true in local.php. clear browser caches. reload browsers. problem remains.

waited for some minutes, the var/logs/ file does not show more errors.

on the browser, it says

This page isn’t working redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS

I do not think this issue with mautic, but with nginx configuration. Can you share your nginx config (you can do it via PM to not expose any sensitive data).

What happens if you try visit mautic in incognito mdoe?

sure. I’m sending you now.

but it was working fine before I used this command sudo rm -rf var/cache/* . Plus I have another instance running on another virtual machine using the same configuration.

What if you try to replace entire var folder from repo here (everything under var - of course you first backup existing folder on the server):

Since you said it worked before. I would also backup entire source directory (mautic) and try to clone appropriate version from GH (you will have to copy app/config/local.php from previous folder to make app aware of already installed database etc.).

I downloaded var from github, replaced the current var directory with the download, changed permissons, owner and group. still not working.

for the 2nd suggestion, I understand this to be a new install, right? It is like replacement of the entire directory, just keep the local.php. I’ll do it tomorrow, but I’m pretty sure it will work (I could install mautic from scratch some times).

My lesson for now is to never clear the cache that way again :smiley:

Thank you all.

Yes, but if you just replace source and put local.php in its place you do not need to reinstall mautic.

You might also need to replace media folder.

I still don’t know what happened. But following @mzagmajster 's suggestion, I re-installed the instance.

This time I use composer recommended-project, migrate the local.php file other directories to the new installation (more details here).

Remember to add docroot to the path in the local.php.

The composer seems to make installation and maintenance easier. It is really worth learning it.

It is working like a charm now. Thank you all for your replies, which allowed me to learn tons of things about mautic.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.