Friday, 10 July 2009

Cannot insert duplicate key row in object 'dbo.UserMemberships' - Event ID: 7888

On our front-end server the following error occurred:

Event Type: Error
Event Source: Office SharePoint Server
Event Category: Office Server General
Event ID: 7888

Description:
A runtime exception was detected. Details follow.
Message: Cannot insert duplicate key row in object 'dbo.UserMemberships' with unique index 'CX_UserMemberships_RecordId_MemberGroupId_SID'.
The statement has been terminated.

Techinal Details:
System.Data.SqlClient.SqlException: Cannot insert duplicate key row in object 'dbo.UserMemberships' with unique index 'CX_UserMemberships_RecordId_MemberGroupId_SID'.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
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 Microsoft.Office.Server.Data.SqlSession.ExecuteNonQuery(SqlCommand command)
at Microsoft.Office.Server.UserProfiles.WSSSynchSqlSession.SynchExecuteNonQuery(SqlCommand cmd, Boolean throwOnFail)
at Microsoft.Office.Server.UserProfiles.WSSSynchSqlSession.SynchExecuteNonQuery(SqlCommand cmd)
at Microsoft.Office.Server.UserProfiles.SiteSynchronizer.WriteChangeLogConsumed()
at Microsoft.Office.Server.UserProfiles.SiteSynchronizer.Synch()
at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock)

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Problem
The Profile database could not be synchronised. There were a couple of ‘databases’ that generated errors when Sharepoint synchronised the profiles.

Solution
(Source)

DEALOGIC:

HI delmarvamonkey, contacted Microsoft who told me it was because of an
old database that couldn't synchronise in the config database:

As
discussed on the phone, here the link to the command for deleting unsynchronized
databases:

http://technet.microsoft.com/en-us/library/cc263196.aspx

IN your case, just use:
stsadm -o sync -listolddatabases 1 to see
the old databases,
and: stsadm -o sync -deleteolddatabases 1 to delete the
links in the config_DB.

If you run these commands it should do it, but I
haven't actually tried it on the production server as yet.

I tried this solution and found that my problems disappeared and no futher errors occurred.

No comments:

Post a Comment