Mautic Community Forums

Cannot send emails (An exception occurred while executing 'INSERT INTO page_redirects)

Your software
My Mautic version is: 4.1.0
My PHP version is: 7.4.27
My Database type and version is: MySQL (mysqli) 8,.0.27

Your problem
My problem is: Cannot send emails, getting sql related error

These errors are showing in the log:

[2021-12-16 02:27:43] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: "An exception occurred while executing 'INSERT INTO page_redirects (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, redirect_id, url, hits, unique_hits) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [1, "2021-12-16 00:27:43", 1, "Nikos Lykakis", null, null, null, null, null, null, "4a5e3dad01994acab728b06bd", "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x77\x77\x77\x2e\x62\x6f\x75\x72\x64\x65\x6c\x61\x2e\x63\x6f\x6d\x2f\x5d\xce\xa3\xcf\x5f\xce\xbd\xce\xb4\xce\xb5\xcf\x83\xce\xb7\x2f", 0, 0]:  Incorrect string value: '\xCF_\xCE\xBD\xCE\xB4...' for column 'url' at row 1" at D:\inetpub\vhosts\*****.com\wwwroot\m.*****.com\public\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\AbstractMySQLDriver.php line 128 {"exception":"[object] (Doctrine\\DBAL\\Exception\\DriverException(code: 0): An exception occurred while executing 'INSERT INTO page_redirects (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, redirect_id, url, hits, unique_hits) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [1, \"2021-12-16 00:27:43\", 1, \"Nikos Lykakis\", null, null, null, null, null, null, \"4a5e3dad01994acab728b06bd\", \"\\x68\\x74\\x74\\x70\\x73\\x3a\\x2f\\x2f\\x77\\x77\\x77\\x2e\\x62\\x6f\\x75\\x72\\x64\\x65\\x6c\\x61\\x2e\\x63\\x6f\\x6d\\x2f\\x5d\\xce\\xa3\\xcf\\x5f\\xce\\xbd\\xce\\xb4\\xce\\xb5\\xcf\\x83\\xce\\xb7\\x2f\", 0, 0]:\n\nIncorrect string value: '\\xCF_\\xCE\\xBD\\xCE\\xB4...' for column 'url' at row 1 at D:\\inetpub\\vhosts\\*****.com\\wwwroot\\m.*****.com\\public\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Driver\\AbstractMySQLDriver.php:128, Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\StatementError(code: 0): Incorrect string value: '\\xCF_\\xCE\\xBD\\xCE\\xB4...' for column 'url' at row 1 at D:\\inetpub\\vhosts\\*****.com\\wwwroot\\m.*****.com\\public\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\StatementError.php:19)"} []

Steps I have tried to fix the problem:

I have tried switching between mysql_pdo and mysqli but didn not help.
Weirdly, switching to PHP8 solved this particular problem (but created others, as php8 is not yet supported by mautic)

I have tried to track this down.

I believe this is indeed a bug, because when I try another email, it works.

It’s something on that particular email that creates the problem.

The email that hits the problem is in Greek, it has several links in it, and it also have an image.

Please help.

Hi,
I think the issue is here:

Incorrect string value: '\xCF_\xCE\xBD\xCE\xB4

What is the URL you added to the link in the email? Any weird characters?

HI,

I just checked all links in that email. There are no weird characters, are links are in the .com/category/post/ format.

If you want i can give you access to my Mautic installation so that you can debug it.

Thank you

Also, the “Send example” function works fine.

Send example won’t create certain fields.
Can you plz remove all links and see what happens?

This exists on the plain text version of the email, and looks suspicious:

Domain.com [https://www.domain.com/]Σύνδεση/Εγγραφή

Yes, that was the problem.

So the hunch was good, I’m happy you found it.