You are viewing limited content. For full access, please sign in.

Question

Question

Laserfiche Forms Upgrade 10.3 from 9.2 - LFF3200-GeneralMigrationError

asked on March 10, 2020

The Laserfiche Forms Upgrade 10.3 from 9.2 ran successful for the installation. During the database upgrade, which is triggered when you navigate to the Forms Config website the database upgrade triggered an error. I'm writing this question so I can post the answer I found in hopes it will aid someone else.

 

The following are the artifacts I used:

I retrieved the following event information from the  Laserfiche – Forms – App – Admin log.

An error was encountered while updating the database. [LFF3200-GeneralMigrationError]

Details:
URL: 
Error: GeneralMigrationError
Date: 3/6/2020 3:08:38 PM (Central Standard Time)
HTTP Status Code: 400
Business Process ID: 0
Business Process Name: 

Stack Trace:
Caught exception: Laserfiche.Forms.CommonUtils.Exceptions.LFFormsException
Message: An error was encountered while updating the database. [LFF3200-GeneralMigrationError]
   at FormsConfig.Infrastructure.DatabaseInfo.UpgradeDatabase()
   at FormsConfig.Controllers.ConfigurationController.RunDatabaseUpgrade(DatabaseInfo databaseInfo, String Identity)

Inner exception: System.Data.Entity.Core.EntityException
Message: An error occurred while starting a transaction on the provider connection. See the inner exception for details.
   at System.Data.Entity.Core.EntityClient.EntityConnection.BeginDbTransaction(IsolationLevel isolationLevel)
   at System.Data.Entity.Core.EntityClient.EntityConnection.BeginTransaction()
   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
   at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesToStore(SaveOptions options, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction)
   at System.Data.Entity.Infrastructure.DbExecutionStrategy.Execute[TResult](Func`1 operation)
   at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesInternal(SaveOptions options, Boolean executeInExistingTransaction)
   at System.Data.Entity.Internal.InternalContext.SaveChanges()
   at Forms.Persistence.EntityFramework.Repositories.OptionRepository.SetFormsOptions(OptionKeys option, String value, Boolean commitChange, Nullable`1 tenantID)
   at FormsConfig.Infrastructure.DatabaseInfo.UpgradeDBData93_100(FormsConfigContext appContext, OptionRepository _optionrepo, MigrationLogger logger)
   at FormsConfig.Infrastructure.DatabaseInfo.UpgradeDatabase()

Inner exception: System.Data.SqlClient.SqlException
Message: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.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 asyncWrite)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
   at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext)
   at System.Data.Entity.Migrations.DbMigrator.ExecuteSql(MigrationStatement migrationStatement, DbConnection connection, DbTransaction transaction, DbInterceptionContext interceptionContext)
   at System.Data.Entity.Migrations.DbMigrator.ExecuteStatementsInternal(IEnumerable`1 migrationStatements, DbConnection connection, DbTransaction transaction, DbInterceptionContext interceptionContext)
   at System.Data.Entity.Migrations.DbMigrator.ExecuteStatements(IEnumerable`1 migrationStatements, DbTransaction existingTransaction)
   at System.Data.Entity.Infrastructure.TransactionContextInitializer`1.InitializeDatabase(TContext context)
   at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
   at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
   at System.Data.Entity.Infrastructure.CommitFailureHandler.BeganTransaction(DbConnection connection, BeginTransactionInterceptionContext interceptionContext)
   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
   at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.BeginTransaction(DbConnection connection, BeginTransactionInterceptionContext interceptionContext)
   at System.Data.Entity.Infrastructure.DbExecutionStrategy.Execute[TResult](Func`1 operation)
   at System.Data.Entity.Core.EntityClient.EntityConnection.BeginDbTransaction(IsolationLevel isolationLevel)

The forms migration log had the following details

[3/6/2020 3:08:37 PM] Starting database update.
[3/6/2020 3:08:37 PM] Initial update step of 7 found.
[3/6/2020 3:08:37 PM] Checking update from v9.3 to v10.0.
[3/6/2020 3:08:37 PM] Starting update step 8.

 

0 0

Answer

SELECTED ANSWER
replied on March 10, 2020

TLDR:

Create the TransactionHistory required by Entity Framework in the forms database. In my case the application pool identity has enough access to create this table, so I have no idea why it did not. 

In length explanation:

My first tip was the event log entry with the following two lines:

 

at Forms.Persistence.EntityFramework.Repositories.OptionRepository.SetFormsOptions(OptionKeys option, String value, Boolean commitChange, Nullable`1 tenantID)

   at FormsConfig.Infrastructure.DatabaseInfo.UpgradeDBData93_100(FormsConfigContext appContext, OptionRepository _optionrepo, MigrationLogger logger)

 

These two lines informed me what step of the process they were are at when the process failed and they are employing Entity Framework (EF). The fact they are using Entity Framework is important. Entity Framework is an object relational mapper framework for .net. In short, it allows you to represent a database table in code. Knowing this and there are lines in the stack trace saying OptionRepository and SetFormsOptions are also important as they tell me what actions they are taking on the table and what table. Every table in EF is represented as a repository. So the OptionRepository is the options table as in the cf_options table in the LFForms database. This is an educated assumption as I know the table maintains the settings corresponding to the Forms Server page of the Forms Config website.

 

Some of these details are merely superfluous as ultimately knowing the application is using Entity Framework helped me find the issue. Knowing the issue was with transactions lead me to seeing the dbo.__TransactionHistory table was not created and this is needed by Entity Framework for executing sql transactions. Once I manually created the table from TSQL (once again, using the same account the application executes under) the upgrade process was able to complete successfully.

 

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.