I am seeing an issue staging from one of my sites. I can't push certain files to one of my sites. This occurs with files like .pdf, .jpeg and .pngs as well as pages that have images on them. The problem is with the database. It is trying to update the attachment history ID, but receives an error due to a foreign key constraint. This seems like a Kentico bug to me.
The error I am seeing is listed below.
SyncServer.ServerError: Exception occurred: [DataConnection.HandleError]: Query: INSERT INTO CMS_AttachmentHistory ([AttachmentName], [AttachmentExtension], [AttachmentSize], [AttachmentMimeType], [AttachmentBinary], [AttachmentImageWidth], [AttachmentImageHeight], [AttachmentDocumentID], [AttachmentGUID], [AttachmentIsUnsorted], [AttachmentOrder], [AttachmentGroupGUID], [AttachmentHash], [AttachmentTitle], [AttachmentDescription], [AttachmentCustomData], [AttachmentLastModified], [AttachmentHistoryGUID], [AttachmentSiteID], [AttachmentSearchContent], [AttachmentVariantDefinitionIdentifier], [AttachmentVariantParentID]) VALUES (@AttachmentName, @AttachmentExtension, @AttachmentSize, @AttachmentMimeType, @AttachmentBinary, @AttachmentImageWidth, @AttachmentImageHeight, @AttachmentDocumentID, @AttachmentGUID, @AttachmentIsUnsorted, @AttachmentOrder, @AttachmentGroupGUID, @AttachmentHash, @AttachmentTitle, @AttachmentDescription, @AttachmentCustomData, @AttachmentLastModified, @AttachmentHistoryGUID, @AttachmentSiteID, @AttachmentSearchContent, @AttachmentVariantDefinitionIdentifier, @AttachmentVariantParentID); SELECT SCOPE_IDENTITY() AS [ID] Caused exception: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_CMS_AttachmentHistory_AttachmentSiteID_CMS_Site". The conflict occurred in database "KenticoCMS10", table "dbo.CMS_Site", column 'SiteID'. The statement has been terminated.
I've tried everything I can think of, deleting the page on both source and destination and trying again, destroying the page on source and destination and trying again, I've even tried to push the file to the a freshly created site and get the error every time. This only occurs on one site on my install which confuses me even more. Has anyone seem this error before? Or any advice would definitely be appreciated.