Mysql2::Error: Got a packet bigger than 'max_allowed_packet' bytes
Created by: sroth80021
I ran into an issue today in which the default mysql max_allowed_packet size (1 Mb I think) was not sufficient, and this caused a GitLab 500 error due to an internal MySQL error when a Merge Request with a large delta was saved.
The error started out with this text:
Started POST "/abcdef/merge_requests" for 127.0.0.1 at 2012-10-16 22:13:04 -0700 Processing by MergeRequestsController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"dbHat41zVt6dmrK3LGb2qhEFUdpGnJiGyUegQ4ZgguM=", "merge_request"=>{"source_branch"=>"constraint1", "target_branch"=>"master", "title"=>"Add a b c constraints", "assignee_id"=>"11"}, "project_id"=>"abcdef"} Completed 500 Internal Server Error in 384ms
ActiveRecord::StatementInvalid (Mysql2::Error: Got a packet bigger than 'max_allowed_packet' bytes: UPDATE merge_requests
SET st_diffs
= ...
I think the diff size exceeded 1 Mb.
I am using a default OOTB MySQL install/config on my Centos6 box. I think most users will be using OOTB MySQL configs.
I think it would be good if the docs stated that you might want to tweak this MySQL setting. I suspect over time we will find some more.
Something like this...
You may want to edit your MySQL configuration file, typically at /etc/my.cnf, and increase the maximum packet size. This may help if you perform large merge requests.
For example:
[mysqld] max_allowed_packet = 128M