Problems with Publishing site

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?

Litium version: 7 beta

2 Likes

Please report all bugs found in the beta at https://docs.litium.com/support/bugs/report-a-bug

This is a known bug and already fixed.

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;

Is this fixed in the release version of Litium 7? Migrated from Beta yesterday and got the same error today.

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.

@rrogne or @emilsjog Can you report a bug on DOCs (https://docs.litium.com/support/bugs/report-a-bug) with the step that you are doing do reproduce the issue?

Still having problems with this.
'Litium.Data.DataException: Database operation expected to affect 1 row(s) but actually affected 0 row(s). ’

Should I report another bug? I did report a bug on this weeks ago and the status on that says ‘under investigation’.

What I can find is two bugs that are very similar

  • 43723 - that was reported on beta and already solved by 43536
  • 44185 - that was reported on 7.0.0 version and will be included in a service release version that we preparing

What is the bug number for the bug that you reported?

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.