# Mautic crashed: internal server error after editing dashboard "Best email read hours" widget

**URL:** <https://forum.mautic.org/t/mautic-crashed-internal-server-error-after-editing-dashboard-best-email-read-hours-widget/21758>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [November 24, 2021, 5:53pm UTC](https://forum.mautic.org/t/mautic-crashed-internal-server-error-after-editing-dashboard-best-email-read-hours-widget/21758 "2021-11-24T17:53:27Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![shailemalla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shailemalla/32/1394_2.png) [@shailemalla](https://forum.mautic.org/u/shailemalla)\
**Post date:** [November 24, 2021, 5:53pm UTC](https://forum.mautic.org/t/mautic-crashed-internal-server-error-after-editing-dashboard-best-email-read-hours-widget/21758/1 "2021-11-24T17:53:27Z")

</div>

**Your software**  
My Mautic version is: 4.0.2  
My PHP version is: 7.4.3  
My Database type and version is:  
DEFAULT CHARACTER SET utf8 COLLATE utf8\_unicode\_ci  
mysql Ver 15.1 Distrib 10.3.31-MariaDB, for debian-linux-gnu (aarch64) using readline 5.2

**Your problem**  
My problem is:  
Mautic has crashed after editing a simple “Best email read hours” widget.  
Even clearing cache doesn’t bring it to life.

These errors are showing in the log:

```auto
[2021-11-24 11:58:51] mautic.ERROR: Invalid clickthrough value: Yjo4OntmOjk6ImZiaGVkZiI7Yjo1Ont2OjM7Zjo0NzoiZGJ6Y2J2dGEuZmlmYWciO3Y6NDt2Ojc2MTt9Zjo4OiJmemJ2eSI7djo4MTtmOjc6ImZnYmciO2Y6NTU6Ijk0MmVlMjhkOWNiOWQ2MjU5NzMzMzgiO2Y6NzoieWZiZSI7Zjo3OiI5NDc2IjtmOjA6ImR1YmFhZnkiO2I6NDp7Zjo4OiJmemJ2eSI7djo4MTt9fQ== {"exception":"[object] (Mautic\\CoreBundle\\Exception\\InvalidDecodedStringException(code: 0): The string b:8:{f:9:\"fbhedf\";b:5:{v:3;f:47:\"dbzcbvta.fifag\";v:4;v:761;}f:8:\"fzbvy\";v:81;f:7:\"fgbg\";f:55:\"942ee28d9cb9d625973338\";f:7:\"yfbe\";f:7:\"9476\";f:0:\"dubaafy\";b:4:{f:8:\"fzbvy\";v:81;}} is not a serialized array at /var/www/mautic/app/bundles/CoreBundle/Helper/ClickthroughHelper.php:46)"} []
[2021-11-24 11:58:51] mautic.ERROR: Invalid clickthrough value: Yjo4OntmOjk6ImZiaGVkZiI7Yjo1Ont2OjM7Zjo0NzoiZGJ6Y2J2dGEuZmlmYWciO3Y6NDt2Ojc2MTt9Zjo4OiJmemJ2eSI7djo4MTtmOjc6ImZnYmciO2Y6NTU6Ijk0MmVlMjhkOWNiOWQ2MjU5NzMzMzgiO2Y6NzoieWZiZSI7Zjo3OiI5NDc2IjtmOjA6ImR1YmFhZnkiO2I6NDp7Zjo4OiJmemJ2eSI7djo4MTt9fQ== {"exception":"[object] (Mautic\\CoreBundle\\Exception\\InvalidDecodedStringException(code: 0): The string b:8:{f:9:\"fbhedf\";b:5:{v:3;f:47:\"dbzcbvta.fifag\";v:4;v:761;}f:8:\"fzbvy\";v:81;f:7:\"fgbg\";f:55:\"942ee28d9cb9d625973338\";f:7:\"yfbe\";f:7:\"9476\";f:0:\"dubaafy\";b:4:{f:8:\"fzbvy\";v:81;}} is not a serialized array at /var/www/mautic/app/bundles/CoreBundle/Helper/ClickthroughHelper.php:46)"} []
[2021-11-24 22:11:24] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function getCount() on int" at /var/www/mautic/app/bundles/StatsBundle/Aggregate/Calculator.php line 187 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to a member function getCount() on int at /var/www/mautic/app/bundles/StatsBundle/Aggregate/Calculator.php:187)"} []
[2021-11-24 22:22:37] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function createQueryBuilder() on null" at /var/www/mautic/app/bundles/EmailBundle/Stats/Helper/FilterTrait.php line 79 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to a member function createQueryBuilder() on null at /var/www/mautic/app/bundles/EmailBundle/Stats/Helper/FilterTrait.php:79)"} []
[2021-11-24 22:22:49] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function createQueryBuilder() on null" at /var/www/mautic/app/bundles/EmailBundle/Stats/Helper/FilterTrait.php line 79 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to a member function createQueryBuilder() on null at /var/www/mautic/app/bundles/EmailBundle/Stats/Helper/FilterTrait.php:79)"} []
[2021-11-24 22:24:55] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function createQueryBuilder() on null" at /var/www/mautic/app/bundles/EmailBundle/Stats/Helper/FilterTrait.php line 79 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to a member function createQueryBuilder() on null at /var/www/mautic/app/bundles/EmailBundle/Stats/Helper/FilterTrait.php:79)"} []
[2021-11-24 22:25:01] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function createQueryBuilder() on null" at /var/www/mautic/app/bundles/EmailBundle/Stats/Helper/FilterTrait.php line 79 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to a member function createQueryBuilder() on null at /var/www/mautic/app/bundles/EmailBundle/Stats/Helper/FilterTrait.php:79)"} []
[2021-11-24 22:25:05] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function createQueryBuilder() on null" at /var/www/mautic/app/bundles/EmailBundle/Stats/Helper/FilterTrait.php line 79 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to a member function createQueryBuilder() on null at /var/www/mautic/app/bundles/EmailBundle/Stats/Helper/FilterTrait.php:79)"} []
[2021-11-24 22:25:16] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function createQueryBuilder() on null" at /var/www/mautic/app/bundles/EmailBundle/Stats/Helper/FilterTrait.php line 79 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to a member function createQueryBuilder() on null at /var/www/mautic/app/bundles/EmailBundle/Stats/Helper/FilterTrait.php:79)"} []
[2021-11-24 22:27:05] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Filesystem\Exception\IOException: "Cannot rename "/tmp/UrlMatcher.phpWAmy7Y" to "/var/www/mautic/var/cache/prod/UrlMatcher.php"." at /var/www/mautic/vendor/symfony/filesystem/Filesystem.php line 290 {"exception":"[object] (Symfony\\Component\\Filesystem\\Exception\\IOException(code: 0): Cannot rename \"/tmp/UrlMatcher.phpWAmy7Y\" to \"/var/www/mautic/var/cache/prod/UrlMatcher.php\". at /var/www/mautic/vendor/symfony/filesystem/Filesystem.php:290)"} []
[2021-11-24 22:27:05] mautic.ERROR: Symfony\Component\Filesystem\Exception\IOException: Cannot rename "/tmp/UrlGenerator.phpNqWgTW" to "/var/www/mautic/var/cache/prod/UrlGenerator.php". - in file /var/www/mautic/vendor/symfony/filesystem/Filesystem.php - at line 290 [] []
[2021-11-24 22:27:12] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Filesystem\Exception\IOException: "Cannot rename "/tmp/UrlMatcher.phpkdr5Rq" to "/var/www/mautic/var/cache/prod/UrlMatcher.php"." at /var/www/mautic/vendor/symfony/filesystem/Filesystem.php line 290 {"exception":"[object] (Symfony\\Component\\Filesystem\\Exception\\IOException(code: 0): Cannot rename \"/tmp/UrlMatcher.phpkdr5Rq\" to \"/var/www/mautic/var/cache/prod/UrlMatcher.php\". at /var/www/mautic/vendor/symfony/filesystem/Filesystem.php:290)"} []
[2021-11-24 22:27:12] mautic.ERROR: Symfony\Component\Filesystem\Exception\IOException: Cannot rename "/tmp/UrlGenerator.phpNTcWls" to "/var/www/mautic/var/cache/prod/UrlGenerator.php". - in file /var/www/mautic/vendor/symfony/filesystem/Filesystem.php - at line 290 [] []
[2021-11-24 22:27:15] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Filesystem\Exception\IOException: "Cannot rename "/tmp/UrlMatcher.phpO00xvV" to "/var/www/mautic/var/cache/prod/UrlMatcher.php"." at /var/www/mautic/vendor/symfony/filesystem/Filesystem.php line 290 {"exception":"[object] (Symfony\\Component\\Filesystem\\Exception\\IOException(code: 0): Cannot rename \"/tmp/UrlMatcher.phpO00xvV\" to \"/var/www/mautic/var/cache/prod/UrlMatcher.php\". at /var/www/mautic/vendor/symfony/filesystem/Filesystem.php:290)"} []
[2021-11-24 22:27:15] mautic.ERROR: Symfony\Component\Filesystem\Exception\IOException: Cannot rename "/tmp/UrlGenerator.phpWKVziT" to "/var/www/mautic/var/cache/prod/UrlGenerator.php". - in file /var/www/mautic/vendor/symfony/filesystem/Filesystem.php - at line 290 [] []
[2021-11-24 22:27:18] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Filesystem\Exception\IOException: "Cannot rename "/tmp/UrlMatcher.phpAVqQ9E" to "/var/www/mautic/var/cache/prod/UrlMatcher.php"." at /var/www/mautic/vendor/symfony/filesystem/Filesystem.php line 290 {"exception":"[object] (Symfony\\Component\\Filesystem\\Exception\\IOException(code: 0): Cannot rename \"/tmp/UrlMatcher.phpAVqQ9E\" to \"/var/www/mautic/var/cache/prod/UrlMatcher.php\". at /var/www/mautic/vendor/symfony/filesystem/Filesystem.php:290)"} []
[2021-11-24 22:27:18] mautic.ERROR: Symfony\Component\Filesystem\Exception\IOException: Cannot rename "/tmp/UrlGenerator.phpZyfd2D" to "/var/www/mautic/var/cache/prod/UrlGenerator.php". - in file /var/www/mautic/vendor/symfony/filesystem/Filesystem.php - at line 290 [] []
[2021-11-24 22:27:20] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Filesystem\Exception\IOException: "Cannot rename "/tmp/UrlMatcher.phpNdaFqe" to "/var/www/mautic/var/cache/prod/UrlMatcher.php"." at /var/www/mautic/vendor/symfony/filesystem/Filesystem.php line 290 {"exception":"[object] (Symfony\\Component\\Filesystem\\Exception\\IOException(code: 0): Cannot rename \"/tmp/UrlMatcher.phpNdaFqe\" to \"/var/www/mautic/var/cache/prod/UrlMatcher.php\". at /var/www/mautic/vendor/symfony/filesystem/Filesystem.php:290)"} []
[2021-11-24 22:27:20] mautic.ERROR: Symfony\Component\Filesystem\Exception\IOException: Cannot rename "/tmp/UrlGenerator.phpYa2kzh" to "/var/www/mautic/var/cache/prod/UrlGenerator.php". - in file /var/www/mautic/vendor/symfony/filesystem/Filesystem.php - at line 290 [] []
[2021-11-24 22:28:01] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Filesystem\Exception\IOException: "Cannot rename "/tmp/UrlMatcher.php93cHEe" to "/var/www/mautic/var/cache/prod/UrlMatcher.php"." at /var/www/mautic/vendor/symfony/filesystem/Filesystem.php line 290 {"exception":"[object] (Symfony\\Component\\Filesystem\\Exception\\IOException(code: 0): Cannot rename \"/tmp/UrlMatcher.php93cHEe\" to \"/var/www/mautic/var/cache/prod/UrlMatcher.php\". at /var/www/mautic/vendor/symfony/filesystem/Filesystem.php:290)"} []
[2021-11-24 22:28:01] mautic.ERROR: Symfony\Component\Filesystem\Exception\IOException: Cannot rename "/tmp/UrlGenerator.phpo1p2If" to "/var/www/mautic/var/cache/prod/UrlGenerator.php". - in file /var/www/mautic/vendor/symfony/filesystem/Filesystem.php - at line 290 [] []

```

Steps I have tried to fix the problem:  
Cleared mautic cache

Relevant bug report: [Mautic crashed: internal server error after editing dashboard “Best email read hours” widget · Issue #10640 · mautic/mautic (github.com)](https://github.com/mautic/mautic/issues/10640)

---

<div class="post-metadata">

**Author:** ![shailemalla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shailemalla/32/1394_2.png) [@shailemalla](https://forum.mautic.org/u/shailemalla)\
**Post date:** [November 24, 2021, 6:16pm UTC](https://forum.mautic.org/t/mautic-crashed-internal-server-error-after-editing-dashboard-best-email-read-hours-widget/21758/2 "2021-11-24T18:16:04Z")

</div>

Update: fixed cache permission issues. But still getting 500 internal server error.

I think the problem is here:

```auto
[2021-11-24 22:11:24] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function getCount() on int" at /var/www/mautic/app/bundles/StatsBundle/Aggregate/Calculator.php line 187 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to a member function getCount() on int at /var/www/mautic/app/bundles/StatsBundle/Aggregate/Calculator.php:187)"} []

```

or here:

```auto
[2021-11-24 22:22:37] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function createQueryBuilder() on null" at /var/www/mautic/app/bundles/EmailBundle/Stats/Helper/FilterTrait.php line 79 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to a member function createQueryBuilder() on null at /var/www/mautic/app/bundles/EmailBundle/Stats/Helper/FilterTrait.php:79)"} []

```

How do I get mautic working again?

update: just checked, all other mautic urls working perfectly, except for dashboard.

---

<div class="post-metadata">

**Author:** ![shailemalla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shailemalla/32/1394_2.png) [@shailemalla](https://forum.mautic.org/u/shailemalla)\
**Post date:** [November 24, 2021, 6:24pm UTC](https://forum.mautic.org/t/mautic-crashed-internal-server-error-after-editing-dashboard-best-email-read-hours-widget/21758/3 "2021-11-24T18:24:19Z")

</div>

Maybe if I disabled “Best email read hours” widget from the dashboard, I could get Mautic working again, but I don’t know how to disable that widget.

---

<div class="post-metadata">

**Author:** ![shailemalla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shailemalla/32/1394_2.png) [@shailemalla](https://forum.mautic.org/u/shailemalla)\
**Post date:** [November 25, 2021, 7:30am UTC](https://forum.mautic.org/t/mautic-crashed-internal-server-error-after-editing-dashboard-best-email-read-hours-widget/21758/4 "2021-11-25T07:30:56Z")

</div>

UPDATE: FIXED

Ran following commands on my machine:

1 .Fist login as root user in your mysql.

```auto
sudo mysql -u root

```

1. Replace `mautic-database-name` with your own mautic database name and run this in mysql interface:

```auto
USE mautic-database-name;

```

1. Print widgets table:

```auto
SELECT * FROM widgets;

```

1. find out the ID of the widget that is broken and update its params, in my case the ID of the widget was 7, so:

```auto
UPDATE widgets SET params = "a:0:{}" WHERE id = 7;

```

that’s it!

cheers!

---

<div class="post-metadata">

**Author:** ![crozilla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/crozilla/32/2054_2.png) [@crozilla](https://forum.mautic.org/u/crozilla)\
**Post date:** [March 7, 2022, 11:19pm UTC](https://forum.mautic.org/t/mautic-crashed-internal-server-error-after-editing-dashboard-best-email-read-hours-widget/21758/5 "2022-03-07T23:19:54Z")

</div>

Having the same problem with 4.1.0 (can’t update to 4.2 for some reason), created a similar widget that prevents the Dashboard from showing. Same error message. Tried this solution, but it didn’t work. I then deleted the DB entry for the widget entirely, without luck. Thoughts?

---

<div class="post-metadata">

**Author:** ![jtourgee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jtourgee/32/1980_2.png) [@jtourgee](https://forum.mautic.org/u/jtourgee)\
**Post date:** [April 12, 2022, 1:37pm UTC](https://forum.mautic.org/t/mautic-crashed-internal-server-error-after-editing-dashboard-best-email-read-hours-widget/21758/6 "2022-04-12T13:37:36Z")

</div>

Seems this is still an issue in 4.2.1 as well, I ran into it yesterday.

---

<div class="post-metadata">

**Author:** ![crozilla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/crozilla/32/2054_2.png) [@crozilla](https://forum.mautic.org/u/crozilla)\
**Post date:** [April 14, 2022, 4:44pm UTC](https://forum.mautic.org/t/mautic-crashed-internal-server-error-after-editing-dashboard-best-email-read-hours-widget/21758/7 "2022-04-14T16:44:05Z")

</div>

Did [shailemalla](https://forum.mautic.org/u/shailemalla)’s solution work for you?

---

<div class="post-metadata">

**Author:** ![adiux](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/adiux/32/5793_2.png) [@adiux](https://forum.mautic.org/u/adiux)\
**Post date:** [February 17, 2023, 9:35am UTC](https://forum.mautic.org/t/mautic-crashed-internal-server-error-after-editing-dashboard-best-email-read-hours-widget/21758/8 "2023-02-17T09:35:05Z")

</div>

I also still have this issue with 4.4. I guess it can be fixed with the workaround. However, the system should not crash and logout the user like this. We have to find a solution where this error does not happen. I will take a look into it for a bit.

---

<div class="post-metadata">

**Author:** ![adiux](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/adiux/32/5793_2.png) [@adiux](https://forum.mautic.org/u/adiux)\
**Post date:** [February 17, 2023, 11:46am UTC](https://forum.mautic.org/t/mautic-crashed-internal-server-error-after-editing-dashboard-best-email-read-hours-widget/21758/9 "2023-02-17T11:46:05Z")

</div>

I just updated to the latest code from the 4.4 branch. This solved my problem. The Widget Best Email Sending Time is displayed on my dashboard.

---

<div class="post-metadata">

**Author:** ![Yosu\_Cadilla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yosu_cadilla/32/6206_2.png) [@Yosu\_Cadilla](https://forum.mautic.org/u/Yosu_Cadilla)\
**Post date:** [February 19, 2023, 4:45pm UTC](https://forum.mautic.org/t/mautic-crashed-internal-server-error-after-editing-dashboard-best-email-read-hours-widget/21758/10 "2023-02-19T16:45:05Z")

</div>

I’m also seeing this issue on several M4.x installs.

Thank you @shailemalla for the fix.  
This is a great workaround, but I think the problem should be properly identified and corrected.

I suspect the issue is one or more complex queries which do not return anything until the script times out.  
Hence, it might seem it is working but it is just taking longer than usual (up to whatever timeout time you have set on your php.ini), but what is going on is that the query is not being fulfilled in time or at all and the results are taken from cache, once you hit your timeout.

I also suspect there might be 2 different issues showing similar symptoms, one would be the long-running complex query issues, which are usually complex time-related-queries, which return an sql-orm-doctrine related error.  
And a different problem, causing the Apache (500-type if I remember correctly) or Mautic blocking error rendering the UI inaccessible.

In my case I am (mostly) using Mautic 4.4.5 on top of Ubuntu 20.04 with MySQL 8.0 and PHP 8.0, so it looks like this affects all sorts of infrastructure indiscriminately, which would point to a bug in the code.
