1

Am facing an exception when sending e-mails in Shopware 6.4.19.0:

(Doctrine\\DBAL\\Exception\\DriverException(code: 0): An exception occurred while executing 'INSERT INTO enqueue (id, published_at, body, headers, properties, priority, queue, redelivered, delivery_id, redeliver_after) ...
...
(PDOException(code: 22007): SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\xF0\\x9F\\x91\\x89 B...' for column `db_21849_01`.`enqueue`.`body` at row 1 at /vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117)"} []

It is thrown for e-mails including emojis. It has not happened with 6.4.18.1.

What might cause it and how to fix it?

s0me1
  • 11
  • 3
  • Are you sure you already sent emails including emojis in 6.4.18.1? Shopware should not change the charset during an update.. was anything else change with the database? – Alex Feb 21 '23 at 06:42
  • 1
    With the DB's default collation being `utf8mb4_unicode_ci` it's either been "something" in the migration in-between the two versions ... or ... something in step 2 at https://docs.shopware.com/en/shopware-6-en/tutorials-and-faq/message-queue-and-scheduled-tasks added / edited the table. – s0me1 Feb 21 '23 at 11:03
  • 1
    But as the change of the collation has fixed the issue, see answer below, I will not follow-up on the suspects. – s0me1 Feb 21 '23 at 11:08

1 Answers1

1

Check the collation and character set of your database. For storing Emojis you need at least a mb4 character set.

How to store Emoji Character in MySQL Database

Alex
  • 32,506
  • 16
  • 106
  • 171
  • 1
    It has been the collation, but not for the DB. Only the "enqueue" table was affected. – s0me1 Feb 21 '23 at 09:42
  • 1
    Am lacking "reputation" to vote for this as being the correct answer. So here comes a thumbs up instead – s0me1 Feb 21 '23 at 09:48