PSIcapture Capture Service: Violation of PRIMARY KEY constraint 'PK__Configur__C41E028836A3156B'. Cannot insert duplicate key.

Problem:

Installed a fresh PSIcapture installation. Then, after installation was complete, copied the ProgramData folder from a previous installation. After, Capture Services did not stay started and software would not function in this state.

Capture.Services log had this entry:

[12/5/2013 11:20:16 AM - Error - v5.0.0.23]
The following exception(s) occurred loading the Configuration service.
The following error(s) occurred:
Violation of PRIMARY KEY constraint 'PK__Configur__C41E028836A3156B'. Cannot insert duplicate key in object 'dbo.Configuration_Shared'. The duplicate key value is (psigen.capture.modules.captureserver.mailgatewaysettings).
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at PSIGEN.Capture.Data.Database.ExecuteRowInsert(DbDataReader reader, DbCommand insert)
   at PSIGEN.Capture.Data.Database.MigrateFrom(Database fromDatabase)
   at PSIGEN.Capture.Data.ServiceDatabase.MigrateFromSQLCE(String sourcePassword, Boolean deleteSource)
   at PSIGEN.Capture.Data.Configuration.ConfigurationDataLayer.CreateDatabase(String dataPath)
   at PSIGEN.Capture.Modules.Configuration.ConfigurationService.Initialize(Dictionary`2 properties)
   at PSIGEN.Capture.Services.ServiceManager.LoadService(XElement serviceNode)

 

Solution:

Follow these steps to fix this error.

  1. Go the the ProgramData folder.
  2. Within Configuration cut and paste the .sdf, .mdf, and .ldf files into a backup location out of the Configuration folder.
  3. Go to the backup Folder C:\ProgramData\PSIGEN\Capture.Services\Configuration\Backup
  4. Copy the latest .sdf file within this location.(If the customer was on an earlier version of the configuration, it will be named, Configuration.xx.sdf) to this location C:\programdata\PSIGEN\Capture.Services\Configuration
  5. Rename the file to Configuration.sdf.
  6. Start Capture Services.
  7. The Capture Service should start rebuilding the .mdf and .ldf files automatically from the 4.6 installation.
  8. If they created new document types with the .mdf file you copied use the Utility Ken made to extract the document types and re-add them into the installation.

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.