Error: Failed to save a MetricsBin due to constraint violation

Document ID : KB000008314
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

The following log messages may be seen within the gateways ssg_0_0.log file:

 

com.l7tech.server.service.ServiceMetricsServicesImpl: Failed to save a MetricsBin due to constraint violation 

org.hibernate.util.JDBCExceptionReporter: SQL Error: 1062, SQLState: 23000

org.hibernate.util.JDBCExceptionReporter: Duplicate entry 'xxxxxxxxxxxxxxx' for key 'nodeid' 

Environment:
This situation has been seen on the 8.x release of the gateway
Cause:

There is a known defect in the 8.x release of the gateway where restarting the gateway by executing:

 

service ssg restart

 

might not bring down the gateway processes gracefully resulting in multiple gateway processes

running which lead to the messages in question being seen.

 

 

Resolution:

This can be resolved in the interim by performing the following procedure: 

1. Stop the Gateway service: service ssg stop 

2. Kill all remaining Gateway processes: ps awwx | grep [G]ateway.jar | awk '${print $1}' | xargs kill -9 

3. Start the Gateway service: service ssg start

 

We would suggest to stop the gateway going forward by executing:

 

service ssg stop

 

We would suggest to start the gateway going forward by executing:

 

service ssg start

 

This situation would also be addressed by upgrading to gateway release 9.x