From the exception we could figure out that the problem is due to the duplicate keys which resulted in the unique key constraint exception. We maintain the individual tables max keys in the esp_long_keys which will be used to determine the next max key for a table. We could see there is some difference in the individual tables and the esp_longkeys, due to which it couldn't determine the key properly. After updating the max ids properly, the server started well.