# Can't clear cache

**URL:** <https://forum.mautic.org/t/cant-clear-cache/33791>\
**Category:** Product Support\
**Created:** [October 13, 2024, 5:17am UTC](https://forum.mautic.org/t/cant-clear-cache/33791 "2024-10-13T05:17:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [October 13, 2024, 5:17am UTC](https://forum.mautic.org/t/cant-clear-cache/33791/1 "2024-10-13T05:17:28Z")

</div>

**Your software**  
My Mautic version is: 5.1.1  
My PHP version is: 8.2  
My Database type and version is:

**Your problem**  
My problem is: I can’t clear the cache.

These errors are showing in the log:

// Clearing the cache for the prod environment with debug false

In FileLocator.php line 39:

An empty file name is not valid to be located.

cache:clear [–no-warmup] [–no-optional-warmers]

Steps I have tried to fix the problem:

Installed another instance of Mautic via composer and there it works.

---

<div class="post-metadata">

**Author:** ![fisch](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fisch/32/12946_2.png) [@fisch](https://forum.mautic.org/u/fisch)\
**Post date:** [October 13, 2024, 7:15am UTC](https://forum.mautic.org/t/cant-clear-cache/33791/2 "2024-10-13T07:15:42Z")

</div>

Perhaps a permissions issue? If you are on a Linux system, try giving appropriate permissions to the cache directory before running `cache:clear` again:

```auto
sudo chown -R www-data:www-data /path/to/mautic/var/cache
sudo chmod -R 775 /path/to/mautic/var/cache

```

---

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [October 13, 2024, 7:40am UTC](https://forum.mautic.org/t/cant-clear-cache/33791/3 "2024-10-13T07:40:36Z")

</div>

Many thanks for your answer.

Unfortunately no change after changing permissions. Same error.

---

<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:** [October 13, 2024, 10:31am UTC](https://forum.mautic.org/t/cant-clear-cache/33791/4 "2024-10-13T10:31:12Z")

</div>

I’d try  
`rm -rf /path/to/mautic/var/cache/prod/*`

---

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [October 13, 2024, 1:43pm UTC](https://forum.mautic.org/t/cant-clear-cache/33791/5 "2024-10-13T13:43:12Z")

</div>

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

No success either.

---

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [October 13, 2024, 7:26pm UTC](https://forum.mautic.org/t/cant-clear-cache/33791/6 "2024-10-13T19:26:07Z")

</div>

It must have to do with composer.  
I just rolled back to the non-composer installation and now it works!

---

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [October 13, 2024, 9:26pm UTC](https://forum.mautic.org/t/cant-clear-cache/33791/7 "2024-10-13T21:26:44Z")

</div>

Could it be, that the error is because in the Configuration I did not enable: “Update Mautic through Composer [BETA]” ?

I installed mautic 5 again via composer and now it works, so far. I could clear the cache and also update the plugins.

---

<div class="post-metadata">

**Author:** ![simo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/simo/32/13470_2.png) [@simo](https://forum.mautic.org/u/simo)\
**Post date:** [February 3, 2025, 3:28am UTC](https://forum.mautic.org/t/cant-clear-cache/33791/8 "2025-02-03T03:28:11Z")

</div>

I got same issue and found that the issue was invalid plugin , therefore , I have removed the plugins and run again without any issue.
