I have gotten to a point where i’m not able to publish my site. When I click publish I’m getting an Litium.Data.DataException. Publish only works if I’m adding one certain block and only that block. Even if I’m removing all blocks it doesn’t work.
Is there any way that I can delete my unpublished pages/blocks or start over or something?
To cleanup in the database you can run the following script when it happen.
SET NOCOUNT ON;
DECLARE xCur CURSOR FOR
SELECT OwnerEntitySystemId, Id, Discriminator
FROM Blocks.BlockItemLink
GROUP BY OwnerEntitySystemId, Id, Discriminator
HAVING COUNT(1) <> (MAX(SortIndex) + 1)
DECLARE @ownerEntitySystemId uniqueidentifier, @id nvarchar(100), @discriminator nvarchar(100)
DECLARE @tmpTbl TABLE(OwnerEntitySystemId uniqueidentifier, Id nvarchar(100), Discriminator nvarchar(100), [Index] int, [NewIndex] int)
OPEN xCur
FETCH xCur INTO @ownerEntitySystemId, @id, @discriminator
WHILE @@FETCH_STATUS = 0 BEGIN
With UpdateData As
(
SELECT SortIndex, (ROW_NUMBER() OVER (ORDER BY [SortIndex]) -1) AS [NewIndex]
FROM Blocks.BlockItemLink
WHERE OwnerEntitySystemId = @ownerEntitySystemId
AND Id = @id
AND Discriminator = @discriminator
)
UPDATE Fields SET SortIndex = [NewIndex]
FROM Blocks.BlockItemLink AS Fields
INNER JOIN UpdateData ON Fields.SortIndex = UpdateData.SortIndex
AND Fields.OwnerEntitySystemId = @ownerEntitySystemId
AND Fields.Id = @id
AND Fields.Discriminator = @discriminator
FETCH xCur INTO @ownerEntitySystemId, @id, @discriminator
END
CLOSE xCur
DEALLOCATE xCur
SET NOCOUNT OFF;
I haven’t got any notification that it should exists after the updated beta package that we was releasing.
If you have stale data in the database and doing the upgrade the database is not correcting itself so in that case you need to run the above script once to fix the stale data.
If you still have an issue after running the script again, can you open a support ticket and share your version of the database so we can investigate why it’s not working for you.
I have the same issue as Emil. But i have a database from version 7 not an upgraded one.
Until now i have managed to get into this state 4 times. The script solves it but it is annoying to retrieve errors all the time you change blocks.
43723 is the bug i’m refering to. I can see that I did not specify a detailed description of the problem but
I’m getting the same error as in bug 44185 so I’m looking forward to the service release version.