Updating from Episerver Find 13.0.3 to 13.0.4 fails because of create table tblFindIndexQueue statement

Vote:
 

So was updating an existing Episerver CMS project which was using Episerver Find 13.0.3 but the update script for 13.0.4 (EPiServer.Find.Cms) fails because it tries to create the table tblFindIndexQueue but it already exists. Going to create a support ticket about this.

Initialize action failed for Initialize on class EPiServer.Data.DataInitialization, EPiServer.Data, Version=11.10.4.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7
   at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()
   at EPiServer.Framework.Initialization.InitializationEngine.ExecuteTransition(Boolean continueTransitions)
   at EPiServer.Framework.Initialization.InitializationEngine.Initialize()
   at EPiServer.Framework.Initialization.InitializationModule.<>c.b__7_0(InitializationEngine e)
   at EPiServer.Framework.Initialization.InitializationModule.EngineExecute(HostType hostType, Action`1 engineAction)
   at EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType)
   at EPiServer.Global..ctor()
   at [REMOVED].EPiServerApplication..ctor()
   at ASP.global_asax..ctor()

Failed to update database during execution of statement 'CREATE TABLE [dbo].[tblFindIndexQueue](
	[Action] [smallint] NOT NULL,
	[Cascade] [bit] NOT NULL,
	[EnableLanguageFilter] [bit] NOT NULL,
	[Item] [nvarchar](255) NOT NULL,
	[Language] [nvarchar](255) NULL,
	[TimeStamp] [datetime] NOT NULL,
	[Hash] [int] NULL
) ON [PRIMARY]
'
   at EPiServer.Data.SchemaUpdates.Internal.ScriptRunnerImpl.<>c__DisplayClass5_0.b__0()
   at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass33_0`1.b__0()
   at EPiServer.Data.Providers.Internal.NoRetriesPolicy.Execute[TResult](Func`1 method)
   at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.ExecuteTransaction[TResult](Func`1 action)
   at EPiServer.Data.SchemaUpdates.Internal.ScriptRunnerImpl.ExecuteScript(IDatabaseExecutor databaseHandler, StreamReader stream)
   at EPiServer.Data.SchemaUpdates.Internal.ScriptRunnerImpl.<>c__DisplayClass2_0.b__0()
   at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass32_0.b__0()
   at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass33_0`1.b__0()
   at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method)
   at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.ExecuteTransaction[TResult](Func`1 action)
   at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.ExecuteTransaction(Action action)
   at EPiServer.Data.SchemaUpdates.Internal.ScriptRunnerImpl.ExecuteScripts(IDatabaseExecutor databaseHandler, IEnumerable`1 streams)
   at EPiServer.Data.SchemaUpdates.Internal.ScriptExecutorImplementation.ExecuteEmbeddedZippedScripts(String connectionString, Assembly assembly, String resourcePath)
   at EPiServer.Find.Cms.FindDatabaseSchemaUpdater.Update(ConnectionStringSettings connectionStringSettings)
   at EPiServer.Data.SchemaUpdates.Internal.SchemaUpdaterWrapper.Update(ConnectionStringOptions ConnectionStringOption)
   at EPiServer.Data.SchemaUpdates.Internal.DatabaseSchemaManagerImplementation.EnsureDatabaseSchema(DataAccessOptions dataAccessOptions)
   at EPiServer.Data.DataInitialization.ValidateDatabaseSchema(InitializationEngine context)
   at EPiServer.Data.DataInitialization.Initialize(InitializationEngine context)
   at EPiServer.Framework.Initialization.Internal.ModuleNode.<>c__DisplayClass2_0.b__0()
   at EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key)
   at EPiServer.Framework.Initialization.Internal.ModuleNode.Initialize(InitializationEngine context)
   at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()

There is already an object named 'tblFindIndexQueue' in the database.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at EPiServer.Data.SchemaUpdates.Internal.ScriptRunnerImpl.<>c__DisplayClass5_0.b__0()

Find database version check statement returns: 12.4.2

Debug from script execution:

2018-10-09 07:20:39,150 [1] DEBUG EPiServer.Data.SchemaUpdates.Internal.ScriptExecutorImplementation: Execute Script: ''1.0.1.sql', 'EPiServer.Find.Cms, Version=13.0.4.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7', 'EPiServer.Find.Cms.Resources.FindSqlUpdateScripts.zip'' 
2018-10-09 07:20:39,207 [1] DEBUG EPiServer.Data.SchemaUpdates.Internal.ScriptRunnerImpl: Script validation: 0 - Already correct database version
2018-10-09 07:20:39,208 [1] DEBUG EPiServer.Data.SchemaUpdates.Internal.ScriptExecutorImplementation: Execute Script: ''12.2.8.sql', 'EPiServer.Find.Cms, Version=13.0.4.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7', 'EPiServer.Find.Cms.Resources.FindSqlUpdateScripts.zip'' 
2018-10-09 07:20:39,223 [1] DEBUG EPiServer.Data.SchemaUpdates.Internal.ScriptRunnerImpl: Script validation: 1 - Upgrading database

So the script 12.2.8 doesn't check for the table existance but just tries to create it.

#197605
Oct 09, 2018 6:40
Vote:
 

Could you help us printing out the tblFindDatabaseVersion in your CMS database?

We can trace the issue easy with your help.

#197614
Edited, Oct 09, 2018 8:20
Vote:
 

Hi Son, I had that in the first post, Find database version check statement returns: 12.4.2

SELECT top(1) Major, Minor, Patch FROM tblFindDatabaseVersion ORDER BY Major DESC, Minor DESC, Patch DESC

12.4.2

and

select * from tblFindDatabaseVersion

Id, Major, Minor, Patch
 1, 1, 0, 1
 2, 12, 4, 2
#197615
Oct 09, 2018 8:26
Vote:
 

Hi Antti,

I could confirm this is upgrading bug. And in your case, it can be working around by executing this line below in your cms database:

insert into tblFindDatabaseVersion(Major, Minor, Patch) values(12,2,8)

Hope this help.

Thanks and regards,

/Son Do

#197616
Oct 09, 2018 8:29
Vote:
 

Experiencing the same issue on environments when upgrading, so looks like you're not the only one.

#197617
Oct 09, 2018 8:30
Vote:
 

Thanks Son and sorry if my version response sounded rude, by no means I wanted to be rude :), the version information was in the middle of the texts so easily can be missed.

I already rolled back the Find update and just updated CMS. Do you know if you are able to release an updated NuGets for Find in next week release or even sooner? I would rather not poke the DB manually as I would need to do it in all envrionments + instruct the team to do the same. We can wait for a fixed NuGet package.

#197619
Oct 09, 2018 8:37
Vote:
 

Thank for your patience (Y)

We will see what we can do.

/Son Do

#197629
Oct 09, 2018 9:30
Vote:
 

Seems like Antti has also been trying to update Find with equal amount of success as I have. Thanks a lot for fast communication!

I will also be waiting for updated nugets. 

#197633
Oct 09, 2018 9:44
Vote:
 

Seems like Antti has also been trying to update Find with equal amount of success as I have. Thanks a lot for fast communication!

I will also be waiting for updated nugets. 

#197634
Oct 09, 2018 9:44
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.