Mysql2::Error: Data too long for column 'output' at row 1
fulemul opened this issue · comments
Describe the bug
Postal version 2.3.1 is intermittently failing to send emails with the error: Mysql2::Error: Data too long for column 'output' at row 1
. This issue appears to be similar to previously reported incidents from 2022 and before; however, solutions from those incidents have not resolved the problem.
This is happening on a completely new installation of Postal, and all steps were followed according to the official documentation.
To Reproduce
Steps to reproduce the behavior are not fully determined as the issue is intermittent. It usually occurs during normal send operations.
- Send an email with Postal.
- Occasionally, the error
Mysql2::Error: Data too long for column 'output' at row 1
is observed. - The message fails to send and is queued for a retry.
Expected behavior
Emails should be sent without encountering a 'Data too long' error for the 'output' column.
Environment details
- OS: Ubuntu 22
- Postal version: 2.3.1
- Database: mariadb
- Installation type: docker
Additional information/context
The 'output' column in the relevant database table may need to be verified for adequate length. It is suggested that the issue might pertain to larger-than-expected data being written to the 'output' column.
Support Ref: J-RECCKY0PSB
Any assistance or guidance to resolve this would be greatly appreciated.
This happens when the data returned from the SMTP or HTTP Endpoint is longer than 255 characters. Most of the time this isn't an issue because these servers are not all that talkative but, regardless, it shouldn't fail.
I've pushed a fix for this which I'll release in 2.3.2 a bit later.
In the meantime, you can either disable strict mode on your database or make those columns bigger to accommodate the larger output.