How to fix this problem :
change the value of the max_allowed_packet
variable in the configuration of your MySQL server.
How to know how much over what's allowed you are : not sure, but I would say that checking the size (in bytes) or your insert
query should give you an idea.
For more informations, you should take a look at the following section of the MySQL manual : C.5.2.10. Packet too large.