WSS Content Deployment Violation of Primary Key Constraint Error

Recently at a client’s site, we began experiencing consistent failures of an incremental content deployment job with the following error:

Violation of PRIMARY KEY constraint ‘PK__#ExportObjects____462064A9’. Cannot insert duplicate key in object ‘dbo.#ExportObjects’. 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.SharePoint.Utilities.SqlSession.ExecuteNonQuery(SqlCommand command) at Microsoft.SharePoint.Deployment.SPExport.CalculateObjectDependencies(Boolean linksOnly) at Microsoft.SharePoint.Deployment.SPExport.CalculateObjectsToExport() at Microsoft.SharePoint.Deployment.SPExport.Run()

According to this blog entry, this is caused when a single page is approved more than once between incremental updates. Microsoft has a hotfix for this issue that is available via a support call (see Microsoft KB Article 936867).

 I believe that a work around (without the hotfix mentioned above) is to perform a full content deployment job (instead of the incremental). I will be attempting this work around later this evening and will let you know of the results.

 Update

The work around that I mentioned earlier didn’t work. It only left me with the following failure during a full deployment:

Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). at System.Guid..ctor(String g) at Microsoft.SharePoint.Deployment.FieldTemplateSerializer.ParseLookups(SPField fieldTemplate, ExportObjectManager objectManager) at Microsoft.SharePoint.Deployment.FieldTemplateSerializer.GetDataFromObjectModel(Object obj, SerializationInfo info, StreamingContext context) at Microsoft.SharePoint.Deployment.DeploymentSerializationSurrogate.GetObjectData(Object obj, SerializationInfo info, StreamingContext context) at Microsoft.SharePoint.Deployment.XmlFormatter.SerializeObject(Object obj, ISerializationSurrogate surrogate, String elementName, Boolean bNeedEnvelope) at Microsoft.SharePoint.Deployment.XmlFormatter.Serialize(Stream serializationStream, Object topLevelObject) at Microsoft.SharePoint.Deployment.ObjectSerializer.Serialize(DeploymentObject deployObject, Stream serializationStream) at Microsoft.SharePoint.Deployment.SPExport.SerializeObjects() at Microsoft.SharePoint.Deployment.SPExport.Run()

I am not sure if the two errors are related to the same source. However, it is interesting to know that the incremental job fails even when testing the job and the full deployment passes when tested. In the end, both deployment approaches fail. Leading me to beleive that the only option is to obtain the hotfix from Microsoft.