Mautic Community Forums

Bounce Processing Inserts Bad Data Type "Reason" - BUG

Hi, I’m new to this software so apologies if it is my fault somehow!



I’m running the cron job:

php /var/www/html/mautic/app/console mautic:email:send



and it is generating an error of:

An exception occurred while executing ‘INSERT INTO lead_donotcontact (date_added, reason, channel, channel_id, comments, lead_id) VALUES (?, ?, ?, ?, ?, ?)’ with params [“2016-07-31 14:49:02”, “bounced”, “email”, 2, “There were more than 3 attempts to send the email.”, 103836]:

SQLSTATE[HY000]: General error: 1366 Incorrect integer value: ‘bounced’ for column ‘reason’ at row 1




Checking the database I see that the column “Reason” is an Int, yet to accept data like “Bounced” needs to be something like a Varchar.



I’m tempted to just change “Reason” from Int to VarChar but worried that may have some critical knock on effect.



What would be your advice?



Thanks in advance.

Hi, I’m new to this software so apologies if it is my fault somehow!

I’m running the cron job:
php /var/www/html/mautic/app/console mautic:email:send

and it is generating an error of:
An exception occurred while executing ‘INSERT INTO lead_donotcontact (date_added, reason, channel, channel_id, comments, lead_id) VALUES (?, ?, ?, ?, ?, ?)’ with params [“2016-07-31 14:49:02”, “bounced”, “email”, 2, “There were more than 3 attempts to send the email.”, 103836]:
SQLSTATE[HY000]: General error: 1366 Incorrect integer value: ‘bounced’ for column ‘reason’ at row 1

Checking the database I see that the column “Reason” is an Int, yet to accept data like “Bounced” needs to be something like a Varchar.

I’m tempted to just change “Reason” from Int to VarChar but worried that may have some critical knock on effect.

What would be your advice?

Thanks in advance.

This is the fix to your issue I believe:

https://github.com/mautic/mautic/pull/2141

It will be included to Mautic 2.1.0.

Hi Escopecz, that is definitely the issue. I assume that is a code submission but not part of the current stable distribution…

For the time being I have changed that column to a Varchar(255) and now my database is happily accepting that sql insert.

IS this a bad idea and should I revert it back to an Int?

It will allow you to save the information, but I don’t think the current code is able to work with that. The proper fix is mentioned above. If you’ll be able to test that PR and write a comment bellow it about how the test went, you can even win some prizes this month: https://www.mautic.org/blog/community/mautic-summer-games/