# 500 Error adding/editing Users & Reports

**URL:** <https://forum.mautic.org/t/500-error-adding-editing-users-reports/16340>\
**Category:** Product Support\
**Created:** [September 29, 2020, 7:56pm UTC](https://forum.mautic.org/t/500-error-adding-editing-users-reports/16340 "2020-09-29T19:56:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyonkers](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/cyonkers/32/2142_2.png) [@cyonkers](https://forum.mautic.org/u/cyonkers)\
**Post date:** [September 29, 2020, 7:56pm UTC](https://forum.mautic.org/t/500-error-adding-editing-users-reports/16340/1 "2020-09-29T19:56:39Z")

</div>

**Your software**  
My Mautic version is: 2.16.2  
My PHP version is: 7.2

**Your problem**  
My problem is:  
Out of the blue Mautic started giving a **500 internal server error** whenever we try to either Add/Edit a User or Add/Edit new or existing Reports.

Additionally, I noticed this error _[Symfony\Component\Debug\Exception\FatalThrowableError]  
Call to a member function getEvent() on boolean_ when running **/app/console mautic:campaigns:trigger from the CLI.**

These errors are showing in the log:

The error\_log shows only the following messages which happened before we noticed any of these issues.

[24-Sep-2020 16:27:33 America/New\_York] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/c7abc45/public\_html/ourdomain.com/app/bundles/CoreBundle/Model/IteratorExportDataModel.php on line 71

[24-Sep-2020 16:27:33 America/New\_York] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/c7abc45/public\_html/ourdomain.com/app/bundles/CoreBundle/Model/IteratorExportDataModel.php on line 72

The _app/logs/log\_files_ show a number of errors.

**This is what shows up in the log file when adding/editing users**

[2020-09-29 11:27:20] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: “An exception occurred while executing ‘INSERT INTO users (is\_published, date\_added, created\_by, created\_by\_user, date\_modified, modified\_by, modified\_by\_user, checked\_out, checked\_out\_by, checked\_out\_by\_user, username, password, first\_name, last\_name, email, position, timezone, locale, last\_login, last\_active, online\_status, preferences, signature, role\_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ with params [1, “2020-09-29 15:27:20”, 1, “System Administrator”, null, null, null, null, null, null, “test.user”, “$2y$13$kTkqXUyFCywYqN2B4o3fhOQ9Qv6wrHsSTYbylab2ohHPCzdLV/Prq”, “Test”, “User”, “[test@vtforge.com](mailto:test@vtforge.com)”, null, null, null, null, null, “offline”, “a:0:{}”, “Best regards, |FROM\_NAME|”, 3]: SQLSTATE[HY000]: General error: 1364 Field ‘id’ doesn’t have a default value” at /home/c7abc45/public\_html/ourdomain.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 115 {“exception”:"[object] (Doctrine\DBAL\Exception\DriverException(code: 0): An exception occurred while executing ‘INSERT INTO users (is\_published, date\_added, created\_by, created\_by\_user, date\_modified, modified\_by, modified\_by\_user, checked\_out, checked\_out\_by, checked\_out\_by\_user, username, password, first\_name, last\_name, email, position, timezone, locale, last\_login, last\_active, online\_status, preferences, signature, role\_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ with params [1, “2020-09-29 15:27:20”, 1, “System Administrator”, null, null, null, null, null, null, “test.user”, “$2y$13$kTkqXUyFCywYqN2B4o3fhOQ9Qv6wrHsSTYbylab2ohHPCzdLV\/Prq”, “Test”, “User”, “[test@vtforge.com](mailto:test@vtforge.com)”, null, null, null, null, null, “offline”, “a:0:{}”, “Best regards, |FROM\_NAME|”, 3]:\n\nSQLSTATE[HY000]: General error: 1364 Field ‘id’ doesn’t have a default value at /home/c7abc45/public\_html/ourdomain.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:115, Doctrine\DBAL\Driver\PDOException(code: HY000): SQLSTATE[HY000]: General error: 1364 Field ‘id’ doesn’t have a default value at /home/c7abc45/public\_html/ourdomain.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:107, PDOException(code: HY000): SQLSTATE[HY000]: General error: 1364 Field ‘id’ doesn’t have a default value at /home/c7abc45/public\_html/ourdomain.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105)"}

**This is what shows up in the log file when adding/editing Reports**

[2020-09-29 12:01:06] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: “An exception occurred while executing ‘INSERT INTO reports (is\_published, date\_added, created\_by, created\_by\_user, date\_modified, modified\_by, modified\_by\_user, checked\_out, checked\_out\_by, checked\_out\_by\_user, name, description, `system`, source, columns, filters, table\_order, graphs, group\_by, aggregators, settings, is\_scheduled, schedule\_unit, to\_address, schedule\_day, schedule\_month\_frequency) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ with params [1, “2020-09-29 16:01:06”, 1, “System Administrator”, null, null, null, null, null, null, “testererer”, null, 0, “leads”, “a:6:{i:0;s:12:“u.first\_name”;i:1;s:11:“u.last\_name”;i:2;s:10:“l.owner\_id”;i:3;s:7:“l.email”;i:4;s:11:“l.firstname”;i:5;s:10:“l.lastname”;}”, “a:0:{}”, “a:0:{}”, “a:0:{}”, “a:0:{}”, “a:0:{}”, “{“showGraphsAboveTable”:0,“showDynamicFilters”:0,“hideDateRangeFilter”:0}”, 0, null, null, null, null]: SQLSTATE[HY000]: General error: 1364 Field ‘id’ doesn’t have a default value” at /home/c7abc45/public\_html/ourdomain.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 115 {“exception”:"[object] (Doctrine\DBAL\Exception\DriverException(code: 0): An exception occurred while executing ‘INSERT INTO reports (is\_published, date\_added, created\_by, created\_by\_user, date\_modified, modified\_by, modified\_by\_user, checked\_out, checked\_out\_by, checked\_out\_by\_user, name, description, `system`, source, columns, filters, table\_order, graphs, group\_by, aggregators, settings, is\_scheduled, schedule\_unit, to\_address, schedule\_day, schedule\_month\_frequency) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ with params [1, “2020-09-29 16:01:06”, 1, “System Administrator”, null, null, null, null, null, null, “testererer”, null, 0, “leads”, “a:6:{i:0;s:12:\“u.first\_name\”;i:1;s:11:\“u.last\_name\”;i:2;s:10:\“l.owner\_id\”;i:3;s:7:\“l.email\”;i:4;s:11:\“l.firstname\”;i:5;s:10:\“l.lastname\”;}”, “a:0:{}”, “a:0:{}”, “a:0:{}”, “a:0:{}”, “a:0:{}”, “{\“showGraphsAboveTable\”:0,\“showDynamicFilters\”:0,\“hideDateRangeFilter\”:0}”, 0, null, null, null, null]:\n\nSQLSTATE[HY000]: General error: 1364 Field ‘id’ doesn’t have a default value at /home/c7abc45/public\_html/ourdomain.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:115, Doctrine\DBAL\Driver\PDOException(code: HY000): SQLSTATE[HY000]: General error: 1364 Field ‘id’ doesn’t have a default value at /home/c7abc45/public\_html/ourdomain.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:107, PDOException(code: HY000): SQLSTATE[HY000]: General error: 1364 Field ‘id’ doesn’t have a default value at /home/c7abc45/public\_html/ourdomain.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105)"}

**This is a result of running /app/console mautic:campaigns:trigger**

[2020-09-29 19:15:10] mautic.NOTICE: Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function getEvent() on boolean (uncaught exception) at /home/c7abc45/public\_html/ourdomain.com/app/bundles/CampaignBundle/Executioner/ScheduledExecutioner.php line 315 while running console command `mautic:campaigns:trigger`

**Additionally, these two errors are showing up repeatedly in the logs**

[2020-09-29 11:27:18] mautic.ERROR: An exception occurred while executing ‘INSERT INTO page\_hits (date\_hit, date\_left, country, region, city, isp, organization, code, referer, url, url\_title, user\_agent, remote\_host, page\_language, browser\_languages, tracking\_id, source, source\_id, query, page\_id, redirect\_id, email\_id, lead\_id, ip\_id, device\_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ with params [“2020-09-29 15:27:18”, null, null, null, null, null, null, “200”, null, null, null, null, null, null, “a:0:{}”, “r66k49mwjd3otteatra6hxy”, null, null, “a:12:{s:10:“page\_title”;s:29:“Products \u2013 Hubbardton Forge”;s:13:“page\_language”;s:5:“en-US”;s:13:“page\_referrer”;s:23:“[www.hubbardtonforge.com](http://www.hubbardtonforge.com)”;s:8:“page\_url”;s:48:“[https://www.hubbardtonforge.com/filter/?q=PLANAR";s:7:“counter”;s:1:“0”;s:16:“mautic\_device\_id”;s:23:“r66k49mwjd3otteatra6hxy”;s:10:“resolution”;s:9:“1920x1080”;s:15:“timezone\_offset”;s:3:“240”;s:8:“platform”;s:5:“Win32”;s:12:“do\_not\_track”;s:7:“unknown”;s:7:“adblock”;s:5:“false”;s:11:“fingerprint”;s:32:“1612a0f2f2a12595615cee68f7054ea8”;}"](https://www.hubbardtonforge.com/filter/?q=PLANAR%22;s:7:%22counter%22;s:1:%220%22;s:16:%22mautic_device_id%22;s:23:%22r66k49mwjd3otteatra6hxy%22;s:10:%22resolution%22;s:9:%221920x1080%22;s:15:%22timezone_offset%22;s:3:%22240%22;s:8:%22platform%22;s:5:%22Win32%22;s:12:%22do_not_track%22;s:7:%22unknown%22;s:7:%22adblock%22;s:5:%22false%22;s:11:%22fingerprint%22;s:32:%221612a0f2f2a12595615cee68f7054ea8%22;%7D%22), null, null, null, null, 1788, 115771]: SQLSTATE[HY000]: General error: 1364 Field ‘id’ doesn’t have a default value {“exception”:”[object] (Doctrine\DBAL\Exception\DriverException(code: 0): An exception occurred while executing ‘INSERT INTO page\_hits (date\_hit, date\_left, country, region, city, isp, organization, code, referer, url, url\_title, user\_agent, remote\_host, page\_language, browser\_languages, tracking\_id, source, source\_id, query, page\_id, redirect\_id, email\_id, lead\_id, ip\_id, device\_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ with params [“2020-09-29 15:27:18”, null, null, null, null, null, null, “200”, null, null, null, null, null, null, “a:0:{}”, “r66k49mwjd3otteatra6hxy”, null, null, “a:12:{s:10:\“page\_title\”;s:29:\“Products \u2013 Hubbardton Forge\”;s:13:\“page\_language\”;s:5:\“en-US\”;s:13:\“page\_referrer\”;s:23:\“[www.hubbardtonforge.com](http://www.hubbardtonforge.com)\”;s:8:\“page\_url\”;s:48:\“https:\/\/www.hubbardtonforge.com\/filter\/?q=PLANAR\”;s:7:\“counter\”;s:1:\“0\”;s:16:\“mautic\_device\_id\”;s:23:\“r66k49mwjd3otteatra6hxy\”;s:10:\“resolution\”;s:9:\“1920x1080\”;s:15:\“timezone\_offset\”;s:3:\“240\”;s:8:\“platform\”;s:5:\“Win32\”;s:12:\“do\_not\_track\”;s:7:\“unknown\”;s:7:\“adblock\”;s:5:\“false\”;s:11:\“fingerprint\”;s:32:\“1612a0f2f2a12595615cee68f7054ea8\”;}”, null, null, null, null, 1788, 115771]:\n\nSQLSTATE[HY000]: General error: 1364 Field ‘id’ doesn’t have a default value at /home/c7abc45/public\_html/ourdomain.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:115, Doctrine\DBAL\Driver\PDOException(code: HY000): SQLSTATE[HY000]: General error: 1364 Field ‘id’ doesn’t have a default value at /home/c7abc45/public\_html/ourdomain.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:107, PDOException(code: HY000): SQLSTATE[HY000]: General error: 1364 Field ‘id’ doesn’t have a default value at /home/c7abc45/public\_html/ourdomain.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105)”}

[2020-09-29 11:27:18] mautic.CRITICAL: Uncaught PHP Exception Doctrine\ORM\ORMException: “The EntityManager is closed.” at /home/c7abc45/public\_html/ourdomain.com/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php line 144 {“exception”:"[object] (Doctrine\ORM\ORMException(code: 0): The EntityManager is closed. at /home/c7abc45/public\_html/ourdomain.com/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php:144)"}

Steps I have tried to fix the problem:

I’m not even sure where to start with this, and suggestions would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![codes9](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/codes9/32/682_2.png) [@codes9](https://forum.mautic.org/u/codes9)\
**Post date:** [October 31, 2020, 10:46pm UTC](https://forum.mautic.org/t/500-error-adding-editing-users-reports/16340/2 "2020-10-31T22:46:43Z")

</div>

Here’s a clue I found.

> This is how I solved the Doctrine **“The EntityManager is closed.”** issue. Basically each time there’s an exception (i.e. duplicate key) or not providing data for a mandatory column will cause Doctrine to close the Entity Manager.

I suspect you’re dealing with Mautic trying to insert a duplicate or invalid key into your database where that key should be unique. This could be a id or foreign id field.

Have you updated your version of PHP or Mysql just before this error started?
