Database initialization failed: Duplicate key name

Database initialization failed: Duplicate key name

 

Error Message

SERVER STUDIO; Database initialization failed; Duplicate key name; IX_trending_value_trending_id_date

Related Products

BMS Platform, Multi Protocol Server

Description

After installing a new release, during server start up, the database migration makes changes in the database according to the new release.

When the database migration is running into a timeout, some migration steps are missing. The system will repeat the migration.

After restarting the migration, the error message might appear.

Causes

Timeout is too short for large databases. SQL commands need too much time for execution.

Resolutions

  1. Open Core Studio > Server > System configuration ...

  2. In the section XDB Parameters set the option Command timeout for long running commands = 3600

  3. Stop server

  4. Open HeidiSQL and connect to the database (use credentials as defined in the XDB Parameters section)

  5. Open the database netx_ef_workspacename

  6. Select the table trending_value 

  7. On the tab folder Indexes remove the index IX_trending_value_trending_id_date 

  8. Save the changes

  9. Close HeidiSQL

  10. Open Core Studio again

  11. Start server 

  12. Expand the Item tree to NETx\Server\Database\MigrationStatus and wait until the value is not equal to "1"

  13. The logfile should not show any database related error messages

  14. Open Core Studio > Server > System configuration ...

  15. In the section XDB Parameters set the option Command timeout for long running commands = 300

  16. Restart server