# Clearing the cache broke mautic

**URL:** https://forum.mautic.org/t/clearing-the-cache-broke-mautic/27999
**Category:** Product Support
**Created:** [May 13, 2023, 1:25pm UTC](https://forum.mautic.org/t/clearing-the-cache-broke-mautic/27999 "2023-05-13T13:25:16Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![peter\_k](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/peter_k/32/511_2.png) [@peter\_k](https://forum.mautic.org/u/peter_k)
#### Post date: [May 13, 2023, 1:25pm UTC](https://forum.mautic.org/t/clearing-the-cache-broke-mautic/27999/1 "2023-05-13T13:25:17Z")

</div>

**Your software**  
My Mautic version is: 4.4.7  
My PHP version is: 8.0

**Your problem**  
I cleared the cache according to the [docs](https://docs.mautic.org/en/troubleshooting) and ran

```auto
ssh-w ****2@d**** 8:/www/htdocs/w **** 2/mautic$ rm -rf var/cache/*`.

```

Now I’m getting this errror in the backend:

> The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator.

In the terminal I’m getting:

```auto
ssh-w ****2@d**** 8:/www/htdocs/w **** 2/mautic$ php80 bin/console cache:warmup
PHP Warning: Undefined array key "class" in /www/htdocs/w019eff2/mautic/app/bundles/CoreBundle/DependencyInjection/MauticCoreExtension.php on line 119

Warning: Undefined array key "class" in /www/htdocs/w019eff2/mautic/app/bundles/CoreBundle/DependencyInjection/MauticCoreExtension.php on line 119
PHP Warning: Undefined array key "class" in /www/htdocs/w019eff2/mautic/app/bundles/CoreBundle/DependencyInjection/MauticCoreExtension.php on line 120

Warning: Undefined array key "class" in /www/htdocs/w019eff2/mautic/app/bundles/CoreBundle/DependencyInjection/MauticCoreExtension.php on line 120

In ContainerBuilder.php line 842:
                         
  Invalid alias id: "". 

```

If I’m using PHP7.4 I’m getting just:

```auto
ssh-w ****2@d**** 8:/www/htdocs/w **** 2/mautic$ php74 bin/console 

In ContainerBuilder.php line 842:
                         
  Invalid alias id: "".

```

**This is not a permission problem**. As the ssh user and the www-user are set up to be almost identical. In every other case I can happily create/delte files via ssh or the server without running into any problems.

Plus I tried to access the web backend before using the ssh terminal session. So, the www-user should have created the files, which can’t lead to a permission problem.

But to be double safe, I executed:

```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/

```

```auto
ssh-w ******2@d****** 8:/www/htdocs/w ****** 2/mautic$ whoami 
ssh-w ****** 2
ssh-w ******2@d****** 8:/www/htdocs/w ****** 2/mautic$ ls -l
total 4484
drwxr-xr-x 8 ssh-w ******2 w****** 2 4096 Aug 26 2022 app
-rw-r--r-- 1 ssh-w ******2 w****** 2 54 Mär 18 23:36 autoload.php
drwxr-xr-x 2 ssh-w ******2 w****** 2 4096 Dez 21 2021 bin
-rw-r--r-- 1 ssh-w ******2 w****** 2 2 Mär 18 23:36 critical_migrations.txt
-rw-r--r-- 1 ssh-w ******2 w****** 2 12862 Mär 18 23:36 favicon.ico
-rw-r--r-- 1 ssh-w ******2 w****** 2 621 Mär 18 23:36 index.php
-rw-r--r-- 1 ssh-w ******2 w****** 2 38346 Mär 18 23:36 LICENSE.txt
drwxr-xr-x 7 ssh-w ******2 w****** 2 4096 Nov 18 13:24 media
-rw-r--r-- 1 ssh-w ******2 w****** 2 4043 Mär 18 23:36 offline.php
-rw-r--r-- 1 ssh-w ******2 w****** 2 4472565 Mär 18 23:36 phpstan-baseline.neon
drwxr-xr-x 16 ssh-w ******2 w****** 2 4096 Apr 17 21:44 plugins
-rw-r--r-- 1 ssh-w ******2 w****** 2 224 Mär 18 23:36 robots.txt
-rw-r--r-- 1 ssh-w ******2 w****** 2 6087 Mär 18 23:36 SECURITY.md
drwxr-xr-x 24 ssh-w ******2 w****** 2 4096 Dez 27 2021 themes
drwxrwxr-x 4 ssh-w ******2 w****** 2 4096 Jan 17 2022 translations
drwxr-xr-x 6 ssh-w ******2 w****** 2 4096 Nov 29 2021 var
drwxr-xr-x 75 ssh-w ******2 w****** 2 4096 Jul 4 2022 vendor
ssh-w ******2@d****** 8:/www/htdocs/w ****** 2/mautic$ ls -l var/
total 16
drwxrwxr-x 3 ssh-w ******2 w****** 2 4096 Mai 13 14:58 cache
drwxrwxr-x 2 ssh-w ******2 w****** 2 4096 Mai 13 03:43 logs
drwxr-xr-x 2 ssh-w ******2 w****** 2 4096 Mai 12 15:11 spool
drwxr-xr-x 5 ssh-w ******2 w****** 2 4096 Mär 19 10:43 tmp

```

_The asterisks omit identical chars for the user and group._

---

<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: [May 13, 2023, 7:10pm UTC](https://forum.mautic.org/t/clearing-the-cache-broke-mautic/27999/2 "2023-05-13T19:10:10Z")

</div>

Hi, can you delete the cache one again with the following:

`rm -rf var/cache/*`

and then create folder:

`mkdir -p var/cache/prod`

then ensure the above folder is writable by web server user.

Execute the following:

`composer dump-autoload`

Then, I would suggest reloading the plugins:

`php bin/console mautic:plugins:reload`

I hope it helps.

---

<div class="post-metadata">

### Author: ![peter\_k](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/peter_k/32/511_2.png) [@peter\_k](https://forum.mautic.org/u/peter_k)
#### Post date: [May 13, 2023, 7:55pm UTC](https://forum.mautic.org/t/clearing-the-cache-broke-mautic/27999/3 "2023-05-13T19:55:49Z")

</div>

Thanks for your reply.

Did all the steps except `composer dump-autoload` as it is an older non-composer installation.

It didn’t help.

As of now, I strongly suspect the line

```auto
In ContainerBuilder.php line 842:
                         
  Invalid alias id: "".  

```

Is the root. How/where could I have accidentally set an empty id?

---

<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: [May 13, 2023, 8:07pm UTC](https://forum.mautic.org/t/clearing-the-cache-broke-mautic/27999/4 "2023-05-13T20:07:57Z")

</div>

Do you have any custom plugins, did you alter any of existing plugins in the core?

composer dump-autoload has to do with vendor folder. Download composer files from mautic repop:

> <https://github.com/mautic/mautic/blob/4a897bf90b29e7461680788251e30f416a2c56b0/composer.json>

[https://github.com/mautic/mautic/blob/4a897bf90b29e7461680788251e30f416a2c56b0/composer.lock](https://github.com/mautic/mautic/blob/4a897bf90b29e7461680788251e30f416a2c56b0/composer.lock)

and try to execute composer command.

Before that make sure you have composer installed.

---

<div class="post-metadata">

### Author: ![peter\_k](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/peter_k/32/511_2.png) [@peter\_k](https://forum.mautic.org/u/peter_k)
#### Post date: [May 13, 2023, 8:15pm UTC](https://forum.mautic.org/t/clearing-the-cache-broke-mautic/27999/5 "2023-05-13T20:15:06Z")

</div>

> [@mzagmajster](#):
>
> Do you have any custom plugins

That was **the** answer. I added an experimental custom plugin I’m working on. Obviously it wasn’t a problem until I cleared the cache.

I removed it and cleared the cache again. It works now.

Learned a valuable lesson, today 😃 🤦‍♂️

Thank you so much!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)
#### Post date: [May 15, 2023, 8:15am UTC](https://forum.mautic.org/t/clearing-the-cache-broke-mautic/27999/6 "2023-05-15T08:15:25Z")

</div>

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