UTF 8 encoded subject breaks RT

Hi,

just encountered an issue where the following subject line results in an error from RT when attempting to load the ticket:

Subject: =?utf-8?B?aFNvIFJlZjrCoCBDQVMtOTM5NTAtRjlUOcKgUmU6IExFRFgx?=
=?utf-8?B?IEFjY2VzcyBDUk06MDA5NTAwMTE1Nzc=?=

I don’t know of any way to validate the header line other than try viewing it in a web client, it displays fine in Roundcube webmail. Also I’m not sure why there are two lines.

The error shown on the console was:

rt RT: [32011] Couldn’t create a ticket: Internal Error: Couldn’t execute the query 'INSERT INTO Tickets (Priority, LastUpdated, Creator, Resolved, Due, Starts, Created, Started, Subject, Queue, LastUpdatedBy, SLA, Status, Type) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'Incorrect string value: ‘\xA0 CAS-…’ for column ‘Subject’ at row 1
Jun 19 12:01:20 rt RT: [32011] Ticket creation failed: hSo Ref: CAS-93950-F9T9 Re: LEDX1 Access CRM:00950011577: Ticket could not be created due to an internal error

Anyone shed any light on whether the subject header is valid and/or if I can do anything in RT to avoid this issue?

thanks, Andy.

Well…seem look almost my problem Problem with UTF-8 in subject

Can you be a little more precise on which platform, version, etc… you run your RT ?

Regards

Hi Albert,

sure, details are:

RT 4.4.1
Perl 5.24.1
OS FreeBSD 10.3-RELEASE-p18

Did you not get any responce to your issue so far?

thanks, Andy.

So very close to me, I use FreeBSD 11 (but I don’t think they are lot of difference with FreeBSD 10) with perl5-5.24.1_1 and RT 4.2.13_3.

Last time I got this problem it’s because some problem between p5-Encode with RT. So I try to downgrade p5-Encode to 2.89 and 2.88 no luck.

I will keep this forum inform if I get any progress.

Regards.

I forget to ask if your problem just appear or it’s after some upgrade (pkg or anything).

So I can confirm the problem on fresh install of FreeBSD 11 + rt 4.2.13_3 and all ports up2date the exact same problem.

When a ticket is created with some encoding (ISO or UTF-8) in the subject the content of the ticket was not created with same kind of error

Jun 21 15:05:52 FQDN RT: [59579] RT::Handle=HASH(0x81b040180) couldn't execute the query 'INSERT INTO Attachments (Filename, Created, MessageId, Parent, ContentEncoding, ContentType, Creator, Headers, Subject, Content, TransactionId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' at /usr/local/lib/perl5/site_perl/DBIx/SearchBuilder/Handle.pm line 599. #011DBIx::SearchBuilder::Handle::SimpleQuery(RT::Handle=HASH(0x81b040180), "INSERT INTO Attachments (Filename, Created, MessageId, Parent"..., undef, "2017-06-21 13:05:52", "20170621130551.GL1421\@io.chezmoi.fr", 0, "none", "text/plain", ...) called at /usr/local/lib/perl5/site_perl/DBIx/SearchBuilder/Handle.pm line 352 #011DBIx::SearchBuilder::Handle::Insert(RT::Handle=HASH(0x81b040180), "Attachments", "Filename", undef, "Created", "2017-06-21 13:05:52", "MessageId", "20170621130551.GL1421\@io.chezmoi.fr", ...) called at /usr/local/lib/perl5/site_perl/DBIx/SearchBuilder/Handle/mysql.pm line 36 #011DBIx::SearchBuilder::Handle::mysql::Insert(RT::Handle=HASH(0x81b040180), "Atta
Jun 21 15:05:52 FQDN RT: [59579] Attachment insert failed: Incorrect string value: '\xE9 \xE0 et...' for column 'Headers' at row 1
Jun 21 15:05:52 FQDN RT: [59579] Skipping scrips for transaction #806240 (/usr/local/lib/perl5/site_perl/RT/Transaction.pm:181)

and we can easily see the “cutting” problem is still here. Because the subject is “Essai de é à et Cie”, and the thing RT try to insert in the database is only begin with the UTF-8 charaters. I
already check the table is correctly encoded with utf8_general_ci.

any clue will VERY welcome…

Regards.

Exact same beheavior with RT 4.4.1 and empty database (mysql), just default insert.

Jun 21 17:23:55 FQDN RT: [6294] DBD::mysql::st execute failed: Incorrect string value: '\xE9 \xE0' for column 'Subject' at row 1 at /usr/local/lib/perl5/site_perl/DBIx/SearchBuilder/Handle.pm line 586.
Jun 21 17:23:55 FQDN RT: [6294] RT::Handle=HASH(0x81c1cdba0) couldn't execute the query 'INSERT INTO Tickets (Starts, Creator, Queue, Priority, Resolved, Created, LastUpdated, Subject, Type, Due, Started, Status, LastUpdatedBy, SLA) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' at /usr/local/lib/perl5/site_perl/DBIx/SearchBuilder/Handle.pm line 599. #011DBIx::SearchBuilder::Handle::SimpleQuery(RT::Handle=HASH(0x81c1cdba0), "INSERT INTO Tickets (Starts, Creator, Queue, Priority, Resolv"..., "1970-01-01 00:00:00", 14, 1, 0, "1970-01-01 00:00:00", "2017-06-21 15:23:55", ...) called at /usr/local/lib/perl5/site_perl/DBIx/SearchBuilder/Handle.pm line 352 #011DBIx::SearchBuilder::Handle::Insert(RT::Handle=HASH(0x81c1cdba0), "Tickets", "Starts", "1970-01-01 00:00:00", "Creator", 14, "Queue", 1, ...) called at /usr/local/lib/perl5/site_perl/DBIx/SearchBuilder/Handle/mysql.pm line 36 #011DBIx::SearchBuilder::Handle::mysql::Insert(RT::Handle=HASH(0x81c1cdba0), "Tickets", "Starts", "1970-01-01 00:00:00", "Creator", 14, "Que
Jun 21 17:23:55 FQDN RT: [6294] Couldn't create a ticket: Internal Error: Couldn't execute the query 'INSERT INTO Tickets (Starts, Creator, Queue, Priority, Resolved, Created, LastUpdated, Subject, Type, Due, Started, Status, LastUpdatedBy, SLA) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'Incorrect string value: '\xE9 \xE0' for column 'Subject' at row 1
Jun 21 17:23:55 FQDN RT: [6294] Ticket could not be created due to an internal error

Regards.

Same problem as https://forum.bestpractical.com/t/problem-with-utf-8-in-subject/

Hi Albert,

I’ve been using RT for years and never had the issue, so seems likely it is related to upgrading Perl. I wasn’t even aware of the concept of using UTF 8 coding for the subject until I had this error,

thanks, Andy.

Hi Andy

As you can see in the link in my previous message, they are the solution to “fix” the problem.

You need to do

pkg delete -f p5-DBD-mysql-4.042

find in the /var/cache/pkg

the former

p5-DBD-mysql-4.041.txz

and do

pkg add p5-DBD-mysql-4.041.txz

If you don’t keep the /var/cache/pkg you can use portdowngrade (inside ports).

Regards

Ah ok great!
Will downgrade as described,

thanks! Andy.