Error 1:
Event Type: Error Event Source: Office SharePoint Server Event Category: Office Server General Event ID: 7888 Date: 4/25/2011 Time: 1:22:02 PM User: N/A Computer: SERVERNAME 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.SqlInternalConnection.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.
Error 2:
Event Type: Error Event Source: Office SharePoint Server Event Category: User Profiles Event ID: 5553 Date: 4/25/2011 Time: 1:22:02 PM User: N/A Computer: SERVERNAME Description: failure trying to synch site 3ddb699f-b03c-420a-98d2-4ed94982f8ee for ContentDB b9a1094c-492f-47e3-a374-a3a2f1f28020 WebApp ac248ab9-09d5-42c8-872c-66919c150c65. Exception message was Cannot insert duplicate key row in object ‘dbo.UserMemberships’ with unique index ‘CX_UserMemberships_RecordId_MemberGroupId_SID’. The statement has been terminated.. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Reason:
This occurs when I moved a site collection or content database from one web application to another. The SSP thinks the site is new and tries to insert data into the UserMemberships table that already exists there.
Resolution 1:
Open command prompt and change the path to C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12BIN
Type the following command in command prompt
| stsadm –o preparetomove –site <http://the error site> -oldcontentdb <guid of the content db listed in event log error> |
Type the following command in command prompt
| stsadm –o sync –deleteolddatabases 0 |
Check the list of content database by using the following command. The time for the list of content databases should be around the same time.
| stsadm –o sync –listolddatabases 0 |
Get the GUID of the content databases by running the following query in SQL Server.
| USE [WSS_CentralAdmin]SELECT Id, Name, ClassId, ParentId, Status, Version, Properties
FROM Objects |
Resolution 2:
Open command prompt and change the path to C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12BIN
Type the following command in command prompt
| stsadm –o deletecontentdb –url <http://the error site> -databasename <database name> |
Type the following command in command prompt
| stsadm –o addcontentdb –url <http://the error site> -databasename <database name> |
*The deletecontentdb does not delete the database in SQL.
**The 1st resolution is tedious. By using the 2nd resolution, the errors do not appear. Seem like another alternative to solve it.
Comments are closed