Call to Cloudera Manager API results in Packet for query is too large

0 votes
2 views
asked Aug 20, 2017 in Hadoop by admin (4,410 points)
SummaryWhen you post data to Cloudera Manager REST API, and the data size is too large, you will see this error when CM tries to save to backend database: "causes": "could not execute statement", "Packet for query is too large"
Applies To
  • Cloudera Manager
  • Mysql or MariaDB
Symptoms
When using Cloudera Manager API to configure CDH service, and get below error:
/api/w8/clusters/cluster/serviceslyarn/roleConfigGroups.yarn-RESOURCEMANAGER-BASE/config?message=XYZ
 { "message":
"org.hibernate.exception.GenericJDBCException: could not execute statement", 
"causes": "could not execute statement", "Packet for query is too large (1057646 > 1048576). 
 You can change this value on the server by setting the max allowed packet' variable."
 }

 

Cause
If you run the show var command in a mysql session:
​mysql> show variables where Variable_name='max_allowed_packet';
It will show a default setting ( to 1M), which is smaller than what you are posting to Cloudera Manager. So CM fails to save it.

 
Instructions

Increase max_allowed_packet setting for Mysql/Mariadb used for Cloudera Manager.

Please refer to:
https://dev.mysql.com/doc/refman/5.7/en/packet-too-large.html

Also, Cloudera recommends some mysqld configuration when you setup your own CM backend db, and Cloudera recommends to set "max_allowed_packet" to 32 M:

https://www.cloudera.com/documentation/enterprise/latest/topics/cm_ig_mysql.html 

Please log in or register to answer this question.

...