Support Questions

Find answers, ask questions, and share your expertise

Internal Exception: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'public_host_name' at row 1

avatar
New Contributor

Hi. I am using HDP 3.0.0.0 cluster with mysql 5.7. I have 3 nodes. 1 name node and 2 data nodes. I shutdown the cluster 2 days ago and all the services were up and running. But now that I have restarted it, Only data node 1 has completely started (that too after I started some of the services manually, they were aborted) and for name node and data node 2, most of the services have been aborted and I am not able to manually start them. In ambari-agent.log of the name node, I see the following error:

	{"status":"OK","exitstatus":1,"log":"Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.2.v20151217-774c696): org.eclipse.persistence.exceptions.DatabaseException\nInternal Exception: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'public_host_name' at row 1\nError Code: 1406\nCall: UPDATE hosts SET total_mem = ?, public_host_name = ? WHERE (host_id = ?)\n\tbind => [3 parameters bound]\nQuery: UpdateObjectQuery(org.apache.ambari.server.orm.entities.HostStateEntity@d3c9268f)","id":-1}_

	DEBUG 2018-12-17 12:27:07,352 transport.py:189 - Received frame: 'MESSAGE', headers={'content-length': '533', 'destination': '/user/', 'message-id': '282adf65-3581', 'content-type': 'application/json;charset=UTF-8', 'correlationId': '0', 'subscription': 'sub'}, body='{"status":"OK","exitstatus":1,"log":"Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.2.v20151217-774c696): org.eclipse.persistence.exceptions.DatabaseException\\nInternal Exception: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column \'public_host_name\' at row 1\\nError Code: 1406\\nCall: UPDATE hosts SET total_mem = ?, public_host_name = ? WHERE (host_id = ?)\\n\\tbind => [3 parameters bound]

Now, this may seem surprising but I faced the same error while installing the HDP cluster, at step #3 (confirm hosts) but after resetting ambari server and recreating all the users and databases, it got fixed.

I am also facing the same error in HDF 3.2.0 installation at step #3

Would greatly appreciate to know the reason for this.

3 REPLIES 3

avatar

Hi @Qureshi F,

It looks like your public_host_name is greater than 255 which is maxed characters allowed by ambari.

Can you do a

hostname -f

command on the host where namenode is installed and see what the response.

if it's not the hostname supposed to be please correct it and restart ambari-agent.

Hope this helps !

avatar

@Qureshi F,

Do you managed to resolve this issue.

If yes please share the analysis, accept the best answer and close this thread 🙂

avatar
@Qureshi F

The column in question should be able to hold a hostname that is 255 characters long. Either the _hosts_ table in your database has been modified or your host name is really large.

Can you log into your Ambari database and execute

DESCRIBE hosts;

Then post the results. No data will be returned, just the table definition.

If the column type for hosts.public_host_name does not look lime the following, then someone or something has changed it and we need to get it fixed.

public_host_name VARCHAR(255),

I have to assume that your hostnames are not larger than 255 characters long.