Content insert failed. See error log for details

We’re getting the above error in the history of a ticket, in place of where an incoming email ought to be shown. This is a significant problem because RT accepts the email from the MTA, but fails to insert it, and the content is lost.

The message in the logs looks like:

[88469] [Tue Apr 14 23:57:00 2020] [warning]: DBD::mysql::st execute failed: Incorrect string value: '\xF0\x9F\x9B\xAB\xF0\x9F...' for column `rtdb`.`Attachments`.`Headers` at row 1 at /usr/share/perl5/DBIx/SearchBuilder/Handle.pm line 586. (/usr/share/perl5/DBIx/SearchBuilder/Handle.pm:586)

[88469] [Tue Apr 14 23:57:00 2020] [warning]: RT::Handle=HASH(0x55886fbd5fc0) couldn't execute the query 'INSERT INTO Attachments (Created, Creator, Parent, TransactionId, MessageId, Subject, ContentType, Headers) VALUES (?, ?, ?, ?, ?, ?, ?, ?)' at /usr/share/perl5/DBIx/SearchBuilder/Handle.pm line 599.

Email that triggers this simply has emojis in the CC header (e.g. “🛫😎🛬 <b....@gmail.com>”)

1 Like

Okay, it looks like this is pretty much the same issue as https://rt.bestpractical.com/Ticket/Display.html?id=33696
So I look forward to it being fixed in RT 5.

I see that it is also addressed by this workaround: https://github.com/bestpractical/rt/compare/4.4/mysql-replace-4-bytes-utf8-data
Which I’ve applied locally, and that works good enough for me for now.

I’m now running into the same problem, but for the full text indexer. i.e. “Attachment 4314 cannot be indexed: Incorrect string value: ‘\xF0\x9F\x98\x8A\x0D\x0A…’ for column rtdb.AttachmentsIndex.Content at row 1 at /usr/sbin/rt-fulltext-indexer line 276.”

But I haven’t seen an equivalent existing workaround. Guess I’ll have to create it myself unless someone else wants to chime in with more info