Error in FIND after update

Vote:
 

Hello,

Recently we have updated out Episerver version and also FIND version. Now FIND version stands at 13.0.4.

We deployed at two server. One is testing and one is PROD. On testing everything seems to be working fine. When we deployed on PROD it gave error that findIndexQueueLoadItems already exists in DB. We checked it and it was inside the Stored Procedures. We deleted the file from DB. It gave error on 3-4 other files and we deleted them and then it was working. Episerver created the stored procedure again. 

We didn't had that issue on TEST enviornment. But now one of the pages are not being indexed in FIND. When we see in those particular stored procedure, the code on TEST and PROD are different. 

On TEST one of the stored procedures are like

USE [dbUdePortalenFeature]
GO
/****** Object:  StoredProcedure [dbo].[findIndexQueueSave]    Script Date: 12/17/2018 9:36:33 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
 
ALTER PROCEDURE [dbo].[findIndexQueueSave]
(
    @action int,
	@cascade bit,
	@enableLanguageFilter bit,
	@item nvarchar(255),
	@itemlanguage nvarchar(255),
	@timeStamp datetime,
	@hash int
)
AS
 
BEGIN
	SET NOCOUNT ON
	
	if not exists(select * from tblFindIndexQueue where Hash=@hash AND LastRead IS NULL) 
		BEGIN 
			insert into tblFindIndexQueue(Action, [Cascade], EnableLanguageFilter, Item, [Language], TimeStamp, [Hash]) values(@action, @cascade, @enableLanguageFilter, @item, @itemlanguage, @timeStamp, @hash) 
		END 
	else
		BEGIN
			update tblFindIndexQueue set TimeStamp = @timeStamp where Hash=@hash
		END
END 
 

On PROD the same Store procedure looks like

USE [dbUdePortalenEpi10]
GO
/****** Object:  StoredProcedure [dbo].[findIndexQueueSave]    Script Date: 12/17/2018 9:36:39 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[findIndexQueueSave]
(
    @action int,
	@cascade bit,
	@enableLanguageFilter bit,
	@item nvarchar(255),
	@itemlanguage nvarchar(255),
	@timeStamp datetime,
	@hash int
)
AS
 
BEGIN
	SET NOCOUNT ON
	
	if not exists(select * from tblFindIndexQueue where Hash=@hash) 
	BEGIN 
		insert into tblFindIndexQueue(Action, [Cascade], EnableLanguageFilter, Item, [Language], TimeStamp, [Hash]) values(@action, @cascade, @enableLanguageFilter, @item, @itemlanguage, @timeStamp, @hash) 
	
	END 
END 

Any thoughts??

#199880
Dec 17, 2018 10:09
Vote:
 

What about this? 

https://world.episerver.com/documentation/Release-Notes/ReleaseNote/?releaseNoteId=FIND-3671

It id s bug and is fixed in EPiServer.Find 13.0.5

#199881
Dec 17, 2018 11:15
Vote:
 

Thanks for the response. Now when I update to FIND 13.0.5 and run the webiste I get this error

Column name 'LastRead' does not exist in the target table or view.

[DataException: Failed to update database during execution of statement 'IF NOT EXISTS (SELECT name FROM sys.indexes  
            WHERE name = N'IDX_tblFindIndexQueue_Indexed')
BEGIN
    CREATE NONCLUSTERED INDEX [IDX_tblFindIndexQueue_Indexed] 
    ON [dbo].[tblFindIndexQueue] ([Hash], [LastRead])
END
']
#199884
Dec 17, 2018 12:21
Vote:
 

Hello,

How did you upgrade packages and run updating database in PROD? 

You can see all sql script updates for episerver find 13.0.5 here

 

The script to add more column LastRead and  alter procedure findIndexQueueSave belongs to 12.4.2.sql file

It seems this script was not run in your PROD. Please check your deploy progress and update database on PROD. I guest that there is availabe 12.4.2 version in table tblFindDatabaseVersion in your PROD database although this script has not been run yet.

#199930
Dec 18, 2018 9:14
Vote:
 

Thanks for the response. Should I run all the scripts manually then? All the .sql files in that folder?

BTW I run this in web.config <episerver.framework updateDatabaseSchema="true">

#199932
Dec 18, 2018 13:43
Vote:
 

Hi,

Although there was an exception when automatically updating database schema in version 13.0.4, but the PROD database was updated. Even you upgrade new version 13.0.5 then these missing updates could not be fixed except you know exactly how to restore database before run upgrading the version 13.0.4 and run installing version 13.0.5 from scratch.

I suggest that you should remove the table tblFindDatabaseVersion in PROD and run manually all episerver find sql update scripts in the order from low version to high version

#199946
Edited, Dec 19, 2018 9:03
Vote:
 

Thanks a lot. But just to be sure, table 

tblFindIndexQueue

should have column named LastRead?

And the two sql scripts I have given in my original question which one is correct? The first one or the second one?

#199948
Dec 19, 2018 10:01
Vote:
 

Hi,

In your original question then the first one on TEST is correct. Because this one belongs to version 12.4.2, the second one is the script for version 12.2.8 - the lower version. And the table tblFindIndexQueue should have column named LastRead because this column is used for some new procedure updates later

#199952
Dec 19, 2018 10:24
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.