# 500 Error When Saving Emails - Uncaught PHP Exception Doctrine\\DBAL\\Exception\\DriverException

**URL:** <https://forum.mautic.org/t/500-error-when-saving-emails-uncaught-php-exception-doctrine-dbal-exception-driverexception/23731>\
**Category:** Product Support\
**Created:** [April 13, 2022, 3:33pm UTC](https://forum.mautic.org/t/500-error-when-saving-emails-uncaught-php-exception-doctrine-dbal-exception-driverexception/23731 "2022-04-13T15:33:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![clientamp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/clientamp/32/7358_2.png) [@clientamp](https://forum.mautic.org/u/clientamp)\
**Post date:** [April 13, 2022, 3:33pm UTC](https://forum.mautic.org/t/500-error-when-saving-emails-uncaught-php-exception-doctrine-dbal-exception-driverexception/23731/1 "2022-04-13T15:33:53Z")

</div>

**Your software**  
My Mautic version is: 4.2.1  
My PHP version is: 7.4.28  
My Database type and version is: MariaDB 10.5

**Your problem**  
My problem is: Emails produce a 500 server error when saving or editing.

Secondary problem (related) Clicking on ‘Database info’ in System Info results in no action (database info does not load).

These errors are showing in the log:  
[2022-04-13 11:42:56] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: "An exception occurred while executing ‘INSERT INTO emails (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, subject, from\_address, from\_name, reply\_to\_address, bcc\_address, use\_owner\_as\_mailer, template, content, utm\_tags, plain\_text, custom\_html, email\_type, publish\_up, publish\_down, read\_count, sent\_count, variant\_sent\_count, variant\_read\_count, revision, lang, variant\_settings, variant\_start\_date, dynamic\_content, headers, public\_preview, category\_id, translation\_parent\_id, variant\_parent\_id, unsubscribeform\_id, preference\_center\_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ with params [MY PARAMS “a:0:{}”, “a:4:{s:9:“utmSource”;N;s:9:“utmMedium”;N;s:11:“utmCampaign”;N;s:10:“utmContent”;N;}”, null, "\r\n\r\n\r\n\r\n

[2022-04-13 00:02:23] mautic.NOTICE: PHP Notice - SessionHandler::gc(): ps\_files\_cleanup\_dir: opendir(/var/lib/php/sessions) failed: Permission denied (13) - in file /var/www/html/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php - at line 106 {“maxlifetime”:1440}

Steps I have tried to fix the problem:  
Cleared cache  
Updated schema  
Checked for outstanding database migrations  
Fixed permissions for /var/lib/php/sessions  
Restarted apache  
Rebooted server

Thank you for any advice.

---

<div class="post-metadata">

**Author:** ![clientamp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/clientamp/32/7358_2.png) [@clientamp](https://forum.mautic.org/u/clientamp)\
**Post date:** [April 15, 2022, 1:14am UTC](https://forum.mautic.org/t/500-error-when-saving-emails-uncaught-php-exception-doctrine-dbal-exception-driverexception/23731/2 "2022-04-15T01:14:42Z")

</div>

I have further narrowed down the issue…

The 500 errors are triggered only when text is pasted into the email. If you write text by hand, they save.

This is really bizarre, but it reproduces 100% of the time for me. Tried on multiple devices, browsers, internet connections, and users.

---

<div class="post-metadata">

**Author:** ![clientamp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/clientamp/32/7358_2.png) [@clientamp](https://forum.mautic.org/u/clientamp)\
**Post date:** [April 18, 2022, 4:47pm UTC](https://forum.mautic.org/t/500-error-when-saving-emails-uncaught-php-exception-doctrine-dbal-exception-driverexception/23731/3 "2022-04-18T16:47:04Z")

</div>

I have determined it’s the emojis that are causing the error. I assume this is a database issue, but I’m unsure of a fix. Any pointers?

---

<div class="post-metadata">

**Author:** ![clientamp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/clientamp/32/7358_2.png) [@clientamp](https://forum.mautic.org/u/clientamp)\
**Post date:** [April 18, 2022, 5:29pm UTC](https://forum.mautic.org/t/500-error-when-saving-emails-uncaught-php-exception-doctrine-dbal-exception-driverexception/23731/4 "2022-04-18T17:29:44Z")

</div>

This is solved.

Somehow the db was converted to utf8 during a recent MariaDB upgrade. The solution was to convert back to utf8mb4
