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

**URL:** <https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [November 11, 2022, 2:50pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041 "2022-11-11T14:50:06Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![vincent.fr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/vincent.fr/32/6600_2.png) [@vincent.fr](https://forum.mautic.org/u/vincent.fr)\
**Post date:** [November 11, 2022, 2:50pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/1 "2022-11-11T14:50:06Z")

</div>

**Your software**  
My Mautic version is: 4.4.4, fresh install from zip file.  
My PHP version is: 7.4.30  
My Database type and version is: mysql Ver 15.1 Distrib 10.5.15-MariaDB, for debian-linux-gnu (x86\_64)  
Web sever: nginx 1.18.0

**Your problem**  
My problem is: I removed the cache as sudo user (`sudo rm -rf var/cache/*` which I should not have done). After that the mautic page is down.

It is still not working.

These errors are showing in the log:

```auto
[2022-11-11 13:02:45] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Filesystem\Exception\IOException: "Cannot rename "/tmp/UrlMatcher.phpIClvgH" to "/var/www/html/mautic/var/cache/prod/UrlMatcher.php"." at /var/www/html/mautic/vendor/symfony/filesystem/Filesystem.php line 290 {"exception":"[object] (Symfony\\Component\\Filesystem\\Exception\\IOException(code: 0): Cannot rename \"/tmp/UrlMatcher.phpIClvgH\" to \"/var/www/html/mautic/var/cache/prod/UrlMatcher.php\". at /var/www/html/mautic/vendor/symfony/filesystem/Filesystem.php:290)"} {"hostname":"vps","pid":32368}
[2022-11-11 13:02:45] mautic.NOTICE: PHP Notice - Undefined variable: inline - in file /var/www/html/mautic/offline.php - at line 77 {"inTemplate":true,"isAjax":false,"message":"The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator.","submessage":"System administrators, check server logs for errors.","inDev":false,"base":"/","root":"/var/www/html/mautic","assetPrefix":"","paths":{"themes":"themes","assets":"media","asset_prefix":"","plugins":"plugins","translations":"translations","local_config":"%kernel.root_dir%/config/local.php","root":"/var/www/html/ma","app":"app","bundles":"app/bundles","vendor":"vendor"},"assetBase":"/media"} {"hostname":"vps","pid":32368}
[2022-11-11 13:02:45] mautic.ERROR: Symfony\Component\Filesystem\Exception\IOException: Cannot rename "/tmp/UrlGenerator.phpICXWeH" to "/var/www/html/mautic/var/cache/prod/UrlGenerator.php". - in file /var/www/html/mautic/vendor/symfony/filesystem/Filesystem.php - at line 290 [] {"hostname":"vps","pid":32368}
[2022-11-11 13:34:03] 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":524}
[2022-11-11 13:54:43] 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":523}

```

Steps I have tried to fix the problem:

1. I reset the permissons and owner of the mautic directory, clear the cache following this guide [https://docs.mautic.org/en/troubleshooting/file-ownership-and-permissions](https://docs.mautic.org/en/troubleshooting/file-ownership-and-permissions). This time I perform the commands as the user of the web server. Still not working.

as www-data, I ran:

```auto
find . -type f -not -perm 644 -exec chmod 644 {} +
find . -type d -not -perm 755 -exec chmod 755 {} +
chmod -R g+w var/cache/ var/logs/ app/config/
chmod -R g+w media/files/ media/images/ translations/
rm -rf var/cache/*

```

as sudo, I ran:

sudo chown -R www-data:www-data /path/to/mautic

1. restart php, nginx and the server. it does not help.

2. I think this is related to the permisson, but don’t know what to do more than the link above.

Thank you for your support. Cheers.

---

<div class="post-metadata">

**Author:** ![ekke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ekke/32/296_2.png) [@ekke](https://forum.mautic.org/u/ekke)\
**Post date:** [November 11, 2022, 3:07pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/2 "2022-11-11T15:07:33Z")

</div>

now that your file ownership is fixed, please try  
`sudo -u www-data php /<path/to/mautic>/bin console cache:clear`

---

<div class="post-metadata">

**Author:** ![vincent.fr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/vincent.fr/32/6600_2.png) [@vincent.fr](https://forum.mautic.org/u/vincent.fr)\
**Post date:** [November 11, 2022, 3:15pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/3 "2022-11-11T15:15:01Z")

</div>

Thank you @ekke for your quick reply. I did clear the cache that way, again as you suggested. The site is still broken.

In between, I see another message coming, maybe due to one of the cronjob that I set.

```auto
[2022-11-11 14:26:09] 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":1248}

```

---

<div class="post-metadata">

**Author:** ![ekke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ekke/32/296_2.png) [@ekke](https://forum.mautic.org/u/ekke)\
**Post date:** [November 11, 2022, 4:48pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/4 "2022-11-11T16:48:59Z")

</div>

Hmm , not sure this is related, it is only a notice (affecting the cleanup) which should not break the system. I would guess it was there before your issues started.

So… are we sure your web server is running under the www-data user?

---

<div class="post-metadata">

**Author:** ![vincent.fr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/vincent.fr/32/6600_2.png) [@vincent.fr](https://forum.mautic.org/u/vincent.fr)\
**Post date:** [November 11, 2022, 5:15pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/5 "2022-11-11T17:15:19Z")

</div>

I think nginx is running under www-data

```auto
sudo ps aux| grep nginx
root 984 0.0 0.0 59164 1772 ? Ss 09:05 0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data 985 0.0 0.2 59400 5348 ? S 09:05 0:00 nginx: worker process
www-data 986 0.0 0.2 59400 5348 ? S 09:05 0:00 nginx: worker process

```

---

<div class="post-metadata">

**Author:** ![ekke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ekke/32/296_2.png) [@ekke](https://forum.mautic.org/u/ekke)\
**Post date:** [November 11, 2022, 7:05pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/6 "2022-11-11T19:05:12Z")

</div>

Ok… I keep asking the simple questions, because just deleting var/cache/\* should not cause serious issues:

- did you check the Mautic logs, too? (in /var/log)
- can you share an ls -lR /var/cache/ ?

---

<div class="post-metadata">

**Author:** ![vincent.fr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/vincent.fr/32/6600_2.png) [@vincent.fr](https://forum.mautic.org/u/vincent.fr)\
**Post date:** [November 11, 2022, 8:17pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/7 "2022-11-11T20:17:21Z")

</div>

@ekke you are right. it’s better to start with simple things.

the output you asked for are here: [nginx log error](https://pastebin.com/5whSdS6p) and [cache](https://pastebin.com/iVXD33Aa)

thank you for your time.

---

<div class="post-metadata">

**Author:** ![ekke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ekke/32/296_2.png) [@ekke](https://forum.mautic.org/u/ekke)\
**Post date:** [November 11, 2022, 8:26pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/8 "2022-11-11T20:26:08Z")

</div>

Uuuh - Cache files all owned by root!  
Try another  
rm -rf /var/cache/\*  
plus clear cache see above

---

<div class="post-metadata">

**Author:** ![vincent.fr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/vincent.fr/32/6600_2.png) [@vincent.fr](https://forum.mautic.org/u/vincent.fr)\
**Post date:** [November 11, 2022, 8:27pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/9 "2022-11-11T20:27:54Z")

</div>

I’m sorry, you asked for the /var/cache/ of the system or the /path/to/mautic/var/cache ?

---

<div class="post-metadata">

**Author:** ![ekke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ekke/32/296_2.png) [@ekke](https://forum.mautic.org/u/ekke)\
**Post date:** [November 11, 2022, 8:28pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/10 "2022-11-11T20:28:04Z")

</div>

P.S. when looking at logs don’t forget /var/log/

---

<div class="post-metadata">

**Author:** ![ekke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ekke/32/296_2.png) [@ekke](https://forum.mautic.org/u/ekke)\
**Post date:** [November 11, 2022, 8:29pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/11 "2022-11-11T20:29:03Z")

</div>

Oh, /var/cache/\* of course!!!  
Sorry 😇

---

<div class="post-metadata">

**Author:** ![vincent.fr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/vincent.fr/32/6600_2.png) [@vincent.fr](https://forum.mautic.org/u/vincent.fr)\
**Post date:** [November 11, 2022, 8:38pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/12 "2022-11-11T20:38:43Z")

</div>

here is [mautic cache](https://pastebin.com/g6L7mTrY) . the nginx error in /var/log I posted in last post. Please tell if these are the output you need. The details start to get out of my comprehension 😃

---

<div class="post-metadata">

**Author:** ![vincent.fr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/vincent.fr/32/6600_2.png) [@vincent.fr](https://forum.mautic.org/u/vincent.fr)\
**Post date:** [November 11, 2022, 8:42pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/13 "2022-11-11T20:42:38Z")

</div>

> [@ekke](#):
>
> rm -rf /var/cache/\*

after this, nothing left in /var/cache/\* to show you 😃

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [November 11, 2022, 8:55pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/14 "2022-11-11T20:55:31Z")

</div>

Try the following:

- move to /var/cache
- mkdir -p dev prod
- move to 
- php bin/console mautic:plugins:reload
- chown -R www-data:root dev
- chown -R www-data:root prod

---

<div class="post-metadata">

**Author:** ![vincent.fr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/vincent.fr/32/6600_2.png) [@vincent.fr](https://forum.mautic.org/u/vincent.fr)\
**Post date:** [November 11, 2022, 9:05pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/15 "2022-11-11T21:05:42Z")

</div>

I tried the [commands](https://pastebin.com/0HkJWeU0). open the page with different browsers. still not working.

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [November 11, 2022, 9:18pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/16 "2022-11-11T21:18:27Z")

</div>

what does the log say under var/logs?

---

<div class="post-metadata">

**Author:** ![vincent.fr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/vincent.fr/32/6600_2.png) [@vincent.fr](https://forum.mautic.org/u/vincent.fr)\
**Post date:** [November 11, 2022, 9:29pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/17 "2022-11-11T21:29:00Z")

</div>

There are three files. I show the last lines of two files here. The time stamp might not be correct. I changed the time zone end of this afternoon.

```auto
ls -l var/logs/
-rw-rw-r-- 1 www-data www-data 73692 Nov 5 23:45 mautic_prod-2022-11-05.php
-rw-rw-r-- 1 www-data www-data 60446 Nov 11 21:39 mautic_prod-2022-11-11.php
-rw-rw-r-- 1 www-data www-data 2940 Nov 11 16:32 prod-2022-11-11.php

vincent@vps:/var/www/html/mautic$ sudo tail -20 var/logs/mautic_prod-2022-11-11.php

[2022-11-11 13:02:45] mautic.ERROR: Symfony\Component\Filesystem\Exception\IOException: Cannot rename "/tmp/UrlGenerator.phpNLcuzM" to "/var/www/html/mautic/var/cache/prod/UrlGenerator.php". - in file /var/www/html/mautic/vendor/symfony/filesystem/Filesystem.php - at line 290 [] {"hostname":"vps","pid":32369}
[2022-11-11 13:02:45] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Filesystem\Exception\IOException: "Cannot rename "/tmp/UrlMatcher.phpIClvgH" to "/var/www/html/mautic/var/cache/prod/UrlMatcher.php"." at /var/www/html/mautic/vendor/symfony/filesystem/Filesystem.php line 290 {"exception":"[object] (Symfony\\Component\\Filesystem\\Exception\\IOException(code: 0): Cannot rename \"/tmp/UrlMatcher.phpIClvgH\" to \"/var/www/html/mautic/var/cache/prod/UrlMatcher.php\". at /var/www/html/mautic/vendor/symfony/filesystem/Filesystem.php:290)"} {"hostname":"vps","pid":32368}
[2022-11-11 13:02:45] mautic.NOTICE: PHP Notice - Undefined variable: inline - in file /var/www/html/mautic/offline.php - at line 77 {"inTemplate":true,"isAjax":false,"message":"The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator.","submessage":"System administrators, check server logs for errors.","inDev":false,"base":"/","root":"/var/www/html/mautic","assetPrefix":"","paths":{"themes":"themes","assets":"media","asset_prefix":"","plugins":"plugins","translations":"translations","local_config":"%kernel.root_dir%/config/local.php","root":"/var/www/html/ma","app":"app","bundles":"app/bundles","vendor":"vendor"},"assetBase":"/media"} {"hostname":"vps","pid":32368}
[2022-11-11 13:02:45] mautic.ERROR: Symfony\Component\Filesystem\Exception\IOException: Cannot rename "/tmp/UrlGenerator.phpICXWeH" to "/var/www/html/mautic/var/cache/prod/UrlGenerator.php". - in file /var/www/html/mautic/vendor/symfony/filesystem/Filesystem.php - at line 290 [] {"hostname":"vps","pid":32368}
[2022-11-11 13:34:03] 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":524}
[2022-11-11 13:54:43] 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":523}
[2022-11-11 14:26:09] 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":1248}
[2022-11-11 15:30:18] mautic.NOTICE: Symfony\Component\Filesystem\Exception\IOException: Failed to remove file "/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta": unlink(/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta): Permission denied (uncaught exception) at /var/www/html/mautic/vendor/symfony/filesystem/Filesystem.php line 184 while running console command `cache:clear` [] {"hostname":"vps","pid":1674}
[2022-11-11 15:30:18] mautic.WARNING: Command `cache:clear` exited with status code 1 [] {"hostname":"vps","pid":1674}
[2022-11-11 15:30:43] mautic.NOTICE: Symfony\Component\Filesystem\Exception\IOException: Failed to remove file "/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta": unlink(/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta): Permission denied (uncaught exception) at /var/www/html/mautic/vendor/symfony/filesystem/Filesystem.php line 184 while running console command `cache:clear` [] {"hostname":"vps","pid":1680}
[2022-11-11 15:30:43] mautic.WARNING: Command `cache:clear` exited with status code 1 [] {"hostname":"vps","pid":1680}
[2022-11-11 15:32:34] mautic.NOTICE: Symfony\Component\Filesystem\Exception\IOException: Failed to remove file "/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta": unlink(/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta): Permission denied (uncaught exception) at /var/www/html/mautic/vendor/symfony/filesystem/Filesystem.php line 184 while running console command `cache:clear` [] {"hostname":"vps","pid":1685}
[2022-11-11 15:32:34] mautic.WARNING: Command `cache:clear` exited with status code 1 [] {"hostname":"vps","pid":1685}
[2022-11-11 20:39:16] 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}
         
vincent@vps:/var/www/html/mautic$ sudo tail -20 var/logs/prod-2022-11-11.php 
[2022-11-11 15:30:18] console.CRITICAL: Error thrown while running command "cache:clear". Message: "Failed to remove file "/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta": unlink(/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta): Permission denied" {"exception":"[object] (Symfony\\Component\\Filesystem\\Exception\\IOException(code: 0): Failed to remove file \"/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta\": unlink(/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta): Permission denied at /var/www/html/mautic/vendor/symfony/filesystem/Filesystem.php:184)","command":"cache:clear","message":"Failed to remove file \"/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta\": unlink(/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta): Permission denied"} {"hostname":"vps","pid":1674}
[2022-11-11 15:30:43] console.CRITICAL: Error thrown while running command "cache:clear". Message: "Failed to remove file "/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta": unlink(/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta): Permission denied" {"exception":"[object] (Symfony\\Component\\Filesystem\\Exception\\IOException(code: 0): Failed to remove file \"/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta\": unlink(/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta): Permission denied at /var/www/html/mautic/vendor/symfony/filesystem/Filesystem.php:184)","command":"cache:clear","message":"Failed to remove file \"/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta\": unlink(/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta): Permission denied"} {"hostname":"vps","pid":1680}
[2022-11-11 15:32:34] console.CRITICAL: Error thrown while running command "cache:clear". Message: "Failed to remove file "/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta": unlink(/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta): Permission denied" {"exception":"[object] (Symfony\\Component\\Filesystem\\Exception\\IOException(code: 0): Failed to remove file \"/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta\": unlink(/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta): Permission denied at /var/www/html/mautic/vendor/symfony/filesystem/Filesystem.php:184)","command":"cache:clear","message":"Failed to remove file \"/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta\": unlink(/var/www/html/mautic/var/cache/pro~/translations/catalogue.en_US.qAY_2tt.php.meta): Permission denied"} {"hostname":"vps","pid":1685}

```

---

<div class="post-metadata">

**Author:** ![vincent.fr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/vincent.fr/32/6600_2.png) [@vincent.fr](https://forum.mautic.org/u/vincent.fr)\
**Post date:** [November 11, 2022, 9:43pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/18 "2022-11-11T21:43:52Z")

</div>

I show the last lines of two files [here](https://pastebin.com/DUjpFfJu)

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [November 11, 2022, 10:12pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/19 "2022-11-11T22:12:41Z")

</div>

Can you make sure that var/cache does not contain any other files and folder other then:

- ip\_data/
- languageList.txt
- prod/
- dev/
- run/

Then move one dir up with `cd ..` and run the following:

```auto
chown -R www-data:root cache 
cd cache
find . type f -exec chmod 644 {} \;
find . type d -exec chmod 755 {} \;

```

and try again.

If that does not work can you share what happens when you go to mautic root dir and run (this is only temporary for debugging and should be **addressed differently as its leaving your server exposed** )

```auto
chown -R www-data: .

```

Does it work then? Give it a try and let me know.

---

<div class="post-metadata">

**Author:** ![vincent.fr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/vincent.fr/32/6600_2.png) [@vincent.fr](https://forum.mautic.org/u/vincent.fr)\
**Post date:** [November 11, 2022, 10:29pm UTC](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041/20 "2022-11-11T22:29:18Z")

</div>

change group to cache does not work.

I am not sure the second command gives what you expected. I don’t see change sin the group, they remain all www-data [see output here](https://pastebin.com/r5JRMicS). I did it any way, after that, the site is still not working (checked on different browsers)

Then I checked in var/logs/…php. no more messages after all these commands.

Basically I can install another instance from scratch. I don’t have data on this install, but I wish to clarify the problem just in case someone accidentally does what I did to remove the cache.

thank you much for your time.

[Next page](https://forum.mautic.org/t/instance-broken-after-clearing-cache-the-wrong-way-reset-permissions-and-owner-does-not-help-yet/26041.md?page=2)
