I have a problem with my rails app, when trying to create an object that has a data column of type LONGTEXT in which I store JSON string. The problem happens only when I'm trying to create/update an object with quite a big data value (4M characters). The error I receive is:
ActiveRecord::StatementInvalid Mysql2::Error: MySQL client is not connected: ROLLBACK
At first, I thought that I'm trying to store more data than Mysql supports, however, it seems that is not the problem. Does anyone have any idea what could cause this?
EDIT: this is adapter configuration:
adapter: mysql2
username: [username]
password: [password]
host: [host]
port: [port]
reaping_frequency: 0 # could this line cause the problem?
UPDATE:
The solution I found after playing with multiple variables and searching for other posts with similar problems is changing the servers max_allowed_packet to a higher value since reading the MySQL docs and some recommendations in the comments it seemed as the most likely culprit. However, we still experience this problem in some environments even after changing it so there might be a few other variables influencing this.